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

Fix panic when calling `batch_funding_transaction_generated` early

Public commit record

What the developer wrote

Authored by Matt Corallo

73/100 · Adequate
Fix panic when calling `batch_funding_transaction_generated` early

If a user calls `batch_funding_transaction_generated` before a
channel is ready to fund its possible to hit an `unwrap` when the
transaction-scanning logic attempts to fetch the channel's expected
output `scriptPubKey`.

While users shouldn't be doing this, we should also avoid the
panic, so here check the channel state first.

Found by the `full_stack_target` fuzzer.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This commit fixes a crash (panic) in the Lightning Dev Kit's rust-lightning library. The crash could happen if a user called a specific function, `batch_funding_transaction_generated`, too early in the channel-opening process—before the channel was actually ready to be funded. The fix adds a state check so the function returns a normal error instead of crashing. It was discovered by an internal fuzzer, not reported by an outside researcher.

Recommended action

Apply the patch. It is a straightforward defensive fix that prevents a panic and returns a proper API error. No immediate incident response is indicated because the issue requires a user to call the API at an invalid time and was found internally.

Security signals we found

01

Fixes a panic (denial-of-service vector) in channel funding API

02

Adds state validation before destructive channel mutation

03

Adds regression test for the panic condition

04

Discovered by internal fuzzer `full_stack_target`

Risk score

Why this scored 33/100

Our methodology →
Potential impact 8/30
Exploitability 4/25
Stealth signal 3/15
Affected reach 4/15
Confidence 9/10
Evidence quality 5/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.