Market desk Bitcoin Ethereum Altcoins DeFi Stablecoins Markets & Trading

Bitcoin Lightning Network Developers Fix Bug That Could Erase Payment Records

LND developers patched a vulnerability that could cause nodes to lose track of settled payments after restarting, potentially disrupting payment-channel accounting. The flaw involved a software counter that reset at 65,536 entries.
33 minutes ago 1 views
Bitcoin Lightning Network Developers Fix Bug That Could Erase Payment Records

Bitcoin Lightning Network developers have patched a vulnerability in LND, a widely used Lightning Network implementation, that could cause nodes to lose track of settled payment records after restarting.

The flaw stemmed from an error in how the software saved and restored channel updates. LND maintainer Olaoluwa Osuntokun explained that the problem involved a counter tracking acknowledged updates from connected peers, stored using a 16-bit unsigned integer that could only represent values up to 65,535. Once the list reached 65,536 entries, the counter reset to zero, even though LND continued writing updates to storage.

When a node restarted, it could interpret that zero as an empty list and omit a previously settled hashed timelock contract (HTLC), a conditional payment mechanism used to secure transactions across Lightning channels. This could cause a node to reconstruct incomplete payment records despite the original information remaining stored on disk.

Potential Exploitation Path Identified

Developers identified how connected peers could potentially trigger the vulnerability. LND collaborator ziggie1984 explained that a peer could repeatedly send transaction fee updates and commitment signatures while withholding a required revocation message, allowing the list of pending acknowledgments to grow without being cleared. A unit test reproduced this behavior, generating 201 stored updates after 200 rounds of messages.

The accumulated entries survived reconnects, suggesting that repeatedly disconnecting and reconnecting would not necessarily prevent the list from eventually reaching the overflow threshold.

Patch and Recovery Measures

Developers released patched versions v0.21.8-beta and v0.20.8-beta on November 11 to address the issue. The fix introduces checks that prevent oversized update lists from advancing the channel state or being written to storage. LND was also modified to recover complete update lists saved by older versions when the underlying data passes validation.

The fix was merged into LND's main development branch on November 5 before being included in both November releases. No confirmed exploitation or financial losses associated with the flaw have been identified.

Market snapshot

Top cryptocurrency prices

Explore all prices
BitcoinBTC $65,345.45+0.30% EthereumETH $1,832.03+0.25% Tether USDUSDT $0.9997-0.03% BNBBNB $594.14-0.14% USDCUSDC $1.00+0.03% XRPXRP $0.9610-0.86% SolanaSOL $71.96-0.39% TRONTRX $0.3055+0.10% HyperliquidHYPE $69.88+2.75% ZcashZEC $910.64+0.35%
Prices by Coinranking. Informational only.