What changed, and why it matters
This commit fixes a minor bug where entering the Secure Notes menu on a COLDCARD device, while in a restricted 'hobbled' mode with no saved notes, caused a crash ('yikes') instead of showing a friendly 'none saved yet' message. It is a denial-of-service-style UI bug, not a security vulnerability that can be exploited by an attacker.
No urgent security action needed. Treat as a normal bugfix. Users on affected firmware can avoid the crash by adding at least one note before enabling hobbled mode, or by upgrading when the release containing this fix is available.
Security signals we found
Removal of an assertion that caused a runtime crash in a user-facing menu path
Addition of defensive UI fallback for empty data state
Regression test added for the crash scenario
Evidence from the diff
The patch removes an assert NoteContent.count() in shared/notes.py that fired when the read-only notes menu was opened while no notes existed. It adds a fallback menu item ‘(none saved yet)’ so the menu is non-empty. A regression test in testing/test_hobble.py verifies the fix. The crash only occurs in ‘hobbled mode’ (a local spending/restriction policy) on the Q1 model, and requires the user to manually enable notes without adding any.
Changed components
shared/notes.pytesting/test_hobble.pytesting/conftest.pyreleases/Next-ChangeLog.mdInspect captured patch +19 / −3
diff --git a/releases/Next-ChangeLog.md b/releases/Next-ChangeLog.md
index 140fc78..a847a73 100644
--- a/releases/Next-ChangeLog.md
+++ b/releases/Next-ChangeLog.md
@@ -22,6 +22,6 @@ This lists the new changes that have not yet been published in a normal release.
## 1.3.6Q - 2025-12-xx
-- tbd
+- Bugfix: Empty notes in hobbled mode caused yikes upon menu entry
diff --git a/shared/notes.py b/shared/notes.py
index d63bae4..89b2349 100644
--- a/shared/notes.py
+++ b/shared/notes.py
@@ -27,7 +27,6 @@ async def make_notes_menu(*a):
# Read only version of menu system
# - used when spending policy in effect
# - must have some notes already, or unreachable
- assert NoteContent.count()
rv = NotesMenu(NotesMenu.construct_readonly())
rv.readonly = True
return rv
@@ -156,6 +155,9 @@ class NotesMenu(MenuSystem):
rv.append(MenuItem('%d: %s' % (note.idx+1, note.title),
menu=note.make_menu, arg=True)) # readonly=True
+ if not rv:
+ rv.append(MenuItem('(none saved yet)'))
+
return rv
@classmethod
diff --git a/testing/conftest.py b/testing/conftest.py
index 3eae33f..ecfbeec 100644
--- a/testing/conftest.py
+++ b/testing/conftest.py
@@ -2675,7 +2675,7 @@ from test_ephemeral import verify_ephemeral_secret_ui, get_identity_story, get_s
from test_msg import verify_msg_sign_story, sign_msg_from_text, msg_sign_export, sign_msg_from_address
from test_multisig import import_ms_wallet, make_multisig, offer_ms_import, fake_ms_txn
from test_multisig import make_ms_address, clear_ms, make_myself_wallet, import_multisig
-from test_notes import need_some_notes, need_some_passwords
+from test_notes import need_some_notes, need_some_passwords, goto_notes
from test_nfc import try_sign_nfc, ndef_parse_txn_psbt
from test_se2 import goto_trick_menu, clear_all_tricks, new_trick_pin, se2_gate, new_pin_confirmed
from test_seed_xor import restore_seed_xor
diff --git a/testing/test_hobble.py b/testing/test_hobble.py
index 93e7b55..f929c74 100644
--- a/testing/test_hobble.py
+++ b/testing/test_hobble.py
@@ -481,5 +481,19 @@ def test_h_seedxor(set_hobble, need_keypress, press_cancel, cap_screen,
press_cancel()
+
+def test_empty_notes_bug(set_hobble, goto_notes, cap_menu, pick_menu_item, is_q1):
+ if not is_q1:
+ raise pytest.skip("No notes on Mk4")
+
+ goto_notes() # enable notes - but do not add any
+ set_hobble(True, {"notes"})
+
+ pick_menu_item("Secure Notes & Passwords")
+ # here yikes would follow
+ time.sleep(.1)
+ m = cap_menu()
+ assert len(m) == 1
+ assert m[0] == "(none saved yet)"
# EOF
Why this scored 21/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.