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

lnwallet/chancloser: use AND for IsTaproot check, use partialSigToWireSig

Public commit record

What the developer wrote

Authored by Olaoluwa Osuntokun

73/100 · Adequate
lnwallet/chancloser: use AND for IsTaproot check, use partialSigToWireSig

Change IsTaproot() from OR to AND: both LocalMusigSession and
RemoteMusigSession must be set to consider the channel taproot. This
prevents panics from nil session access when only one session is
initialized.

Also use partialSigToWireSig helper for consistency in
extractSigAndNonceFromComplete instead of inline conversion.
✓ 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 logic bug in LND's cooperative channel-closing code. The program previously treated a channel as a modern 'taproot' channel if either side's special signing session was set, but it really needs both. When only one was set, the code could later try to use a missing session and crash. The patch also swaps an inline signature conversion for an existing helper to keep the code consistent. It is a defensive bug fix that prevents a panic rather than a clear remote-exploitable vulnerability.

Recommended action

Treat as a stability/defensive fix. Review whether any reachable state in production can trigger the half-initialized session condition and confirm the panic cannot be induced by a peer. If it is reachable via protocol messages, prioritize backporting; otherwise include in the next regular release.

Security signals we found

01

Logic bug in feature-gate predicate (OR vs AND)

02

Potential nil-pointer dereference / panic in channel-closing state machine

03

Defensive hardening of taproot/MuSig2 cooperative close path

04

Refactor to use existing helper for signature serialization consistency

Risk score

Why this scored 59/100

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