bugfix: hide main PIN change for temporary wallets
What changed, and why it matters
This update fixes a user-interface bug where the 'Change Main PIN' option remained visible while using a temporary wallet or a BIP-39 passphrase wallet. Changing the main PIN from a temporary wallet could confuse users or lead to unexpected wallet state, so the option is now hidden in those modes. It is a straightforward menu fix rather than a cryptographic flaw.
Include in normal release notes; no urgent action required. Users on temporary seeds or passphrase wallets should simply note that the main PIN cannot be changed from those contexts.
Security signals we found
UI flow restriction for sensitive operation
Temporary wallet context isolation
Regression test added for hidden menu item
Evidence from the diff
In shared/flow.py the ‘Change Main PIN’ menu item now has predicate=is_not_tmp, so it only appears when a real (non-temporary) seed is active. A regression test confirms the option is absent after setting a BIP-39 passphrase. The change prevents PIN-change flows from being invoked from temporary-seed/passphrase contexts.
Changed components
shared/flow.pyLoginPrefsMenumain_pin_changerInspect captured patch +8 / −1
### releases/Next-ChangeLog.md
@@ -22,6 +22,7 @@ This lists the new changes that have not yet been published in a normal release.
filesystems with more than one sector per cluster), fixing an integer underflow in
`psram_copy_file`/`psram_mmap_file` that allowed out-of-bounds PSRAM writes, reads,
and mappings from a compromised USB host.
+- Bugfix: Hide Change Main PIN while a temporary seed or BIP-39 passphrase wallet is active.
# Mk Specific Changes
### shared/flow.py
@@ -151,7 +151,7 @@ async def goto_home(*a):
# Mostly pre-login values here.
LoginPrefsMenu = [
# xxxxxxxxxxxxxxxx
- MenuItem('Change Main PIN', f=main_pin_changer),
+ MenuItem('Change Main PIN', f=main_pin_changer, predicate=is_not_tmp),
NonDefaultMenuItem('Trick PINs', 'tp', menu=TrickPinMenu.make_menu, predicate=has_real_secret),
NonDefaultMenuItem('Set Nickname', 'nick', prelogin=True, f=pick_nickname),
NonDefaultMenuItem('Scramble Keys', 'rngk', prelogin=True, f=pick_scramble, default_value=0),
### testing/test_change_pins.py
@@ -181,4 +181,10 @@ def test_main_pin(goto_pin_options, pick_menu_item, cap_story, cap_screen,
change_pin(new_pin, DEF_PIN, 'Main PIN')
verify_pin_set(DEF_PIN)
+
+def test_main_pin_hidden_with_passphrase(set_bip39_pw, goto_pin_options, cap_menu):
+ set_bip39_pw('temporary wallet')
+ goto_pin_options()
+ assert 'Change Main PIN' not in cap_menu()
+
# EOFWhy this scored 38/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.