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

lnpeer: chan_reest: ctn overflow: force-close instead of disconnect

Public commit record

What the developer wrote

Authored by SomberNight

92/100 · Strong
lnpeer: chan_reest: ctn overflow: force-close instead of disconnect

(was DC-ing due to assert failing in RevocationStore)

also add a test case
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides an explanatory body✓ Explains rationale or failure mode✓ Mentions testing or verification✓ Names security-relevant behavior explicitly
The short version

What changed, and why it matters

This commit fixes a bug in Electrum's Lightning Network code. Previously, if a malicious or malfunctioning peer sent a channel re-establishment message with extremely large commitment numbers (over 2^48), the local program would hit an internal assertion failure and simply disconnect. Now, it treats this as misbehavior and force-closes the channel instead, which is the safer response. The commit also adds tests to confirm this behavior.

Recommended action

Review the change for correctness and completeness; consider whether additional validation of commitment counter bounds should be applied elsewhere in the Lightning protocol handling. The TODO comment suggests upstreaming the 2**48 bound to the BOLTs spec, which maintainers may want to track.

Security signals we found

01

Addition of explicit overflow check on untrusted peer-supplied commitment counters

02

Replacement of assertion-failure/disconnect behavior with force-close on misbehavior

03

New test cases for ctn overflow in both next_local_ctn and oldest_unrevoked_remote_ctn

04

Use of modulo 2**48 in test helper to keep revocation secret retrieval within valid index range

Risk score

Why this scored 60/100

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