fix(core): assert THP and BLE are enabled for T3W1 device menu
What changed, and why it matters
This commit adds a safety check that ensures two specific hardware features (THP and BLE) are enabled before a device menu function can run on the T3W1 hardware model. It is a defensive assertion to prevent the menu from operating in an unsupported configuration, not a fix for an active security vulnerability.
No immediate action required. Treat as a minor hardening commit. Review whether other T3W1-specific entry points have similar missing feature assertions.
Security signals we found
Defensive assertion added to enforce build-time feature flags
Prevents potential runtime failure or undefined behavior in unsupported build configuration
No changelog entry suggests minor/internal fix
Evidence from the diff
The change inserts assert utils.USE_THP and utils.USE_BLE at the start of handle_device_menu() in core/src/apps/homescreen/device_menu.py. This function appears related to managing paired Bluetooth-like devices on the T3W1 model. The assertion ensures the code only runs when both Trezor Host Protocol (THP) and Bluetooth Low Energy (BLE) support are compiled in. Without the assertion, the function could be entered on a build where those subsystems are absent, likely causing an import or runtime failure when it later imports ..thp.paired_cache.
Changed components
core/src/apps/homescreen/device_menu.pyT3W1 device model homescreen device menuTHP/BLE feature-gated code pathsInspect captured patch +1 / −0
diff --git a/core/src/apps/homescreen/device_menu.py b/core/src/apps/homescreen/device_menu.py
index 4bf30aa98..7f75cb8a0 100644
--- a/core/src/apps/homescreen/device_menu.py
+++ b/core/src/apps/homescreen/device_menu.py
@@ -27,6 +27,7 @@ def _find_device(connected_addr: bytes | None, bonds: list[bytes]) -> int | None
async def handle_device_menu() -> None:
from trezor import strings
+ assert utils.USE_THP and utils.USE_BLE
from ..thp import paired_cache
is_initialized = storage_device.is_initialized()
Why this scored 17/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.