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

psbt: Add bounds check for non-witness UTXO output index

Public commit record

What the developer wrote

Authored by Erick Cestari

85/100 · Strong
psbt: Add bounds check for non-witness UTXO output index

Add validation to ensure the vout specified in a transaction input
does not exceed the number of outputs in the non-witness UTXO.
This aligns with Bitcoin Core's PSBT deserialization behavior, which
rejects PSBTs where the input references a non-existent output index.

The new NonWitnessUtxoOutOfBounds error provides detailed context
including the input index, the referenced vout, and the actual
number of outputs available in the non-witness UTXO.

Found by differential fuzzing using bitcoinfuzz.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode
The short version

What changed, and why it matters

This commit fixes a validation gap in how the library handles Partially Signed Bitcoin Transactions (PSBTs). A PSBT can include a reference to a previous transaction output (the 'non-witness UTXO') that doesn't actually exist. Before this fix, the library would not reject this, which could allow malformed or malicious PSBTs to be processed. The fix adds a bounds check so that if a PSBT input claims an output index that is too high, deserialization returns a clear error instead of silently continuing. The issue was found by differential fuzzing against Bitcoin Core.

Recommended action

Review downstream uses of PSBT deserialization to ensure malformed PSBTs are not being accepted due to the missing bounds check in prior versions. Consider whether this fix should be backported to supported release branches, as it changes deserialization behavior to reject previously accepted invalid PSBTs.

Security signals we found

01

Bounds check added for PSBT non-witness UTXO output index

02

New error variant provides detailed context for out-of-bounds references

03

Aligns behavior with Bitcoin Core PSBT deserialization

04

Found by differential fuzzing using bitcoinfuzz

05

Test vector sourced from Bitcoin Core commit 9e13ccc50eec9d2efe0f472e6d50dc822df70d84

Risk score

Why this scored 60/100

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