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

Merge PR 'Handle fee multiplication overflow when merging MPP paths' (#5288)

Public commit record

What the developer wrote

Authored by Matt Corallo

86/100 · Strong
Merge PR 'Handle fee multiplication overflow when merging MPP paths' (#5288)

from bot/5191-handle-fee-multiplication-overfl-b098ce into main

Reviewed-on: https://git.rust-bitcoin.org/lightningdevkit/rust-lightning/pulls/5288
Reviewed-by: Matt Corallo <matt@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✓ Names security-relevant behavior explicitly
The short version

What changed, and why it matters

This change fixes a place in the Lightning payment routing code where adding up fees could overflow the maximum number a computer can store in a 64-bit integer. Previously, the code assumed this could never happen and would crash (panic) if it did. The patch now detects the overflow, returns an error value, and safely skips or keeps the affected payment path instead of crashing. It also prevents a path from being left half-updated if the fee recalculation fails.

Recommended action

Review whether any other callers of update_value_and_recompute_fees or compute_fees assume non-overflow; add regression tests for large-value MPP routes that trigger fee overflow; consider auditing other u64 arithmetic in the router for similar unchecked operations.

Security signals we found

01

Integer overflow in fee computation

02

Previously unreachable!() panic path reachable

03

MPP path merge could trigger overflow

04

Partial state update risk on failed recompute

05

Routing logic now gracefully discards or preserves paths on overflow

Risk score

Why this scored 52/100

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