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

channeld: fail the channel instead of crashing if we can't build a commitment

Public commit record

What the developer wrote

Authored by jaonoctus

85/100 · Strong
channeld: fail the channel instead of crashing if we can't build a commitment

channel_txs() returns NULL when it can't build a commitment, for example
when a splice amount would take one side's balance below zero:

channel_txs fails to amount_msat_add_sat_s64 ... LOCAL (side_pay + splice_amnt)

Neither send_commit_part() nor handle_peer_commit_sig() checked for that,
so channeld dereferenced NULL and crashed. Since every reconnect rebuilds
the same commitment, it then crashed again on each one, leaving the
channel stuck in a crash loop that only a unilateral close would end.

There's no way to continue on a commitment we can't build, so fail the
channel and say why. The next commit stops the case we know about
reaching here at all.

Changelog-None

Co-Authored-By: Ken Sedgwick <ken@bonsai.com>

(cherry picked from commit 2594edab350be11c68459e546921e6c0d1d07739)
✓ 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 update fixes a bug where a part of the Core Lightning node (channeld) would crash and enter an endless crash loop if it couldn't build a commitment transaction, for example due to a splice that would push one side's balance below zero. The fix makes the node fail the channel gracefully instead of crashing. A malicious or buggy peer could potentially trigger this crash repeatedly on reconnection, causing denial of service for that channel.

Recommended action

Apply the patch to prevent channeld crashes and denial-of-service via repeated reconnects. Monitor for follow-up commit that prevents the known splice case from reaching this failure path. Consider adding regression tests for unconstructable commitments during splicing.

Security signals we found

01

NULL pointer dereference crash in channel commitment construction

02

Denial-of-service via reconnect crash loop

03

Splice-related balance underflow leading to unconstructable commitment

04

Missing return-value check on channel_txs() in two call sites

05

Crash loop only terminable by unilateral close

Risk score

Why this scored 60/100

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