Fix mnemonic index number display for replacement words (#785)
What changed, and why it matters
This is a tiny UI bug fix in a Bitcoin hardware wallet project. When a user replaced a word in their recovery phrase, the on-screen confirmation prompt showed the wrong word number (it ignored which page of words was being viewed). The fix makes the displayed index match the actual word position. There is no security vulnerability here.
No security action needed. Treat as a normal UI bug fix.
Security signals we found
No strong security signals were identified.
Evidence from the diff
In src/krux/pages/mnemonic_editor.py, the replacement-word confirmation prompt used button_index + 1 as the displayed mnemonic index. Because the editor paginates words 12 per page, this produced an incorrect index on any page after the first. The patch changes the displayed index to button_index + page * 12 + 1, matching the actual array index used for the replacement. This is a display-only correction; no cryptographic, input-validation, or access-control behavior changes.
Changed components
src/krux/pages/mnemonic_editor.pyInspect captured patch +1 / −1
diff --git a/src/krux/pages/mnemonic_editor.py b/src/krux/pages/mnemonic_editor.py
index 916ead3..828923e 100644
--- a/src/krux/pages/mnemonic_editor.py
+++ b/src/krux/pages/mnemonic_editor.py
@@ -326,7 +326,7 @@ class MnemonicEditor(Page):
if new_word is not None:
self.ctx.display.clear()
if self.prompt(
- str(button_index + 1) + ".\n\n" + new_word + "\n\n",
+ str(button_index + page * 12 + 1) + ".\n\n" + new_word + "\n\n",
self.ctx.display.height() // 2,
):
self.current_mnemonic[button_index + page * 12] = new_word
Why this scored 15/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.