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

Merge pull request #11019 from Roasbeef/coop-close-race-public

Public commit record

What the developer wrote

Authored by Yong

73/100 · Adequate
Merge pull request #11019 from Roasbeef/coop-close-race-public

lnwallet/chancloser: fix data race in the legacy coop close state machine
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides an explanatory body✓ Links an issue, advisory, or supporting reference
The short version

What changed, and why it matters

This update fixes two related problems in LND's cooperative channel-closing code. First, it eliminates a data race where the same state machine was being advanced by two different internal goroutines at once, which could cause crashes or inconsistent close negotiations. Second, it now always checks that the other party's payout address is well-formed and safe to pay, instead of only checking when an upfront shutdown address was already on file. Previously, a malformed or malicious address could slip through in some cases.

Recommended action

Apply the patch and run the new tests (TestPeerChannelClosureFlushDrivesNegotiation, TestRbfChannelActiveTransitions bad-script subtests, TestDustLimitForSize arbitrary sizes). Operators should upgrade nodes that negotiate cooperative closes, especially those using the RBF/interactive close flow, to ensure remote shutdown scripts are validated consistently and close races cannot corrupt state.

Security signals we found

01

Data race in legacy cooperative close state machine driven concurrently by link and peer goroutines

02

Missing or inconsistent validation of remote delivery script when no upfront shutdown script is recorded

03

panic() in DustLimitForSize on unrecognized script sizes replaced with safe fallback

04

State machine now explicitly documented as requiring single-goroutine ownership

Risk score

Why this scored 57/100

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