AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
High 70 Bitcoin

fix(core/embed): bound bond count before sizing the BLE bond list probe

Public commit record

What the developer wrote

Authored by tychovrahe

90/100 · Strong
fix(core/embed): bound bond count before sizing the BLE bond list probe

`sizeof(bt_le_addr_t) * count` is computed in a 32-bit `size_t`, so a
large `count` wraps and shrinks the probed range to a few bytes, while
`ble_get_bond_list()` ignores `count` on that path and always copies
`BLE_MAX_BONDS` entries. An applet could therefore have the kernel write
bond records past the end of the memory that was checked.

Reject counts above `BLE_MAX_BONDS`, which is both what the
implementation is willing to write and low enough that the size cannot
overflow. The only callers pass exactly `BLE_MAX_BONDS`.

[no changelog]

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Uses a recognizable type or scope✓ Provides detailed explanatory context✓ Names security-relevant behavior explicitly
The short version

What changed, and why it matters

This commit fixes a kernel-level memory overflow bug in the Trezor firmware's Bluetooth system. A malicious applet running on the device could request a huge number of Bluetooth 'bond' records, causing a size calculation to wrap around due to 32-bit arithmetic limits. The kernel would then write far more data than the memory area it had verified was safe, potentially overwriting other memory. The fix rejects any request larger than the maximum number of bonds the system actually supports.

Recommended action

Treat this as a security fix and include it in the next firmware release. Backport to supported branches. Review other syscall verifiers for similar 32-bit size_t overflow patterns. Consider adding static analysis or fuzzing rules targeting `probe_write_access`/`probe_read_access` size arguments.

Security signals we found

01

Integer overflow in size calculation leading to out-of-bounds write

02

Kernel syscall verifier bypass

03

Trusted kernel writes attacker-influenced data past verified buffer boundary

04

Memory safety violation in Bluetooth bond list syscall

Risk score

Why this scored 70/100

Our methodology →
Potential impact 22/30
Exploitability 16/25
Stealth signal 10/15
Affected reach 10/15
Confidence 8/10
Evidence quality 4/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.