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

lightningd: add invoice_amt to the htlc_accepted hook

Public commit record

What the developer wrote

Authored by Peter Neuroth

73/100 · Adequate
lightningd: add invoice_amt to the htlc_accepted hook

This commit introduces a new field `invoice_msat` to the htlc_accepted
hook. If this field is specified it will replace the amount of the
invoice that belongs to the payment_hash of the HTLC on internal checks.

This is useful in scenarios where we actually expect a smaller amount
than initially specified in an invoice.

Changelog-Changed: Plugins: `htlc_accepted` hook can now override the
expected total amount of the invoice that belongs to the HTLC.

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 plugin hook capability that lets a plugin override the expected invoice amount when a Lightning payment arrives. It is a deliberate feature, not a bug fix, and the commit message and documentation describe it as useful for accepting smaller payments than originally invoiced. There is no direct evidence this change introduces a vulnerability, but any hook that can override financial validation could be misused if a malicious or buggy plugin is installed.

Recommended action

Treat this as a normal feature review. Operators should ensure only trusted plugins are granted access to the `htlc_accepted` hook, since a compromised plugin could alter payment acceptance logic. Developers should verify that `invoice_msat` cannot be used to bypass other invariants such as overpayment limits or MPP total matching.

Security signals we found

01

New hook override affects payment amount validation

02

Plugin-provided value is passed directly into invoice payment check

03

No explicit sanitization or bounds check on invoice_msat beyond JSON parsing

04

Feature is intentionally exposed to plugins via documented API

Risk score

Why this scored 40/100

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