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

psbt: fix check for too many witnesses

Public commit record

What the developer wrote

Authored by Jon Griffiths

60/100 · Adequate
psbt: fix check for too many witnesses

Thanks to @erickcestari for reporting and suggesting a fix.
✓ Descriptive subject✓ Names a concrete action or component✓ Provides an explanatory body
The short version

What changed, and why it matters

This commit fixes a parsing bug in how the library reads Bitcoin-style witness data from a transaction or PSBT. Before the fix, a malformed input could claim there were millions of witnesses while only providing a few bytes. The code would then try to read far beyond the available data, likely causing a crash or memory corruption. The fix adds a simple size check so the parser rejects obviously impossible inputs early.

Recommended action

Treat as a security fix and include in the next maintenance release. Backport to supported branches. The patch is minimal and only adds a lower-bound length check, so it is low-risk to deploy. Users parsing untrusted PSBTs or transactions should upgrade.

Security signals we found

01

Out-of-bounds read / buffer over-read in a core deserialization routine

02

Potential memory allocation failure or integer overflow from attacker-controlled witness count

03

New negative test case added for malformed PSBT with excessive witness count

04

Fix credited to external reporter @erickcestari

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.