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

Fix bug in `Psbt::spend_utxo` when missing output

Public commit record

What the developer wrote

Authored by Shing Him Ng

45/100 · Thin
Fix bug in `Psbt::spend_utxo` when missing output
✓ 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 panic (sudden crash) in a Bitcoin transaction-signing helper. The function `spend_utxo` previously assumed that a referenced transaction output always existed, and used unchecked array indexing. If the output was missing, the program would crash instead of returning a proper error. The fix replaces the unchecked lookup with a bounds-checked one that returns a clean error.

Recommended action

Review other index-based accesses in PSBT and signing paths for similar unchecked assumptions, and ensure malformed PSBTs from external sources are handled with controlled errors rather than panics.

Security signals we found

01

Unchecked index into `Vec` replaced with bounds-checked `get`

02

Panic-to-error conversion in transaction signing code

03

Regression test added for malformed/missing UTXO data

04

PSBT input validation hardening

Risk score

Why this scored 45/100

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