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

qr: fix left shift beyond type size

Public commit record

What the developer wrote

Authored by Jon Griffiths

45/100 · Thin
qr: fix left shift beyond type size

Found by ubsan.
✓ Descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
The short version

What changed, and why it matters

This commit fixes a subtle type bug in the QR code display code of the Blockstream Jade hardware wallet. A value returned from a function was stored as a `bool` (true/false), but later used in a bit-shift operation. In C, shifting a `bool` by 32 or more bits is undefined behavior and was caught by an undefined-behavior sanitizer. The fix changes the variable type to `uint32_t` so the shift is well-defined. The practical security impact is likely low: it affects only QR rendering, not private keys or transaction signing, and hardware-wallet QR output is not attacker-controlled input. However, undefined behavior in embedded firmware is worth cleaning up because compilers may optimize it unpredictably.

Recommended action

Apply the patch. Consider running UBSan/ASan builds in CI for the QR and display code paths. No immediate incident response is indicated because the issue is in a non-privileged output path and no exploit has been demonstrated.

Security signals we found

01

Undefined behavior sanitizer (UBSan) finding

02

Left shift beyond type width

03

Type promotion bug in bit manipulation

04

QR code rendering path only

05

No input validation bypass or memory corruption directly demonstrated

Risk score

Why this scored 35/100

Our methodology →
Potential impact 8/30
Exploitability 5/25
Stealth signal 6/15
Affected reach 7/15
Confidence 6/10
Evidence quality 3/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.