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

Merge PR 'Guard pending closing signatures before channel_ready' (#5681)

Public commit record

What the developer wrote

Authored by Matt Corallo

81/100 · Strong
Merge PR 'Guard pending closing signatures before channel_ready' (#5681)

from auto-pr-bot/bot/388-guard-pending-closing-signatures-679e36 into main

Reviewed-on: https://git.rust-bitcoin.org/lightningdevkit/rust-lightning/pulls/5681
Reviewed-by: Matt Corallo <matt@noreply.git.rust-bitcoin.org>
✓ 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 change fixes a Lightning channel bug where a malicious peer could renegotiate the closing transaction fee while the local node was still waiting for its own signer to produce the final signature. If allowed, the local node might combine its fresh signature for the new fee with a cached peer signature for the old fee, producing an invalid closing transaction and potentially preventing the channel from closing cleanly. The fix expands the guard that detects a pending closing signature to cover earlier channel states, so such renegotiation attempts are rejected with a warning.

Recommended action

Review the broader shutdown/closing_signed state machine to ensure no other pre-ChannelReady states or edge cases allow fee renegotiation while a peer signature is cached. Consider whether additional logging or metrics are warranted when a renegotiation attempt is rejected.

Security signals we found

01

State-machine guard expansion to prevent fee renegotiation while a closing signature is pending

02

Risk of combining mismatched signatures across different closing fees

03

Regression test demonstrates malicious peer renegotiation attempt and expected warning rejection

04

Applies to both V1 (AwaitingChannelReady) and V2 (FundingNegotiated) channel establishment flows

Risk score

Why this scored 68/100

Our methodology →
Potential impact 22/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.