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

Merge PR 'Use checked addition for anchor reserve UTXO input weight' (#5488)

Public commit record

What the developer wrote

Authored by wpaulino

81/100 · Strong
Merge PR 'Use checked addition for anchor reserve UTXO input weight' (#5488)

from bot/5372-overflowing-utxo-weight-bypasses-4f282a into main

Reviewed-on: https://git.rust-bitcoin.org/lightningdevkit/rust-lightning/pulls/5488
Reviewed-by: wpaulino <wpaulino@noreply.git.rust-bitcoin.org>
✓ 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

This patch fixes a place where two numbers representing the size of a Bitcoin transaction input were added together using normal addition, which could silently overflow and wrap around to a tiny value in Rust. By switching to checked addition, the code now treats an overflow as a failure case and falls back to a maximum fee, preventing a malformed or extremely large UTXO from causing an underpriced fee estimate. The practical security impact is moderate: it could let an attacker-provided UTXO slip past a reserve check, but the surrounding code has other safeguards and the scenario requires a very large, crafted satisfaction_weight.

Recommended action

Apply the patch. Additionally, review other locations where UTXO satisfaction_weight or other externally influenced weight values are combined with constants using unchecked arithmetic, and consider input validation bounds on satisfaction_weight at deserialization or ingestion time.

Security signals we found

01

Integer overflow in weight calculation

02

Potential fee underestimation from wrapped weight

03

Reserve eligibility bypass via crafted UTXO satisfaction_weight

04

Use of checked arithmetic as hardening

Risk score

Why this scored 58/100

Our methodology →
Potential impact 18/30
Exploitability 12/25
Stealth signal 10/15
Affected reach 8/15
Confidence 7/10
Evidence quality 3/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.