What changed, and why it matters
This commit adds error-handling decorators to a Lightning Network gossip message processing function. Previously, a bad or maliciously crafted gossip message that failed signature verification could crash the entire task group, potentially disconnecting the user from a peer or disrupting channel/network discovery. Now such failures are logged and ignored instead of propagating. It is a hardening/DoS-mitigation fix, not a clear remote-code-execution vulnerability.
Treat as a low-to-moderate hardening fix. Review whether @ignore_exceptions could mask other serious failures (e.g., malformed data causing persistent bad state), and ensure signature verification still rejects invalid gossip before any state is updated. No urgent patch action beyond normal update is indicated from the diff alone.
Security signals we found
DoS mitigation: prevents exception in gossip processing from killing peer task group
Signature verification failure previously could terminate task group
Lightning Network gossip (P2P) input parsing involved
Hardening via exception suppression/logging
Evidence from the diff
The patch decorates LNGossip.process_gossip with @ignore_exceptions and @log_exceptions. This function processes channel announcements, node announcements, and channel updates received from a Lightning peer. The existing comment notes it runs in the originating peer’s TaskGroup, so raising would disconnect only that peer; however, the change indicates that in practice a failing signature verification (or other exception) was too disruptive. The fix suppresses exceptions to keep the task group alive. It does not change signature verification logic itself.
Changed components
electrum/lnworker.pyLNGossip.process_gossipLightning Network peer task groupInspect captured patch +2 / −0
diff --git a/electrum/lnworker.py b/electrum/lnworker.py
index c884659..813fc05 100644
--- a/electrum/lnworker.py
+++ b/electrum/lnworker.py
@@ -783,6 +783,8 @@ class LNGossip(Logger):
progress_percent = 0
return current_est, total_est, progress_percent
+ @ignore_exceptions
+ @log_exceptions
async def process_gossip(self, chan_anns, node_anns, chan_upds):
# note: we run in the originating peer's TaskGroup, so we can safely raise here
# and disconnect only from that peer
Why this scored 34/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.