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

lnpeer: don't signal OPTION_ZEROCONF_OPT to untrusted peer

Public commit record

What the developer wrote

Authored by f321x

85/100 · Strong
lnpeer: don't signal OPTION_ZEROCONF_OPT to untrusted peer

Only signal `OPTION_ZEROCONF_OPT` to peers if we either:
1. Have no trusted peer configured (assuming that we are LSP)
2. Have a trusted peer configured, and the peer we are connecting
to is this trusted peer.

Otherwise peers that are LSPs but are not the clients trusted LSP
might try to open a channel to the client but it would get rejected.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode
The short version

What changed, and why it matters

This commit changes how Electrum advertises a Lightning feature called 'zeroconf' (zero-confirmation channels). Previously, a user's wallet could tell any Lightning peer that it supports zeroconf channels, even untrusted ones. That could mislead a non-trusted Lightning Service Provider (LSP) into trying to open a special channel that the wallet would then reject, causing confusion, failed channel opens, and possibly minor privacy or denial-of-service issues. The fix makes the wallet only advertise zeroconf support to a specifically trusted LSP, or when the wallet itself acts as an LSP with no trusted peer configured.

Recommended action

Reviewers should confirm that `lnworker.network.lngossip` is the only non-wallet worker that could create a `Peer`, and that no other code path bypasses this feature-bit masking. Consider whether the feature bit should also be masked when `OPEN_ZEROCONF_CHANNELS` is disabled, since the current logic relies on the caller's `features` already lacking the bit. The added tests are a good start; running them should be part of CI.

Security signals we found

01

Feature-bit advertisement now restricted by trust relationship

02

Untrusted peers no longer receive OPTION_ZEROCONF_OPT

03

New unit tests cover trusted/untrusted/invalid/no-trusted configurations

04

Refactoring centralizes trusted node id parsing in a property

Risk score

Why this scored 37/100

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