fix(core): ignore unexpected messages in backup flow during setup
What changed, and why it matters
This change wraps the wallet backup step during device setup in a helper that ignores unexpected messages. It likely prevents a setup/backup flow from being disrupted or aborted by stray or malicious messages sent to the Trezor while a backup is in progress, which could otherwise leave the device in an inconsistent state or confuse the user.
Treat as a low-to-moderate reliability/security fix. Review the full resolution of issue #6348 when available, add the promised changelog entry, and verify that `continue_on_errors` does not mask errors that should abort the backup or expose secret material. No immediate emergency response is warranted based solely on this diff.
Security signals we found
Wraps sensitive backup operation in error-suppression context manager
Targets unexpected messages during device setup/backup flow
Cross-references issue #6348, indicating a known bug being fixed
No changelog entry yet, suggesting fix is part of a larger resolution
Evidence from the diff
The patch imports continue_on_errors from trezor.wire.context and wraps the choose_backup_handler and backup_seed calls inside with continue_on_errors("Backup in progress"):. This context manager suppresses unexpected-message exceptions during the backup phase of reset_device. The commit title says it “ignore[s] unexpected messages in backup flow during setup.” No further technical details or exploit scenario are provided in the commit or diff.
Changed components
core/src/apps/management/reset_device/__init__.pyTrezor device setup / reset flowSeed backup flowInspect captured patch +9 / −8
diff --git a/core/src/apps/management/reset_device/__init__.py b/core/src/apps/management/reset_device/__init__.py
index cb6861e5..4c3fcd82 100644
--- a/core/src/apps/management/reset_device/__init__.py
+++ b/core/src/apps/management/reset_device/__init__.py
@@ -40,7 +40,7 @@ async def reset_device(msg: ResetDevice) -> Success:
prompt_backup,
show_wallet_created_success,
)
- from trezor.wire.context import call, try_get_ctx_ids
+ from trezor.wire.context import call, continue_on_errors, try_get_ctx_ids
from apps.common.request_pin import request_pin_confirm
@@ -125,13 +125,14 @@ async def reset_device(msg: ResetDevice) -> Success:
# generate and display backup information for the master secret
if perform_backup:
- # choose backup handler (prompt the user if method is `None`)
- handler = await layout.choose_backup_handler(msg.backup_method)
- await backup_seed(
- handler=handler,
- backup_type=backup_type,
- mnemonic_secret=secret,
- )
+ with continue_on_errors("Backup in progress"):
+ # choose backup handler (prompt the user if method is `None`)
+ handler = await layout.choose_backup_handler(msg.backup_method)
+ await backup_seed(
+ handler=handler,
+ backup_type=backup_type,
+ mnemonic_secret=secret,
+ )
# write settings and master secret into storage
if msg.label is not None:
Why this scored 45/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.