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

Merge PR 'Report bare BOLT 11 invoice amounts that overflow pico BTC' (#5338)

Public commit record

What the developer wrote

Authored by Matt Corallo

86/100 · Strong
Merge PR 'Report bare BOLT 11 invoice amounts that overflow pico BTC' (#5338)

from bot/5332-bolt11invoice-reads-an-amount-of-7cfdc8 into main

Reviewed-on: https://git.rust-bitcoin.org/lightningdevkit/rust-lightning/pulls/5338
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 bug in how BOLT 11 Lightning invoices handle very large amounts written without a unit suffix (like 'lnbc18446745...'). Previously, such invoices could bypass an overflow check and later cause arithmetic errors or unexpected behavior when the code tried to convert the amount into smaller units. The patch now rejects these oversized amounts both during parsing and when constructing a signed invoice, returning a clear error instead.

Recommended action

Review callers that parse or construct BOLT 11 invoices to ensure they handle `Bolt11ParseError::IntegerOverflowError` and the new `Bolt11SemanticError::AmountOverflow` gracefully. Consider auditing other numeric conversions in invoice handling for similar overflow gaps.

Security signals we found

01

Integer overflow in amount parsing

02

Missing validation for bare-amount invoices

03

New semantic error variant for amount overflow

04

Test case demonstrates overflow rejection

Risk score

Why this scored 48/100

Our methodology →
Potential impact 12/30
Exploitability 8/25
Stealth signal 6/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.