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

primitives: reject transaction with duplicate inputs

Public commit record

What the developer wrote

Authored by jrakibi

91/100 · Strong
primitives: reject transaction with duplicate inputs

As part of adding validation rules to transactions, this check rejects
transactions with duplicate inputs during the decoding stage

Also updated a test case in the encode/decode roundtrip, the test was
using duplicated inputs which causes it to fail with the current
implementation.

Addresses part of https://github.com/rust-bitcoin/rust-bitcoin/issues/5383

Related: CVE-2018-17144
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification✓ Links an issue, advisory, or supporting reference
The short version

What changed, and why it matters

This commit adds a safety check in the rust-bitcoin library so that when a Bitcoin transaction is being decoded, it is rejected if it tries to spend the same coin twice within the same transaction. This prevents a known bug class (CVE-2018-17144) where duplicate inputs could cause nodes to crash or accept invalid transactions. The change also updates existing tests that accidentally used duplicate inputs.

Recommended action

Review whether duplicate-input rejection should also apply to transaction construction APIs (not only decoding), and confirm the error is propagated correctly by downstream consumers. Consider adding fuzzing or additional test vectors for edge cases such as many inputs or coinbase transactions.

Security signals we found

01

Adds duplicate-input validation during transaction decoding

02

Explicitly references CVE-2018-17144 in commit message and code comment

03

Adds negative test using Bitcoin Core tx_invalid.json vector

04

Updates existing tests that previously used duplicate inputs

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.