You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The package splitting logic in OnchainTxHandler.update_claims_view_from_matched_tx scans confirmed transactions for any spends that conflict with the current package templates. If a conflicting spend for one of the package inputs is found, it splits that input out of the package and attempts to claim the remaining package inputs in a new transaction. Unfortunately the logic to detect conflicts stops once it finds the first conflicting package, so if the counterparty confirms a transaction conflicting with two packages, we fail to split up the second package. As a result, the transaction we create and broadcast for the second package will contain an already-spent input and can never be mined.
break;//No need to iterate further, either tx is our or their
In currently released versions of LDK, this bug can be exploited to lock up a victim node's liquidity.
After #3340 the bug can be exploited to steal funds. Note that only v0.1.0-beta1 is vulnerable to the theft attack, and no official (non-beta) releases are vulnerable.
As discussed with @TheBlueMatt and @wpaulino, the bug will be fixed prior to the official v0.1.0 release.
The text was updated successfully, but these errors were encountered:
morehouse
added a commit
to morehouse/rust-lightning
that referenced
this issue
Jan 14, 2025
When scanning confirmed transactions for spends that conflict with our
existing packages, we should continue scanning after detecting the first
conflicting package since a transaction can conflict with multiple
packages.
This ensures that we remove *all* inputs from our packages that have
already been spent by the counterparty so that valid claim transactions
are generated.
Fixeslightningdevkit#3537.
When scanning confirmed transactions for spends that conflict with our
existing packages, we should continue scanning after detecting the first
conflicting package since a transaction can conflict with multiple
packages.
This ensures that we remove *all* inputs from our packages that have
already been spent by the counterparty so that valid claim transactions
are generated.
Fixeslightningdevkit#3537.
The package splitting logic in
OnchainTxHandler.update_claims_view_from_matched_tx
scans confirmed transactions for any spends that conflict with the current package templates. If a conflicting spend for one of the package inputs is found, it splits that input out of the package and attempts to claim the remaining package inputs in a new transaction. Unfortunately the logic to detect conflicts stops once it finds the first conflicting package, so if the counterparty confirms a transaction conflicting with two packages, we fail to split up the second package. As a result, the transaction we create and broadcast for the second package will contain an already-spent input and can never be mined.The offending line is here:
rust-lightning/lightning/src/chain/onchaintx.rs
Line 967 in 463e432
In currently released versions of LDK, this bug can be exploited to lock up a victim node's liquidity.
After #3340 the bug can be exploited to steal funds. Note that only v0.1.0-beta1 is vulnerable to the theft attack, and no official (non-beta) releases are vulnerable.
As discussed with @TheBlueMatt and @wpaulino, the bug will be fixed prior to the official v0.1.0 release.
The text was updated successfully, but these errors were encountered: