by NishantBansal2003The issue discussed below was originally disclosed at nishantbansal2003.github.io. For the corresponding LND advisory, see: LND Gossip Nil-Map Panic on Zero-Timestamp Messages | Lightning Labs Security Advisories.LND versions before v0.20.1 are vulnerable to a DoS issue where a specially craftedchannel_updateornode_announcementmessage can crash a node. Operators should upgrade promptly to avoid service disruption. The issue is fixed in v0.20.1 and later.VulnerabilityVulnerability
The Lightning Network uses gossip messages to maintain a distributed view of the network graph. Nodes exchangechannel_announcement,node_announcement, andchannel_updatemessages to advertise channels and routing policies. Before acceptingnode_announcementandchannel_updatemessages, a Lightning node must first know and validate the correspondingchannel_announcement.
After validation,node_announcementandchannel_updatemessages are propagated throughout the network. In LND, this propagation is handled by a gossip rebroadcast pipeline that uses a de-duplication cache to avoid repeatedly forwarding identical announcements. When a new announcement arrives, its timestamp is compared against any previously stored announcements for the same channel, direction and node. Newer announcements replace older ones, while older announcements are discarded. The implementation of this logic prior to v0.20.1 can be found in deDupedAnnouncements->addMsg.
The bug stems from how announcements with a timestamp of 0 are handled. When a zero-timestampnode_announcementorchannel_updateis received for the first time, no cache entry exists andoldTimestampremains initialized to 0. As a result, the code incorrectly treats the announcement as a previously seen message and enters the duplicate-message path.
However, because no previous entry existed, thesendersmap was never initialized. Attempting to write to this nil map triggers a runtime panic that terminates the LND daemon, resulting in a complete loss of node availability until it is restarted.
...read more at delvingbitcoin.org
pull down to refresh
related posts