chore(core/eckhart): make wipe code dependent on pin code
What changed, and why it matters
This small change adjusts when a Trezor device shows that a 'wipe code' is set. Previously, the device menu would display the wipe-code status if the device was initialized, regardless of whether a PIN was set. After the change, the wipe-code status is only shown when both the device is initialized and a PIN is set. This is a UI/logic hardening change: it prevents a user from being misled into thinking a wipe code is active and usable when no PIN is set, because the wipe code feature depends on the PIN entry flow to trigger.
No urgent action required. Treat as a minor hardening/UI consistency fix. If reviewing related functionality, verify that wipe code creation and enforcement elsewhere also require a PIN to be set, and that the wipe code cannot be triggered or displayed through other UI paths when no PIN is configured.
Security signals we found
UI state inconsistency between wipe code and PIN presence
Hardening of feature activation precondition
No changelog suggests minor/internal change
Evidence from the diff
In core/src/apps/homescreen/device_menu.py, the wipe_code argument passed to the device menu UI is now computed as config.has_wipe_code() only when is_initialized and config.has_pin() are both true; otherwise it is None. The wipe code is a secondary PIN-like value that, when entered as the PIN, wipes the device. Since the wipe code can only be entered via the PIN entry screen, displaying or treating it as active when no PIN is configured is inconsistent and could confuse the user or lead to a false sense of security. The patch aligns the displayed state with the actual activation condition.
Changed components
core/src/apps/homescreen/device_menu.pyTrezor Safe 5 / Eckhart homescreen device menu UIwipe code status displayInspect captured patch +5 / −1
diff --git a/core/src/apps/homescreen/device_menu.py b/core/src/apps/homescreen/device_menu.py
index 81aa8379..2beb48b4 100644
--- a/core/src/apps/homescreen/device_menu.py
+++ b/core/src/apps/homescreen/device_menu.py
@@ -95,7 +95,11 @@ async def handle_device_menu() -> None:
connected_idx=connected_idx,
pin_code=config.has_pin() if is_initialized else None,
auto_lock_delay=get_auto_lock_delay(),
- wipe_code=config.has_wipe_code() if is_initialized else None,
+ wipe_code=(
+ config.has_wipe_code()
+ if (is_initialized and config.has_pin())
+ else None
+ ),
check_backup=is_initialized,
device_name=(
(storage_device.get_label() or utils.MODEL_FULL_NAME)
Why this scored 26/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.