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

connectd: handle an already-connected subd gracefully

Public commit record

What the developer wrote

Authored by Níckolas Goline

73/100 · Adequate
connectd: handle an already-connected subd gracefully

peer_connect_subd asserted that the subd had no connection yet. Replace
that assertion with defensive handling: if a connection is already
attached for this channel_id, keep it and close the incoming fd. This
avoids aborting connectd in the unexpected case where a second fd
arrives for a subd that already has one.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This change fixes a crash in the part of Core Lightning that handles peer connections. Previously, if the same internal connection was unexpectedly set up twice, the program would abort with an assertion failure. Now it logs a debug message and closes the duplicate connection instead. This makes the node more stable against unusual or possibly malicious connection patterns, but the patch is defensive and does not by itself prove an attacker could reliably trigger the crash.

Recommended action

Treat as a stability/hardening fix. Review how duplicate peer_connect_subd messages can be generated to ensure the root cause is not reachable from an untrusted peer. Consider adding a regression test that sends a second fd for the same channel_id and verifies connectd no longer aborts.

Security signals we found

01

Assertion replaced with defensive error handling

02

Potential denial-of-service crash vector removed

03

Duplicate peer/subd connection now logged and dropped

04

No input validation or cryptographic changes

Risk score

Why this scored 42/100

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