Security577 words3 min decode

Lightning Developers Patch LND Bug That Could Erase Settled Payments

A 16-bit counter overflow in LND could make settled Lightning HTLCs vanish from reconstructed records after a restart; developers merged a fix on Nov. 5.

Bitcoin Lightning developers patch bug that could make completed payments disappear
WitnessBitcoin Lightning developers patch bug that could make completed payments disappearPixxlTeufel / pixabay

Outputs

  1. A 16-bit unsigned integer in LND capped a peer-update counter at 65,535 entries before wrapping to zero.

  2. After restart, the node could treat the wrapped counter as an empty list and omit a settled HTLC.

  3. LND collaborator ziggie1984 reproduced the growth pattern with 201 stored updates after 200 message rounds.

  4. The fix was merged into LND's main branch on Nov. 5 and included in both November releases.

  5. No confirmed exploitation or financial losses have been disclosed.

Developers of LND, the Lightning Network implementation maintained by Lightning Labs, have patched a vulnerability that could cause a node to lose track of a settled payment after a restart. The fix was merged into LND's main development branch on Nov. 5 and shipped in both of the project's November releases.

The flaw involved a counter that tracked acknowledged updates from a connected Lightning peer. The software stored the number of entries using a 16-bit unsigned integer, a data type that can represent values only up to 65,535. Once the list reached 65,536 entries, the counter wrapped back to zero — even though LND kept writing the underlying updates to disk.

Upon restarting, the node could interpret that zero as an empty list and omit a previously settled hashed timelock contract (HTLC), the conditional payment mechanism that secures transactions across Lightning channels. LND maintainer Olaoluwa Osuntokun, known in the developer community as Roasbeef, disclosed the technical details of the failure.

Why does one lost record matter?

Lightning channels depend on both parties maintaining consistent records of which payments have settled and what each side is owed. A node that reconstructs incomplete payment records after restarting cannot reliably reconcile its channel obligations, even when the original information remains intact on its disk.

The consistency requirement is what turns a minor bookkeeping error into a settlement risk. If one side's records omit a settled HTLC, the two channel partners disagree on balances through no fault of the user who sent the payment.

How could a peer trigger the overflow?

The vulnerability became more concerning after developers identified a path by which a connected peer could deliberately push the update list toward its limit. In the GitHub discussion, LND collaborator ziggie1984 explained that a malicious peer could repeatedly send transaction fee updates and commitment signatures while withholding a required revocation message.

That behavior allowed the list of pending acknowledgments to grow without ever being cleared. The developer reproduced it in a unit test, generating 201 stored updates after 200 rounds of messages — roughly one stale entry per message round.

Crucially, the accumulated entries survived reconnects. A counterparty could not simply disconnect and reconnect to reset the list, which means repeated connection churn would not necessarily prevent the counter from eventually reaching the overflow threshold.

The project's disclosures, however, do not identify any confirmed exploitation or financial losses tied to the flaw. The absence of reported incidents is not proof of absence; it may simply reflect that no operator has audited the relevant storage state.

What does the fix change?

The patch works on two levels. First, developers introduced checks that prevent oversized update lists from advancing the channel state or being written to storage at all, closing off the deliberate-overflow path.

Second, they modified how LND reads existing records, allowing nodes to recover complete update lists saved by older software versions when the underlying data passes validation. Operators on earlier releases therefore have a defined migration path rather than a forced rebuild of channel state.

The remediation addresses both the attack vector and the recovery problem, though the project has not published figures on how many nodes ran affected versions at the time of disclosure.

The practical takeaway: channel operators running LND builds from before November should treat upgrading as routine maintenance, not an option, since the patched releases are the only versions that both block the overflow and recover legacy records correctly.

via cryptonews.net (Source)

More from Elena Vasquez

Elena Vasquez

Show full bio

Staff writer covering regulation, policy and their impact on crypto and web3 industry at Mempool Brief.

1,878 articles