
Bitcoin Lightning builders patched a software program vulnerability that might trigger nodes to lose observe of settled funds after a restart, doubtlessly disrupting the accounting information that safe fee channels.
The flaw affected LND, a extensively used implementation of Bitcoin’s Lightning Community, which allows customers to ship Bitcoin by fee channels with out recording each transaction straight on the blockchain.
Builders launched v0.21.8-beta and v0.20.8-beta on Nov. 11 to handle the difficulty, which stemmed from an error in how the software program saved and restored channel updates.
The vulnerability might trigger a node to reconstruct incomplete fee information after restarting, even when the unique data remained saved on its disk.
That failure threatened the consistency of Lightning channels, the place individuals depend on correct information to find out which funds have settled and what every occasion is owed.
Based on LND maintainer Olaoluwa Osuntokun, referred to as Roasbeef, the issue concerned a counter that tracked acknowledged updates from a linked Lightning peer.
The software program saved the variety of entries utilizing a 16-bit unsigned integer, which might signify values solely as much as 65,535.
As soon as the record reached 65,536 entries, the counter reset to zero, regardless that LND continued writing the updates to storage.
Upon restarting, the node might interpret that zero as an empty record and omit a beforehand settled hashed timelock contract (HTLC), a conditional fee mechanism that helps safe transactions throughout Lightning channels.
Select the file path
Outsized lists are rejected earlier than dedication progress or revocation, and earlier than serialization writes file bytes.
The up to date reader validates entries and rely. It will possibly get better qualifying full lists; malformed trailing information is rejected.
The repair prevents new outsized logs and conditionally recovers full older information.
Applies to this unsigned acknowledged replace log and its overflow situation. Full legacy information should move entry/rely checks; malformed information is rejected. No noticed exploitation or monetary loss is established by the reviewed sources.
Builders establish how Lightning friends might set off the flaw
The vulnerability turned extra regarding after builders recognized a possible approach for linked friends to push the affected replace record towards its restrict.
Within the GitHub dialogue, LND collaborator ziggie1984 defined {that a} peer might repeatedly ship transaction price updates and dedication signatures whereas withholding a required revocation message.
That habits allowed the record of pending acknowledgments to develop with out being cleared.
The developer reproduced the habits in a unit take a look at, producing 201 saved updates after 200 rounds of messages.
Crucially, the collected entries survived reconnects, suggesting that repeatedly disconnecting and reconnecting wouldn’t essentially stop the record from finally reaching the overflow threshold.
The potential weak point issues as a result of Lightning will depend on each events sustaining constant payment-channel states. Shedding observe of a settled replace might undermine the information used to reconcile channel obligations.
Nevertheless, the challenge’s disclosures don’t establish any confirmed exploitation or monetary losses related to the flaw.
To deal with the issue, builders launched checks that stop outsized replace lists from advancing the channel state or being written to storage.
In addition they modified how LND reads current information, permitting nodes to get better full replace lists saved by older variations when the underlying information passes validation.
The repair was merged into LND’s essential improvement department on Nov. 5 earlier than being included in each November releases.

