feat(core): force longer auto-lock dur if needed
What changed, and why it matters
This commit changes the Trezor hardware wallet's screen-lock/suspend behavior so that during two sensitive setup tasks—creating a wallet backup and recovering a wallet—the device stays awake for at least 2 minutes instead of using the normal 40-second battery timeout. This only affects the battery-powered T3W1 model. It is a usability/usability-safety feature, not a fix for a known exploitable vulnerability.
No immediate security action required. Review whether the longer suspend window could increase physical-side-channel or shoulder-surf exposure during backup/recovery, and ensure the device still locks promptly after the flow completes (the `finally` block restores the default).
Security signals we found
Behavioral change to auto-lock/auto-suspend timing
Only affects battery-powered device variant (T3W1)
Applied to backup and recovery workflows
No input validation, buffer handling, or cryptographic changes
No vendor statement that this resolves a security vulnerability
Evidence from the diff
The patch adds a with_prolonged_suspend_time decorator in lock_manager.py that temporarily raises the auto-lock delay to 120,000 ms (2 minutes) by passing min_delay_ms to a new configure_autodim() helper. The decorator is applied to recovery_process() in recovery_device/homescreen.py and backup_seed() in reset_device/init.py. It is gated by utils.USE_POWER_MANAGER and only relevant to battery-powered operation (T3W1). The change is framed as improving critical onboarding flows, not as a security bug fix.
Changed components
core/src/apps/common/lock_manager.pycore/src/apps/management/recovery_device/homescreen.pycore/src/apps/management/reset_device/__init__.pycore/src/boot.pyInspect captured patch +39 / −2
diff --git a/core/.changelog.d/6567.added b/core/.changelog.d/6567.added
new file mode 100644
index 00000000..05d29954
--- /dev/null
+++ b/core/.changelog.d/6567.added
@@ -0,0 +1 @@
+[T3W1] Prolong minimal auto-suspend time during backup and recovery to 2 minutes.
diff --git a/core/src/apps/common/lock_manager.py b/core/src/apps/common/lock_manager.py
index 71ba44e9..be582822 100644
--- a/core/src/apps/common/lock_manager.py
+++ b/core/src/apps/common/lock_manager.py
@@ -15,9 +15,14 @@ if utils.USE_BLE:
import trezorble as ble
if TYPE_CHECKING:
+ from typing import Awaitable, Callable, ParamSpec, TypeVar
+
from trezor import protobuf
from trezor.wire import Handler, Msg
+ P = ParamSpec("P")
+ R = TypeVar("R")
+
_SCREENSAVER_IS_ON = False
@@ -27,6 +32,8 @@ if not utils.USE_POWER_MANAGER:
pass
else:
+ from micropython import const
+
from trezor import loop
_SHOULD_SUSPEND = False
@@ -101,14 +108,37 @@ else:
lock_device_if_unlocked()
def configure_autodim() -> None:
- """Configure the autodim setting via idle timer."""
+ """Configure the autodim setting via idle timer (battery-specific)."""
workflow.idle_timer.set(storage_device.AUTODIM_DELAY_MS, autodim_display)
+
+ def configure_autolock(min_delay_ms: int = 0) -> None:
+ """Configure the autolock setting via idle timer (battery-specific)."""
+ delay_ms = max(min_delay_ms, storage_device.get_autolock_delay_battery_ms())
workflow.idle_timer.set(
- storage_device.get_autolock_delay_battery_ms(),
+ delay_ms,
lock_device_if_unlocked_on_battery,
)
+def with_prolonged_suspend_time(
+ func: Callable[P, Awaitable[R]],
+) -> Callable[P, Awaitable[R]]:
+ """Decorator to prolong the suspend time to at least 2 minutes while executing the decorated function."""
+ if utils.USE_POWER_MANAGER:
+
+ async def wrapper(*args: "P.args", **kwargs: "P.kwargs") -> R:
+ _PROLONGED_SUSPEND_TIME_MS = const(2 * 60 * 1000)
+ configure_autolock(min_delay_ms=_PROLONGED_SUSPEND_TIME_MS)
+ try:
+ return await func(*args, **kwargs)
+ finally:
+ configure_autolock(min_delay_ms=0)
+
+ return wrapper
+ else:
+ return func
+
+
def set_homescreen() -> None:
import storage.recovery as storage_recovery
@@ -224,6 +254,7 @@ def reload_settings_from_storage() -> None:
if utils.USE_POWER_MANAGER:
configure_autodim()
+ configure_autolock()
if utils.USE_HAPTIC:
io.haptic.haptic_set_enabled(storage_device.get_haptic_feedback())
diff --git a/core/src/apps/management/recovery_device/homescreen.py b/core/src/apps/management/recovery_device/homescreen.py
index a11337c7..0596c943 100644
--- a/core/src/apps/management/recovery_device/homescreen.py
+++ b/core/src/apps/management/recovery_device/homescreen.py
@@ -7,6 +7,7 @@ from trezor.messages import Success
from trezor.wire import message_handler
from apps.common import backup_types
+from apps.common.lock_manager import with_prolonged_suspend_time
from . import layout, recover
@@ -29,6 +30,7 @@ async def recovery_homescreen() -> None:
await recovery_process(None)
+@with_prolonged_suspend_time
async def recovery_process(method: BackupMethod | None) -> Success:
import storage
from trezor.enums import MessageType, RecoveryType
diff --git a/core/src/apps/management/reset_device/__init__.py b/core/src/apps/management/reset_device/__init__.py
index 4c3fcd82..d9dcd8d8 100644
--- a/core/src/apps/management/reset_device/__init__.py
+++ b/core/src/apps/management/reset_device/__init__.py
@@ -9,6 +9,7 @@ from trezor.ui.layouts import confirm_action
from trezor.wire import ProcessError
from apps.common import backup_types
+from apps.common.lock_manager import with_prolonged_suspend_time
from . import layout
@@ -354,6 +355,7 @@ def _compute_secret_from_entropy(
return secret
+@with_prolonged_suspend_time
async def backup_seed(
handler: layout.BackupHandler,
backup_type: BackupType,
diff --git a/core/src/boot.py b/core/src/boot.py
index 940f0334..82fa08e5 100644
--- a/core/src/boot.py
+++ b/core/src/boot.py
@@ -96,6 +96,7 @@ async def bootscreen() -> None:
"""
if utils.USE_POWER_MANAGER:
lock_manager.configure_autodim()
+ lock_manager.configure_autolock()
while True:
try:
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.