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

fix(core): Avoid out-of-bounds read in utils.consteq().

Public commit record

What the developer wrote

Authored by Andrew Kozlik

62/100 · Adequate
fix(core): Avoid out-of-bounds read in utils.consteq().

[no changelog]
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Uses a recognizable type or scope! No meaningful explanatory body
The short version

What changed, and why it matters

This commit fixes a bug in a low-level security helper inside Trezor hardware wallets. The helper, called consteq(), compares a secret value against a public value in a way meant to take the same amount of time regardless of the secret's content, preventing timing attacks. Previously, if the public value was longer than the secret, the code could read memory past the end of the secret buffer. That out-of-bounds read could leak nearby memory contents or crash the device. The fix redirects the comparison pointer to the public buffer when lengths differ, so the loop never reads beyond the secret's valid memory while still keeping the operation's timing independent of the secret length.

Recommended action

Treat this as a security-relevant memory-safety fix. Verify the patched firmware is deployed to devices and that downstream callers no longer rely on the previous unsafe precondition. Review other constant-time helpers for similar length-mismatch assumptions.

Security signals we found

01

Out-of-bounds read in secret-comparison helper

02

Timing-attack-resistant comparison routine

03

Constant-time length-mismatch handling added

04

Docstring removed caller responsibility for memory safety

05

New unit tests for length mismatch and buffer types

Risk score

Why this scored 59/100

Our methodology →
Potential impact 18/30
Exploitability 12/25
Stealth signal 8/15
Affected reach 10/15
Confidence 7/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.