Lightning Improvement Equipment (LDK), a library for constructing Bitcoin Lightning wallets and cost functions, has patched a flaw that might let a malicious channel peer steal the worth of a forwarded cost by mendacity after reconnecting. Affected software builders want to include the repair into the software program they deploy.
The October 1-dated v0.2.7 and v0.1.13 safety releases deal with the LDK reconnect vulnerability on the 0.2 and 0.1 branches, respectively. Bitcoin Optech described the fixes in its Oct. 9 e-newsletter.
How the LDK reconnect flaw may price Bitcoin
The assault begins with a channel peer acknowledging an replace, then reconnecting and pretending it by no means obtained it. Earlier than the repair, that false declare may trigger LDK to signal a conflicting dedication transaction.
A dedication transaction represents a channel’s agreed state and can be utilized to settle it on Bitcoin’s blockchain. Within the state of affairs described in PR 5057, the newly signed transaction was not recorded by LDK’s channel monitor, the element monitoring the channel’s on-chain claims.
That hole may flip a forwarded cost right into a loss. The malicious sender may verify the transaction on-chain and let the cost settle with the following recipient. It may then reclaim the incoming cost contract when it expired, regardless that the forwarding node knew the key usually used to assert cost.
The forwarding software would have paid downstream with out recovering the corresponding incoming funds. The repair permits retransmission solely whereas the peer’s acknowledgment stays excellent and force-closes the channel when the peer claims an already-acknowledged replace was missed.
Alongside the LDK reconnect repair, model 0.2.7 addresses a unique theft path involving LSPS2 just-in-time funds, the place a liquidity service opens a channel as a part of dealing with a cost.
An intercepted cost may misrepresent its quantity, inflicting the service to open a channel and ahead extra Bitcoin than the incoming cost provided. The service would cowl the distinction from its personal funds. PR 5042 addresses that quantity test.
That publicity considerations the LSPS2 service stream. The v0.1.13 notes record the shared reconnect repair with out itemizing the LSPS2 repair.
These defects differ from the splice-fee diversion and saved-state loading bugs lined in yourcryptonewstoday’s Sept. 13 LDK v0.2.6 report. Core Lightning is a separate implementation, as described within the replace under.
LDK’s structure documentation explains that the SDK is compiled and executed inside functions. Builders should incorporate the related patched library code into deployed software program. For LSPS2 integrations, the PR 5042 commit clarification flags that cost contracts queued by a previous model retain unvalidated quantities; groups must account for these pending contracts in addition to updating the library.

