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

Close connection when receiving malformed messages (#3273)

Public commit record

What the developer wrote

Authored by Bastien Teinturier

93/100 · Strong
Close connection when receiving malformed messages (#3273)

When receiving a message that we're supposed to be able to decode, for
which decoding fails, we must send a warning and close the connection.
This ensures that the connection state cannot become corrupted, which
may otherwise happen if we fail to deserialize a `commit_sig` message
(for example) and simply ignored it while continuing to process the
next messages.

Fixes #3271
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode✓ Links an issue, advisory, or supporting reference
The short version

What changed, and why it matters

This patch fixes a bug in Eclair, a Bitcoin Lightning Network node implementation. Previously, if a peer sent a message that Eclair couldn't properly decode (for example, a corrupted or unexpected 'commit_sig' message), Eclair would log a warning but otherwise ignore it and keep processing later messages. This could cause the two peers' views of the channel state to drift out of sync, potentially leading to incorrect behavior or security issues. The fix makes Eclair send a warning back to the peer and immediately close the connection when it fails to decode a message it expected to understand.

Recommended action

Reviewers should verify that the Warning message is correctly encoded and sent before stop(FSM.Normal) terminates the actor, confirm that no other code paths silently ignore codec failures, and consider whether an authenticated peer can intentionally trigger a close-of-connection as a denial-of-service vector. The fix should be backported to supported release branches.

Security signals we found

01

state desynchronization risk from ignored deserialization failures

02

missing error handling on Attempt.Failure in message codec

03

connection now closed on malformed messages with a warning

04

test renamed and rewritten to assert termination on malformed decode

Risk score

Why this scored 70/100

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