Skip to main content

CVE-2022-39389: CWE-20: Improper Input Validation in lightningnetwork lnd

Medium
Published: Thu Nov 17 2022 (11/17/2022, 00:00:00 UTC)
Source: CVE
Vendor/Project: lightningnetwork
Product: lnd

Description

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.

AI-Powered Analysis

AILast updated: 06/21/2025, 21:23:25 UTC

Technical Analysis

CVE-2022-39389 is a medium-severity vulnerability affecting the Lightning Network Daemon (lnd), an implementation of a Bitcoin Lightning Network node. The vulnerability arises from improper input validation (CWE-20) in the block parsing logic of lnd versions prior to v0.15.4-beta. Specifically, when a node processes certain malformed or crafted blocks, it can enter a degraded operational state. In this degraded state, the node continues to perform some functions such as making payments, forwarding HTLCs (Hashed Time Locked Contracts), and closing channels. However, it loses the ability to open new channels and fails to detect on-chain transaction events. This failure can lead to critical issues such as loss of funds, particularly if a CSV (CheckSequenceVerify) expiry is rechecked during an attempted breach or if a CLTV (CheckLockTimeVerify) delta expires, causing funds locked in HTLCs to be forgotten or unrecoverable. The root cause is improper input validation during block parsing, which disrupts normal node operation and state tracking. A patch addressing this vulnerability is included in lnd version 0.15.4. For users unable to upgrade immediately, a recommended workaround is to use the `lncli updatechanpolicy` RPC call to increase the CLTV value to a very high amount or increase fee policies. This effectively prevents other nodes from routing payments through the vulnerable node, thereby avoiding the presence of pending HTLCs and mitigating the risk of fund loss. No known exploits are reported in the wild at this time, but the vulnerability poses a significant risk to the integrity and availability of Lightning Network nodes running affected versions.

Potential Impact

For European organizations utilizing the Lightning Network for Bitcoin transactions, this vulnerability can result in partial service degradation and potential financial losses. The inability to open new channels and detect on-chain events compromises the node's operational integrity, potentially leading to locked or lost funds in HTLCs. This can disrupt payment routing and liquidity management, critical for businesses relying on fast, low-cost Bitcoin transactions. Financial institutions, cryptocurrency exchanges, and payment service providers in Europe that integrate Lightning Network nodes are particularly at risk. The degraded state may also reduce trust in Lightning Network-based services, impacting customer confidence and operational continuity. Additionally, since the vulnerability affects the detection of on-chain events, it could delay or prevent timely responses to blockchain state changes, increasing exposure to financial risk. While no active exploitation is known, the potential for targeted attacks or accidental triggering remains, especially in high-value or high-volume environments.

Mitigation Recommendations

The primary mitigation is to upgrade all lnd nodes to version 0.15.4 or later, which contains the patch fixing the improper input validation bug. For organizations unable to upgrade immediately, it is recommended to use the `lncli updatechanpolicy` RPC call to increase the CLTV value significantly or raise fee policies. This prevents other nodes from routing payments through the vulnerable node, eliminating pending HTLCs and reducing risk. Additionally, organizations should implement continuous monitoring of node health and blockchain event detection to quickly identify any degraded states. Regular backups of channel states and on-chain data are advised to facilitate recovery in case of fund loss. Network segmentation and limiting node exposure to untrusted peers can reduce attack surface. Finally, organizations should stay informed about updates from the Lightning Network development community and apply security patches promptly.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
GitHub_M
Date Reserved
2022-09-02T00:00:00.000Z
Cisa Enriched
true

Threat ID: 682d9849c4522896dcbf6c8e

Added to database: 5/21/2025, 9:09:29 AM

Last enriched: 6/21/2025, 9:23:25 PM

Last updated: 7/28/2025, 10:10:05 PM

Views: 13

Actions

PRO

Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats