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

Flag peers that leave liquidity fees unpaid (#3416)

Public commit record

What the developer wrote

Authored by pm47

81/100 · Strong
Flag peers that leave liquidity fees unpaid (#3416)

When a peer buys liquidity using `from_future_htlc`, we take the risk of not being paid, and rely on our suspicious peers mechanism (`max-suspicious-peers`) to bound that risk. But a peer could withdraw the payments that should pay the fees *before* the purchase is signed (with `will_fail_htlc`, by letting the proposal time out, or by disconnecting): we then signed the funding transaction without recording any fee debt, and the peer was never flagged, so it could repeat this indefinitely.


* Flag peers that leave liquidity fees unpaid

When signing a liquidity purchase paid with from_future_htlc, we now
flag our peer as suspicious if some of its fees cannot be collected from
its pending payments, as we already do when funded HTLCs are failed.

* Track underpaid liquidity purchases by funding tx

Underpaid liquidity purchases are now tracked by funding txid instead
of payment hash, and are only cleared by the node operator (using
enableFromFutureHtlc) or when restarting. Failed relays are still keyed
by payment hash. Both count towards max-suspicious-peers, and each is
reported in its own metric.

* Forget underpaid liquidity purchases when aborted

When a liquidity purchase is aborted before its funding transaction is
published, we haven't lost any fees: we now remove the corresponding
underpaid entry, and fail the upstream HTLCs of its funded payments.
We handle this event regardless of our connection state, since it is
sent asynchronously by the channel.


Reported-by: @erickcestari
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Links an issue, advisory, or supporting reference
The short version

What changed, and why it matters

This commit fixes a security gap in Eclair's Lightning node software. A peer could repeatedly get free channel funding ('liquidity') by backing out of payments meant to cover the fees right before the funding transaction was signed. Previously, Eclair didn't flag this behavior, so the peer could do it over and over. The patch now flags such peers as suspicious and temporarily blocks them from using this fee-deferral feature, limiting potential losses.

Recommended action

Operators running Eclair nodes offering liquidity ads with from_future_htlc should upgrade to include this commit. Review max-suspicious-peers settings and monitor the new underpaid-liquidity-purchases metric for abuse patterns.

Security signals we found

01

Fixes a logic flaw allowing repeated unpaid liquidity fees

02

Adds peer suspicion flagging tied to funding txid

03

Expands state handling for asynchronous LiquidityPurchaseAborted events

04

Adds new Kamon metric for underpaid liquidity purchases

05

Includes regression tests demonstrating the attack scenario and remediation

Risk score

Why this scored 64/100

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