CVE-2024-38359: Github.com/lightningnetwork/lnd Denial of Service Vulnerability

HIGH
Advisory Identifier: GHSA-9gxx-58q6-42p7
CVSS 6.5
CWE-20
Published
Advisory Summary

CVE-2024-38359 is a HIGH (CVSS 6.5) denial of service vulnerability (CWE-20: Improper Input Validation) affecting Github.com/lightningnetwork/lnd libraries in the Go ecosystem. The issue involves lightning network daemon (lnd)'s onion processing logic leads to a denial of service. Remediation is available by upgrading affected packages to version 0.17.0-beta.

CVE-2024-38359 at a Glance

CVE Identifier CVE-2024-38359
GHSA Identifier GHSA-9gxx-58q6-42p7
Severity HIGH
CVSS v3.1 Base Score 6.5
CWE Classification CWE-20: Improper Input Validation
Affected Product Github.com/lightningnetwork/lnd
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 6.5

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

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

How to Fix CVE-2024-38359

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.17.0-beta
Upgrade github.com/lightningnetwork/lnd to 0.17.0-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-2024-38359, 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.17.0-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 A parsing vulnerability in lnd's onion processing logic led to a DoS vector due to excessive memory allocation. ### Patches The issue was patched in lnd [v0.17.0](https://github.com/lightningnetwork/lnd/releases/tag/v0.17.0-beta). Users should update to a version >= v0.17.0 to be protected. ### References Detailed blog post: https://morehouse.github.io/lightning/lnd-onion-bomb/ Developer discussion: https://delvingbitcoin.org/t/dos-disclosure-lnd-onion-bomb/979

CVE-2024-38359 Affected Github.com/lightningnetwork/lnd Versions

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

References

Frequently Asked Questions

What is CVE-2024-38359?
CVE-2024-38359 is a security vulnerability in Github.com/lightningnetwork/lnd involving Lightning Network Daemon (LND)'s onion processing logic leads to a denial of service under CWE-20: Improper Input Validation.
Which Github.com/lightningnetwork/lnd versions are affected?
Affected versions include releases prior to 0.17.0-beta across affected packages: github.com/lightningnetwork/lnd.
What version fixes CVE-2024-38359?
Upgrading to 0.17.0-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.17.0-beta. Upgrade your dependency to 0.17.0-beta or later.
What is the CVSS score of CVE-2024-38359?
CVE-2024-38359 has a CVSS v3.1 base score of 6.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2024-38359?
CVE-2024-38359 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-2024-38359?
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-9gxx-58q6-42p7",
  "modified" : "2024-11-18T16:26:46Z",
  "published" : "2024-06-20T19:18:25Z",
  "aliases" : [ "CVE-2024-38359" ],
  "summary" : "Lightning Network Daemon (LND)'s onion processing logic leads to a denial of service",
  "details" : "### Impact\n\nA parsing vulnerability in lnd's onion processing logic led to a DoS vector due to excessive memory allocation.  \n\n### Patches\n\nThe issue was patched in lnd [v0.17.0](https://github.com/lightningnetwork/lnd/releases/tag/v0.17.0-beta). Users should update to a version >= v0.17.0 to be protected. \n\n### References\n\nDetailed blog post: https://morehouse.github.io/lightning/lnd-onion-bomb/\n\nDeveloper discussion: https://delvingbitcoin.org/t/dos-disclosure-lnd-onion-bomb/979",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/lightningnetwork/lnd"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.17.0-beta"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/lightningnetwork/lnd/security/advisories/GHSA-9gxx-58q6-42p7"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-38359"
  }, {
    "type" : "WEB",
    "url" : "https://delvingbitcoin.org/t/dos-disclosure-lnd-onion-bomb/979"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/lightningnetwork/lnd"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/lightningnetwork/lnd/releases/tag/v0.17.0-beta"
  }, {
    "type" : "WEB",
    "url" : "https://lightning.network"
  }, {
    "type" : "WEB",
    "url" : "https://morehouse.github.io/lightning/lnd-onion-bomb"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-20" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-06-20T19:18:25Z",
    "nvd_published_at" : "2024-06-20T23:15:52Z"
  }
}