fix(core): reset settings on wallet wipe
What changed, and why it matters
This commit fixes a bug where wiping a Trezor wallet did not reset all device settings. Previously, settings like haptic feedback, RGB LED, Bluetooth, and experimental features could remain enabled or disabled based on the old wallet's preferences instead of being reloaded from storage after a wipe. The fix makes sure these settings are reloaded when the wallet is reset, so the device behaves consistently with a fresh state.
Review whether any other settings are also not reloaded after a wipe. Verify that `reload_settings_from_storage()` is called reliably during all wipe and reset code paths. Consider adding tests that assert all mutable device settings return to defaults after wallet wipe.
Security signals we found
State not fully reset after wallet wipe
Settings persistence across wallet lifecycle
Potential device misconfiguration after wipe
Evidence from the diff
The change is in core/src/apps/common/lock_manager.py. The function reload_settings_from_storage() now explicitly re-applies several device settings from storage_device after a wipe: haptic feedback, RGB LED, Bluetooth, and experimental features. Previously, these settings were not consistently reset when the wallet was wiped, meaning stale settings could persist. The commit also moves the io import out of the power-manager-only conditional block because io is now needed for haptic and RGB LED settings too, and adds a conditional import for trezorble when Bluetooth is enabled.
Changed components
core/src/apps/common/lock_manager.pystorage_device settings reload pathhaptic feedback subsystemRGB LED subsystemBluetooth subsystemexperimental features flagInspect captured patch +13 / −2
diff --git a/core/src/apps/common/lock_manager.py b/core/src/apps/common/lock_manager.py
index 01f044047..bc8e604e5 100644
--- a/core/src/apps/common/lock_manager.py
+++ b/core/src/apps/common/lock_manager.py
@@ -2,16 +2,18 @@ from typing import TYPE_CHECKING
import storage.device as storage_device
from storage.cache_common import APP_COMMON_BUSY_DEADLINE_MS
-from trezor import config, utils, wire, workflow
+from trezor import config, io, utils, wire, workflow
from trezor.wire import context
from trezor.wire.message_handler import filters, remove_filter
if utils.USE_POWER_MANAGER:
- from trezor import io
from trezor.power_management.autodim import autodim_display
from trezor.power_management.suspend import suspend_device
from trezorui_api import BacklightLevels, backlight_fade
+if utils.USE_BLE:
+ import trezorble as ble
+
if TYPE_CHECKING:
from trezor import protobuf
from trezor.wire import Handler, Msg
@@ -222,6 +224,15 @@ def reload_settings_from_storage() -> None:
if utils.USE_POWER_MANAGER:
configure_autodim()
+ if utils.USE_HAPTIC:
+ io.haptic.haptic_set_enabled(storage_device.get_haptic_feedback())
+
+ if utils.USE_RGB_LED:
+ io.rgb_led.rgb_led_set_enabled(storage_device.get_rgb_led())
+
+ if utils.USE_BLE:
+ ble.set_enabled(storage_device.get_ble())
+
wire.message_handler.EXPERIMENTAL_ENABLED = (
storage_device.get_experimental_features()
)
Why this scored 33/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.