
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 data that safe fee channels.
The flaw affected LND, a broadly used implementation of Bitcoin’s Lightning Community, which permits customers to ship Bitcoin by means of 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 deal with the problem, 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 data after restarting, even when the unique info remained saved on its disk.
That failure threatened the consistency of Lightning channels, the place contributors depend on correct data to find out which funds have settled and what every celebration is owed.
In line with LND maintainer Olaoluwa Osuntokun, often called Roasbeef, the issue concerned a counter that tracked acknowledged updates from a related Lightning peer.
The software program saved the variety of entries utilizing a 16-bit unsigned integer, which might characterize values solely as much as 65,535.
As soon as the listing reached 65,536 entries, the counter reset to zero, though LND continued writing the updates to storage.
Upon restarting, the node might interpret that zero as an empty listing and omit a beforehand settled hashed timelock contract (HTLC), a conditional fee mechanism that helps safe transactions throughout Lightning channels.
Select the report path
Outsized lists are rejected earlier than dedication progress or revocation, and earlier than serialization writes report bytes.
The up to date reader validates entries and rely. It may possibly recuperate qualifying full lists; malformed trailing knowledge is rejected.
The repair prevents new outsized logs and conditionally recovers full older data.
Applies to this unsigned acknowledged replace log and its overflow situation. Full legacy knowledge should go entry/rely checks; malformed knowledge is rejected. No noticed exploitation or monetary loss is established by the reviewed sources.
Builders determine how Lightning friends might set off the flaw
The vulnerability grew to become extra regarding after builders recognized a possible means for related friends to push the affected replace listing towards its restrict.
Within the GitHub dialogue, LND collaborator ziggie1984 defined {that a} peer might repeatedly ship transaction charge updates and dedication signatures whereas withholding a required revocation message.
That conduct allowed the listing of pending acknowledgments to develop with out being cleared.
The developer reproduced the conduct in a unit take a look at, producing 201 saved updates after 200 rounds of messages.
Crucially, the gathered entries survived reconnects, suggesting that repeatedly disconnecting and reconnecting wouldn’t essentially stop the listing from finally reaching the overflow threshold.
The potential weak spot issues as a result of Lightning will depend on each events sustaining constant payment-channel states. Dropping observe of a settled replace might undermine the data used to reconcile channel obligations.
Nonetheless, the venture’s disclosures don’t determine any confirmed exploitation or monetary losses related to the flaw.
To handle the issue, builders launched checks that stop outsized replace lists from advancing the channel state or being written to storage.
Additionally they modified how LND reads present data, permitting nodes to recuperate full replace lists saved by older variations when the underlying knowledge passes validation.
The repair was merged into LND’s foremost growth department on Nov. 5 earlier than being included in each November releases.