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

injectpayment_onion: fix fees for blinded paths

Public commit record

What the developer wrote

Authored by Lagrang3

68/100 · Adequate
injectpayment_onion: fix fees for blinded paths

Changelog-Fixed: injectpayment_onion: fix fees for blinded paths, treat amount_msat as the incoming amount and not the forward amount.

Signed-off-by: Lagrang3 <lagrang3@protonmail.com>
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This commit fixes a bug in Core Lightning's `injectpaymentonion` RPC command. Previously, when a user manually injected a payment onion (a way to send a Lightning payment with a pre-built route), the command treated the `amount_msat` parameter as the amount to forward to the next peer, rather than the amount this node is expected to receive. For normal routes this was fine, but for blinded paths—where the true recipient and fees are hidden inside an encrypted onion—the node could accidentally send too much money to the next hop, effectively overpaying fees or losing funds. The fix changes the code to use the amount encoded inside the onion payload (`amt_to_forward`) as the actual amount to send onward, which is correct for blinded paths. The commit also removes an 'expected failure' marker from a test, showing the bug is now fixed.

Recommended action

Users and operators exposing `injectpaymentonion` should upgrade to a release containing this commit, especially if they build routes involving blinded paths. Review any past uses of `injectpaymentonion` with blinded paths for possible overpayment. No immediate emergency response is indicated, but the fix should be included in the next maintenance release.

Security signals we found

01

Incorrect amount used for outgoing HTLC in manual onion injection path

02

Blinded path fees could cause overpayment to next hop

03

Fix changes forward amount from user parameter to onion payload value

04

Test previously expected to fail now expected to pass

05

Documentation updated to clarify semantics of amount_msat

Risk score

Why this scored 61/100

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