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

psbt: Fix `PSBTInputSignedAndVerified` bounds `assert`

Public commit record

What the developer wrote

Authored by Lőrinc

81/100 · Strong
psbt: Fix `PSBTInputSignedAndVerified` bounds `assert`

The previous `assert` used `>=`, allowing `input_index == psbt.inputs.size()` and out-of-bounds access in `psbt.inputs[input_index]`.

Found during review: https://github.com/bitcoin/bitcoin/pull/31650#discussion_r2685892867
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Links an issue, advisory, or supporting reference
The short version

What changed, and why it matters

A one-character bug fix in Bitcoin Core's PSBT (Partially Signed Bitcoin Transaction) handling. The code used the wrong comparison in a safety check, so it was possible to request an input index exactly equal to the number of inputs. That would read one element past the end of the list, which can cause a crash or undefined behavior. The fix changes the check so it correctly rejects that out-of-bounds index.

Recommended action

Apply the patch. Consider whether the function should return a failure status instead of asserting, since assert behavior depends on build configuration and callers may pass untrusted input indices.

Security signals we found

01

Out-of-bounds vector access due to incorrect bounds assertion

02

Use of assert for input validation (debug-only abort, not runtime error handling)

03

Fix discovered during peer review rather than active incident response

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.