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

ln: use outer onion values in PendingHTLCInfo for trampoline

Public commit record

What the developer wrote

Authored by Carla Kirk-Cohen

85/100 · Strong
ln: use outer onion values in PendingHTLCInfo for trampoline

When we are a trampoline node receiving an incoming HTLC, we need access
to our outer onion's amount_to_forward to check that we have been
forwarded the correct amount. We can't use the amount in the inner
onion, because that contains our fee budget - somebody could forward us
less than we were intended to receive, and provided it is within the
trampoline fee budget we wouldn't know.

In this commit we set our outer onion values in PendingHTLCInfo to
perform this validation properly. In the commit that follows, we'll
start tracking our expected trampoline values in trampoline-specific
routing info.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode
The short version

What changed, and why it matters

This commit fixes a bug in how trampoline routing nodes validate incoming Lightning payments. Previously, the node used values from the inner (trampoline) onion, which included the fee budget, to check whether it received the correct amount. A malicious or buggy upstream node could forward less money than intended, and as long as the shortfall stayed within the fee budget, the trampoline node would not detect it. The patch makes the node use the outer onion's stated amount instead, so it can verify it actually received what it was supposed to before forwarding.

Recommended action

Treat as a security fix and include in release notes. Users running trampoline routing nodes should upgrade. Review related follow-up commit for complete trampoline routing-info tracking. Consider whether the blinded-forward check's discarded return values need additional validation elsewhere.

Security signals we found

01

Use of incorrect payment amount source for validation (inner vs outer onion)

02

Potential fee-budget underpayment by upstream peer

03

Fix changes which amount value is stored in pending HTLC state for trampoline forwarding

04

Commit message explicitly describes the security/fee-skimming risk

Risk score

Why this scored 59/100

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