fix(core): `ble.unpair()` should be called with an argument
What changed, and why it matters
This commit fixes a small mismatch in how the Trezor device tells its Bluetooth subsystem to forget a paired device. The underlying Rust function now requires an address argument (or None), and the Python caller was updated to always pass one. The change is a code-cleanup/fix rather than a clear security vulnerability, but the previous default-argument path could have hidden caller mistakes.
Treat as a minor defensive fix. Review whether any other call sites or downstream code still rely on the optional default argument for `ble.unpair()`. No urgent security action is indicated by the diff alone.
Security signals we found
API contract tightened: optional default argument removed, requiring explicit argument
Bluetooth bond-erasure function signature changed
Call site simplified to always pass msg.addr, eliminating implicit None path
No changelog entry provided
Evidence from the diff
The Rust MicroPython binding for ble.unpair() previously declared addr: bytes | None = None, making the argument optional. The commit changes the signature to require addr: bytes | None. The Python management app core/src/apps/management/ble/unpair.py is simplified so it always calls ble.unpair(msg.addr) instead of branching between ble.unpair(msg.addr) and ble.unpair(). The mock stub is updated to match. This removes a default-argument path and ensures the caller explicitly provides the address or None.
Changed components
core/embed/rust/src/trezorhal/ble/micropython.rscore/mocks/generated/trezorble.pyicore/src/apps/management/ble/unpair.pyInspect captured patch +3 / −5
diff --git a/core/embed/rust/src/trezorhal/ble/micropython.rs b/core/embed/rust/src/trezorhal/ble/micropython.rs
index 4e15f8981..db0e6bf94 100644
--- a/core/embed/rust/src/trezorhal/ble/micropython.rs
+++ b/core/embed/rust/src/trezorhal/ble/micropython.rs
@@ -293,7 +293,7 @@ pub static mp_module_trezorble: Module = obj_module! {
/// """
Qstr::MP_QSTR_erase_bonds => obj_fn_0!(py_erase_bonds).as_obj(),
- /// def unpair(addr: bytes | None = None):
+ /// def unpair(addr: bytes | None):
/// """
/// Erases the bond for the given address or for current connection if addr is None.
/// Raises exception if BLE driver reports an error.
diff --git a/core/mocks/generated/trezorble.pyi b/core/mocks/generated/trezorble.pyi
index 48f96bb61..bb4b41381 100644
--- a/core/mocks/generated/trezorble.pyi
+++ b/core/mocks/generated/trezorble.pyi
@@ -38,7 +38,7 @@ def erase_bonds():
# rust/src/trezorhal/ble/micropython.rs
-def unpair(addr: bytes | None = None):
+def unpair(addr: bytes | None):
"""
Erases the bond for the given address or for current connection if addr is None.
Raises exception if BLE driver reports an error.
diff --git a/core/src/apps/management/ble/unpair.py b/core/src/apps/management/ble/unpair.py
index 3860f4645..4e6154b22 100644
--- a/core/src/apps/management/ble/unpair.py
+++ b/core/src/apps/management/ble/unpair.py
@@ -37,10 +37,8 @@ async def unpair(msg: BleUnpair) -> None:
if msg.all:
ble.erase_bonds()
- elif msg.addr is not None:
- ble.unpair(msg.addr)
else:
- ble.unpair()
+ ble.unpair(msg.addr)
if msg.all:
await show_success(
Why this scored 29/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.