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

lightningd: add override amt to invoice_check_payment

Public commit record

What the developer wrote

Authored by Peter Neuroth

73/100 · Adequate
lightningd: add override amt to invoice_check_payment

Adds `expected_msat_override` to the `invoice_check_payment` check. If
it's set, it will be used to override the invoice amount as the expected
amount of the payment check.

This enables us to charge a different amount for a payment than the
amount stated on the invoice.

Signed-off-by: Peter Neuroth <pet.v.ne@gmail.com>
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This commit adds a new optional override to the internal invoice payment-checking function. It lets the node accept a payment whose amount differs from what the invoice originally stated. The change is purely internal infrastructure: all existing callers pass NULL, so the override is not yet used. There is no direct security bug visible in the diff, but it changes the assumptions around invoice amounts, which could matter for future callers.

Recommended action

Review the callers that will use expected_msat_override once they are added, to ensure the override value is derived safely and cannot be manipulated by a payer to underpay or overpay invoices. Verify that the override is only set by trusted internal logic (e.g., BOLT12 offer amount differences) and not from untrusted RPC or network input.

Security signals we found

01

Changes payment-amount validation logic in invoice acceptance path

02

Introduces an override that can bypass the invoice-stated amount

03

All current callers pass NULL, so behavior is unchanged for now

04

No input sanitization or bounds checks beyond existing twice-amount ceiling are visible for the override value

05

No vendor security framing or CVE references present

Risk score

Why this scored 28/100

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