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

lightningd: fix crash on mutual close of an unconfirmed dual-funded channel

Public commit record

What the developer wrote

Authored by Sangbida Chaudhuri

73/100 · Adequate
lightningd: fix crash on mutual close of an unconfirmed dual-funded channel

After an RBF the channel has more than one candidate funding tx. After
a mutual close we watch the ones we didn't close on, in case they
confirm. To build that watch we need the peer's funding key, and we
were reading it from a field that only splices fill in. For RBF it is
NULL, and we crashed on it:

lightningd: FATAL SIGNAL 6
bitcoin/pubkey.c:88 (pubkey_cmp)
bitcoin/script.c:155 (bitcoin_redeem_2of2)
lightningd/peer_control.c:530 (drop_to_chain)
lightningd/closing_control.c (peer_closing_complete)

RBF never changes the funding keys, so use the channel's own copy of
the peer's key instead.

Changelog-Fixed: lightningd: fix a crash on cooperative close of an unconfirmed dual-funded channel.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This update fixes a bug where a specific type of Lightning channel close could crash the node. It only happens when both parties cooperatively close a dual-funded channel that has not yet been confirmed and has gone through a funding bump (RBF). The crash is due to the software looking in the wrong place for a needed public key. The fix makes it use the correct copy of that key.

Recommended action

Apply the patch. It is a targeted, low-risk fix. Node operators running dual-funded channels with RBF should upgrade to avoid crashes during cooperative close of unconfirmed channels.

Security signals we found

01

NULL pointer dereference leading to daemon crash (denial of service)

02

Crash occurs in cooperative-close path for unconfirmed dual-funded/RBF channels

03

Fix uses canonical channel funding key instead of splice-only field

Risk score

Why this scored 51/100

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