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

discovery: let reject cache use gossip version in key

Public commit record

What the developer wrote

Authored by Elle Mouton

73/100 · Adequate
discovery: let reject cache use gossip version in key

Since the gossip protocols are completely disjoint, we need to treat
messages on the two protocols completely separately and should not let
rejections on one protocol affect how we treat messages on the other.
✓ 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 how LND's gossip message handler keeps track of recently rejected messages. Previously, the reject cache only used the sender's public key and channel ID as its lookup key. Because Lightning now has two separate gossip protocols (versions 1 and 2), a rejection on one protocol could incorrectly block or affect the same message on the other protocol. The patch adds the gossip protocol version to the cache key so the two protocols are isolated. It also makes the recently-rejected check only apply to actual gossip messages. This is a correctness fix in protocol handling; it does not by itself appear to allow direct theft of funds, but it could let invalid or stale gossip propagate or persist longer than intended across protocol boundaries.

Recommended action

Review whether the cross-protocol cache collision could have allowed a peer to bypass rejection logic or replay rejected announcements between gossip versions. Consider adding regression tests that specifically exercise rejection isolation across lnwire.GossipVersion values, and verify that all production call sites now supply a gossip version. No immediate emergency response is indicated by the diff alone.

Security signals we found

01

Cross-protocol state sharing in a security-relevant cache

02

Cache key namespace isolation fix

03

Type guard added to restrict cache lookups to gossip messages only

04

Error comparison hardened with errors.Is

Risk score

Why this scored 49/100

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