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

primitives: reject txs with output sum > MAX_MONEY

Public commit record

What the developer wrote

Authored by jrakibi

73/100 · Adequate
primitives: reject txs with output sum > MAX_MONEY

Rejects transactions with total output value exceeds MAX_MONEY
See CVE-2010-5139
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides an explanatory body✓ 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, the total value of all its outputs is rejected if it exceeds the protocol's maximum allowed money supply (MAX_MONEY). This prevents a class of bugs similar to the historic Bitcoin Core overflow issue referenced as CVE-2010-5139, where an impossibly large total output value could cause incorrect accounting or consensus problems.

Recommended action

Review whether any other transaction deserialization or construction paths in the codebase (e.g., direct struct instantiation, non-decoder APIs) can create a Transaction with outputs summing above MAX_MONEY, and consider centralizing this invariant. Also verify that downstream crates and consensus-critical code treat this error correctly.

Security signals we found

01

New validation rule: total output value must not exceed MAX_MONEY

02

Explicit reference to CVE-2010-5139 in code comment

03

Use of saturating_add to avoid integer overflow during accumulation

04

New error variant OutputValueSumTooLarge for defensive failure

05

Test vectors imported from Bitcoin Core tx_invalid.json

Risk score

Why this scored 68/100

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