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

Additional check to avoid vout_scriptpubkey overflow

Public commit record

What the developer wrote

Authored by Ilya Artemov

67/100 · Adequate
Additional check to avoid vout_scriptpubkey overflow
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Explains rationale or failure mode✓ Names security-relevant behavior explicitly! No meaningful explanatory body
The short version

What changed, and why it matters

This commit adds a safety check in the Ledger Bitcoin app's code that parses previous transaction outputs. Before copying a scriptPubKey (the part of a Bitcoin output that locks funds) into a fixed-size buffer, the code now verifies the copy won't exceed the buffer's maximum length when combined with how much has already been written. Without this check, a malformed or oversized scriptPubKey could overflow the buffer, potentially corrupting memory and affecting the device's behavior. The commit also fixes two nearby variables from 'bool' to 'int' so parser error codes are preserved instead of being collapsed to true/false.

Recommended action

Treat this as a security-relevant hardening fix. Review whether the same offset-aware length check is needed elsewhere in the PSBT/raw transaction parser, confirm MAX_PREVOUT_SCRIPTPUBKEY_LEN is consistent with protocol limits, and consider fuzzing the parser with oversized and chunked scriptPubKeys. If a CVE is desired, request one through Ledger's disclosure process.

Security signals we found

01

Buffer overflow / out-of-bounds write prevention

02

Missing offset-aware bounds check before memcpy

03

Integer/boolean type correction that preserves error codes

04

PSBT / previous transaction parsing hardening

Risk score

Why this scored 71/100

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