Headline
CVE-2022-39389: [bug]: CRITICAL! Unable to process chain reorg / too many witness items to fit into max message size · Issue #7096 · lightningnetwork/lnd
Lightning Network Daemon (lnd) is an implementation of a lightning bitcoin overlay network node. All lnd nodes before version v0.15.4
are vulnerable to a block parsing bug that can cause a node to enter a degraded state once encountered. In this degraded state, nodes can continue to make payments and forward HTLCs, and close out channels. Opening channels is prohibited, and also on chain transaction events will be undetected. This can cause loss of funds if a CSV expiry is researched during a breach attempt or a CLTV delta expires forgetting the funds in the HTLC. A patch is available in lnd
version 0.15.4. Users are advised to upgrade. Users unable to upgrade may use the lncli updatechanpolicy
RPC call to increase their CLTV value to a very high amount or increase their fee policies. This will prevent nodes from routing through your node, meaning that no pending HTLCs can be present.
Copy link
Contributor
****C-Otto** commented Nov 1, 2022 •**
Background
lnd does not process new blocks.
lnd:
2022-11-01 12:02:54.658 [ERR] LNWL: Unable to process chain reorg: unable to get block 000000000000000000070742427fa10ec3c66d006160155a704d9f56d090a3ea: MsgTx.BtcDecode: too many witness items to fit into max message size [count 500003, max 500000]
bitcoind:
2022-11-01T10:44:23Z UpdateTip: new best=000000000000000000070742427fa10ec3c66d006160155a704d9f56d090a3ea height=761249 version=0x20a00000 log2_work=93.818550 tx=776743287 date='2022-11-01T10:44:19Z' progress=1.000000 cache=21.2MiB(82459txo)
My bitcoind knows about block height 761255, but lnd and mempool.space are stuck at 761248.
- lnd v0.15.3-beta
- bitcoind v23
https://twitter.com/c_otto83/status/1587400648366202880
jimmydjabali, faket0shi, 22388o, fiksn, gonzaloaune, mutatrum, 0xB10C, Jossec101, apotdevin, dannmat, and 9 more reacted with eyes emoji
C-Otto changed the title [bug]: CRITICAL! Unable to process chain reorg [bug]: CRITICAL! Unable to process chain reorg / too many witness items to fit into max message size
Nov 1, 2022
Copy link
Collaborator
****guggero** commented Nov 1, 2022**
C-Otto, 22388o, jimmydjabali, faket0shi, ellemouton, silenzara, hieblmi, fiksn, zehks, Seccour, and 25 more reacted with heart emoji
Same here.
2022-11-01 11:10:13.912 [ERR] LNWL: Unable to process chain reorg: unable to get block 000000000000000000070742427fa10ec3c66d006160155a704d9f56d090a3ea: MsgTx.BtcDecode: too many witness items to fit into max message size [count 500003, max 500000]
lnd@indomitusbtc:~$ lncli getinfo | grep synced
"synced_to_chain": false,
"synced_to_graph": true,
Copy link
Contributor Author
****C-Otto** commented Nov 1, 2022**
I’m pretty sure all (recent) lnd installations are affected by this.
C-Otto, indomitorum, 0xB10C, apotdevin, 22388o, Seccour, eupn, Jossec101, and LNBIG-COM reacted with laugh emoji apotdevin, 22388o, and codecologist reacted with eyes emoji
Copy link
Contributor Author
****C-Otto** commented Nov 1, 2022**
I’m guessing this is a btcd issue? Everything seems to be fine on bitcoin
Copy link
Contributor Author
****C-Otto** commented Nov 1, 2022**
Yes, the btcd issue is linked above.
also got hte same bug, running lnd-15.3 and bitcoin-22.0:
[ERR] LNWL: Unable to complete chain rescan: MsgTx.BtcDecode: too many witness items to fit into max message size [count 500003, max 500000]
fixed with updating lnd to 0.15.4. Thanks!
Hi,
My all nodes are in a state:
l getinfo|grep synced
"synced_to_chain": false,
"synced_to_graph": true,
CRITICAL bug is number # 2 ? :)))
Copy link
Collaborator
****guggero** commented Nov 1, 2022**
Fixed by #7098, release binaries and docker images for v0.15.4-beta are going to be available soon (building right now).
I’m guessing this is a btcd issue? Everything seems to be fine on bitcoin
no, i`m running bitcoin core v22.0 and having the same issue.
I’m running neutrino, and not seeing the issue:
walter@fluffy:~$ lncli getinfo | grep synced
"synced_to_chain": true,
"synced_to_graph": true,
walter@fluffy:~$ lncli getinfo | grep block
"block_height": 761264,
"block_hash": "000000000000000000072cabab0aac7c6b00db0664b82edc77d3252634fcba8a",
Copy link
Contributor Author
****C-Otto** commented Nov 1, 2022**
I bumped to 0.15.4, it fixed the issue. (our own build)
Would it be possible to modify lnd so that it skips validation on blocks received from the chain backend? Just reading about Eclair’s exposure to this class of bugs: ACINQ/eclair#2473 (comment)
twofaktor added a commit to twofaktor/minibolt that referenced this issue
Nov 2, 2022
Related news
### Impact All lnd nodes before version `v0.15.4` are vulnerable to a block parsing bug that can cause a node to enter a degraded state once encountered. In this degraded state, nodes can continue to make payments and forward HTLCs, and close out channels. Opening channels is prohibited, and also on chain transaction events will be undetected. This can cause loss of funds if a CSV expiry is researched during a breach attempt or a CLTV delta expires forgetting the funds in the HTLC. ### Patches A patch is available starting with lnd `v0.15.4`. ### Workarounds Nodes can use the `lncli updatechanpolicy` RPC call to increase their CLTV value to a very high amount or increase their fee policies. This will prevent nodes from routing through your node, meaning that no pending HTLCs can be present. ### References https://github.com/lightningnetwork/lnd/issues/7096 https://github.com/lightningnetwork/lnd/releases/tag/v0.15.4-beta