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

Merge bitcoin/bitcoin#36186: test: return False for a too-short ECDSA signature

Public commit record

What the developer wrote

Authored by merge-script

96/100 · Strong
Merge bitcoin/bitcoin#36186: test: return False for a too-short ECDSA signature

00d0c5107b92c8972ab106c680579e06fd4fb100 test: return False for a too-short ECDSA signature (Ferdinando Ametrano)

Pull request description:

`verify_ecdsa` reads `sig[1]` before it checks `len(sig) < 4`, so a 0- or 1-byte signature raises `IndexError` instead of returning `False`, which the comment promises for any DER encoding error.

Move the length check ahead of the byte access, and add a regression test.

ACKs for top commit:
optout21:
reACK 00d0c5107b92c8972ab106c680579e06fd4fb100
sedited:
ACK 00d0c5107b92c8972ab106c680579e06fd4fb100

Tree-SHA512: 01b8cfee145c539c7338f8edfaae455119585026ec7d4464e27255160b741504f0d2542c4c264d40cc2e8583404d353276b8e15c23bc6a96b42262257e8c7f05
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification✓ Links an issue, advisory, or supporting reference✓ Names security-relevant behavior explicitly
The short version

What changed, and why it matters

This is a small fix in Bitcoin Core's own test helper code. A helper function used only in tests could crash with an IndexError when given an extremely short fake signature, instead of cleanly returning False. The change moves a length check earlier so the function behaves as documented. It does not affect live Bitcoin network code, wallet signing, or transaction validation.

Recommended action

No urgent action. Treat as a normal test-quality fix. Reviewers may verify the new regression test covers the reported short-signature cases and that no other test helpers have similar out-of-order bounds checks.

Security signals we found

01

Out-of-order bounds check leading to IndexError in test helper

02

Regression test added for malformed short DER signatures

03

Test-only code path, no production validation logic changed

Risk score

Why this scored 20/100

Our methodology →
Potential impact 2/30
Exploitability 1/25
Stealth signal 1/15
Affected reach 2/15
Confidence 9/10
Evidence quality 5/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.