CVE-2022-39389: Github.com/lightningnetwork/lnd Denial of Service Vulnerability

HIGH
Advisory Identifier: GHSA-hc82-w9v8-83pr
CVSS 8.2
CWE-20
Published
Advisory Summary

CVE-2022-39389 is a HIGH (CVSS 8.2) denial of service vulnerability (CWE-20: Improper Input Validation) affecting Github.com/lightningnetwork/lnd libraries in the Go ecosystem. The issue involves witness block parsing dos vulnerability. Remediation is available by upgrading affected packages to version 0.15.4-beta.

CVE-2022-39389 at a Glance

CVE Identifier CVE-2022-39389
GHSA Identifier GHSA-hc82-w9v8-83pr
Severity HIGH
CVSS v3.1 Base Score 8.2
CWE Classification CWE-20: Improper Input Validation
Affected Product Github.com/lightningnetwork/lnd
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 8.2

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity Low (I:L)
Availability High (A:H)

How to Fix CVE-2022-39389

To remediate this vulnerability, upgrade all affected Github.com/lightningnetwork/lnd dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/lightningnetwork/lnd fixed: 0.15.4-beta
Upgrade github.com/lightningnetwork/lnd to 0.15.4-beta
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/lightningnetwork/lnd

How to Check if You Are Affected

To determine whether your application is affected by CVE-2022-39389, inspect your project dependencies for Github.com/lightningnetwork/lnd:

inspect dependencies for github.com/lightningnetwork/lnd

Analyze the terminal output to locate any version of Github.com/lightningnetwork/lnd in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.15.4-beta), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-20: Improper Input Validation, where the product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly. In Github.com/lightningnetwork/lnd, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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

CVE-2022-39389 Affected Github.com/lightningnetwork/lnd Versions

1 component(s)
Fixed Versions:
0.15.4-beta
Product / Package Ecosystem Affected Versions Fixed Version
github.com/lightningnetwork/lnd
Go
< 0.15.4-beta
0.15.4-beta

References

Frequently Asked Questions

What is CVE-2022-39389?
CVE-2022-39389 is a security vulnerability in Github.com/lightningnetwork/lnd involving Witness Block Parsing DoS Vulnerability under CWE-20: Improper Input Validation.
Which Github.com/lightningnetwork/lnd versions are affected?
Affected versions include releases prior to 0.15.4-beta across affected packages: github.com/lightningnetwork/lnd.
What version fixes CVE-2022-39389?
Upgrading to 0.15.4-beta (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/lightningnetwork/lnd affected?
Yes, github.com/lightningnetwork/lnd is affected in releases prior to 0.15.4-beta. Upgrade your dependency to 0.15.4-beta or later.
What is the CVSS score of CVE-2022-39389?
CVE-2022-39389 has a CVSS v3.1 base score of 8.2 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:H.
What CWE is associated with CVE-2022-39389?
CVE-2022-39389 is classified under CWE-20: Improper Input Validation (The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.).
How can I check Go dependencies for CVE-2022-39389?
Run the dependency tree command: 'inspect dependencies for github.com/lightningnetwork/lnd'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-hc82-w9v8-83pr",
  "modified" : "2022-11-18T18:50:01Z",
  "published" : "2022-11-18T18:50:01Z",
  "aliases" : [ "CVE-2022-39389" ],
  "summary" : "Witness Block Parsing DoS Vulnerability ",
  "details" : "### Impact\n\nAll 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. \n\nThis 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. \n\n### Patches\n\nA patch is available starting with lnd `v0.15.4`. \n\n### Workarounds\n\nNodes 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. \n\n### References\n\nhttps://github.com/lightningnetwork/lnd/issues/7096\n\nhttps://github.com/lightningnetwork/lnd/releases/tag/v0.15.4-beta\n\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/lightningnetwork/lnd"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.15.4-beta"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/lightningnetwork/lnd/security/advisories/GHSA-hc82-w9v8-83pr"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-39389"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/lightningnetwork/lnd/issues/7096"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/lightningnetwork/lnd/pull/7098"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/lightningnetwork/lnd"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/lightningnetwork/lnd/releases/tag/v0.15.4-beta"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-20" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-11-18T18:50:01Z",
    "nvd_published_at" : "2022-11-17T22:15:00Z"
  }
}