lnwallet: return error from AggregateNonces in MusigSession
What changed, and why it matters
This commit fixes a simple but meaningful bug in LND's MuSig2 signing code: when a cryptographic nonce-combining step failed, the function incorrectly swallowed the error and returned 'no error' instead. That could let a signing session continue in a bad state, potentially causing later signature failures or confusing error handling. It is a defensive correctness fix rather than a clear remote-exploitable vulnerability.
Treat as a low-to-moderate correctness fix. Review whether the swallowed error could have led to invalid signature attempts, session hangs, or fund-safety issues in channel operations using MuSig2. No immediate emergency response is indicated, but include in the next maintenance release.
Security signals we found
Error-swallowing bug in cryptographic signing session
MuSig2 nonce aggregation failure masked as success
Potential state inconsistency in multi-signature signing flow
Evidence from the diff
In lnwallet/musig_session.go, MusigSession.FinalizeSession calls AggregateNonces to combine public nonces. The original code returned nil on error, swallowing AggregateNonces failures. The patch changes ‘return nil’ to ‘return err’. A swallowed error here could leave m.combinedNonce unset and the caller unaware that nonce aggregation failed, leading to downstream signing failures or state inconsistency in the MuSig2 session.
Changed components
lnwallet/musig_session.goMusigSession.FinalizeSessionMuSig2 nonce aggregationInspect captured patch +1 / −1
diff --git a/lnwallet/musig_session.go b/lnwallet/musig_session.go
index 01f68b7..0434b9b 100644
--- a/lnwallet/musig_session.go
+++ b/lnwallet/musig_session.go
@@ -328,7 +328,7 @@ func (m *MusigSession) FinalizeSession(signingNonce musig2.Nonces) error {
m.nonces.VerificationNonce.PubNonce,
})
if err != nil {
- return nil
+ return err
}
m.combinedNonce = aggNonce
Why this scored 33/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.