fix(core): clear PIN keyboard in FW main loop
What changed, and why it matters
This patch fixes a UI state issue in Trezor hardware wallets. If the device auto-locks while the user is in the middle of typing their PIN, the on-screen PIN keyboard could remain visible even though the device is now locked. The fix detects this situation and clears/restarts the workflow so the keyboard doesn't linger. It is primarily a user-interface consistency bug, but leaving an active PIN entry screen on a locked device could confuse users or create a minor information-leak signal (that a PIN was being entered).
Apply the patch. It is a low-risk, defensive fix. Users should update firmware when a release containing this commit is available. No immediate off-device mitigation is needed.
Security signals we found
UI state desynchronization between lock and PIN entry
Potential information disclosure that PIN entry was in progress
Workflow cleanup on unexpected autolock transition
Evidence from the diff
In core/src/apps/common/lock_manager.py, the lock_device_if_unlocked() function now checks whether config.is_unlocked() is false before calling suspend_and_resume() when workflow.autolock_interrupts_workflow is true. If the device is locking during PIN entry, it calls workflow.close_others() to restart/clear other workflows, ensuring the PIN keyboard input field is not left on screen. The patch is small and defensive, addressing a state-synchronization issue between the lock manager and the UI workflow.
Changed components
core/src/apps/common/lock_manager.pyTrezor Core firmware lock/autolock logicPIN entry workflow / on-device keyboard UIInspect captured patch +3 / −0
diff --git a/core/src/apps/common/lock_manager.py b/core/src/apps/common/lock_manager.py
index 8711448d..ec02b2b5 100644
--- a/core/src/apps/common/lock_manager.py
+++ b/core/src/apps/common/lock_manager.py
@@ -168,6 +168,9 @@ def lock_device_if_unlocked() -> None:
if utils.USE_POWER_MANAGER and not utils.EMULATOR:
if workflow.autolock_interrupts_workflow:
+ if not config.is_unlocked():
+ # locking during PIN entering should restart the workflow, otherwise the keyboard input field is not cleared
+ workflow.close_others()
# suspend immediately
suspend_and_resume()
else:
Why this scored 49/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.