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

unit tests: Fix length overflow in unit-test PSBT parser

Public commit record

What the developer wrote

Authored by Salvatore Ingala

88/100 · Strong
unit tests: Fix length overflow in unit-test PSBT parser

Avoid addition that could be larger than UINT64_MAX and wrap around,
causing a bogus length to reach the mock dispatcher.

Also make psbt_parse() reject trailing bytes after the last output map.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification✓ Names security-relevant behavior explicitly
The short version

What changed, and why it matters

This commit fixes an arithmetic overflow bug in a test-only PSBT (Bitcoin transaction format) parser used in unit tests. The bug could let a crafted test input make the parser think a data length is huge, potentially confusing the mock dispatcher in tests. It also adds a check that no unexpected trailing bytes remain after parsing. The fix only affects unit-test code, not the actual Ledger app that runs on devices.

Recommended action

No action needed for end users; the change is in unit-test infrastructure. For developers, ensure the fixed unit-test parser is rebuilt and tests are re-run. Consider whether similar additive length checks exist in the production PSBT parser and apply the same subtractive pattern if present.

Security signals we found

01

Integer overflow/wrap-around in length calculation

02

Out-of-bounds length derived from arithmetic on attacker-influenced offsets

03

Unit-test-only code path, not device firmware

04

Addition of trailing-byte validation improving parser strictness

Risk score

Why this scored 37/100

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