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

channeld: bound HTLC additions by our own splice-out amount

Public commit record

What the developer wrote

Authored by jaonoctus

73/100 · Adequate
channeld: bound HTLC additions by our own splice-out amount

While a splice is inflight, every HTLC has to fit on the commitment for
each funding candidate, so get_room_above_reserve() charges each side's
lowest splice change (lowest_splice_amnt) against its balance. But
update_view_from_inflights() set our side's bound from the inflight's
new funding total, which is positive, so it stayed at zero and our
splice-out was never charged.

We then admitted HTLCs that fit only the pre-splice commitment. Building
the post-splice commitment took our balance negative, channel_txs()
returned NULL, and channeld dereferenced it and crashed, then did the same
on every reconnect:

during the splice, payments were forwarded out through the channel
cumulatively they exceeded our post-splice balance (invalid on the
post-splice commitment)
...
channeld crashed building the post-splice commitment: our balance
went negative, the commitment build returned nothing, and channeld
dereferenced it
every reconnect rebuilds the same commitment, so it loops

Use the inflight's signed local change for our bound, as the remote side
already does. Also fix the REMOTE-view assignments, which compared
against one side's bound and wrote the other's.

Reported-by: Ken Sedgwick <ken@bonsai.com>
Changelog-Fixed: channeld: no longer crash-loops when an HTLC that only the pre-splice commitment can carry is added during a splice-out.
Co-Authored-By: Ken Sedgwick <ken@bonsai.com>

(cherry picked from commit 733c42e823bb204e6d91cca4f0450158842404e3)
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This fix repairs a bug in Core Lightning's channel daemon that could crash and permanently loop-crash a node during a specific kind of Bitcoin channel upgrade called a 'splice-out.' While the splice was in progress, the program failed to subtract the node's outgoing splice amount when checking whether new forwarded payments would fit in the updated channel. It therefore allowed payments that were valid only for the old channel state. When it later tried to build the post-splice commitment transaction, the node's balance went negative, the builder returned nothing, and the daemon dereferenced that null pointer and crashed. On every reconnect it rebuilt the same bad commitment, so the node would crash again in a loop. The patch corrects the accounting so the splice-out amount is properly charged against the balance, and also fixes a related indexing mistake that mixed up local and remote views.

Recommended action

Apply the patch and backport it to maintained release branches. Nodes that perform splice-outs should upgrade before initiating splice-out operations. Monitor for crash-loop behavior during splice operations and consider disabling splice-out functionality until patched.

Security signals we found

01

Null-pointer dereference crash in channeld

02

Crash loop on reconnect due to deterministic bad commitment rebuild

03

Incorrect balance accounting during splice inflight

04

Cross-view index mismatch in lowest_splice_amnt assignment

05

Denial-of-service against a forwarding node during a splice-out

Risk score

Why this scored 66/100

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