Fix #329: Hide disabled QR scanner in recovery phrase import menu (#338)
What changed, and why it matters
This commit fixes a UI bug in the recovery phrase import menu. Previously, the menu showed buttons for import methods (like a QR scanner) even when those methods were disabled. Now it only shows methods that are actually enabled. This is a user experience fix rather than a security vulnerability.
No security action required. Treat as a normal UI/UX fix.
Security signals we found
UI consistency fix for disabled functionality
No cryptographic, authentication, or authorization changes
No input validation, memory safety, or privilege changes
Evidence from the diff
In src/specter.py, the import_mnemonic() method changed its menu button filter from if host.button to if host.is_enabled. The old logic displayed any host that had a button attribute, regardless of whether the host was enabled. The new logic only displays hosts where is_enabled is true. This prevents disabled hosts (e.g., a disabled QR scanner) from appearing as selectable import options.
Changed components
src/specter.py: import_mnemonic() menu constructionInspect captured patch +1 / −1
diff --git a/src/specter.py b/src/specter.py
index e1ff747..449cd1b 100644
--- a/src/specter.py
+++ b/src/specter.py
@@ -298,7 +298,7 @@ class Specter:
async def import_mnemonic(self):
host = await self.gui.menu(title="What to use for import?", note="\n",
- buttons=[(host, host.button) for host in self.hosts if host.button],
+ buttons=[(host, host.button) for host in self.hosts if host.is_enabled],
last=(255, None))
if host == 255:
return
Why this scored 18/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.