CVE-2024-38372: Undici Undici Vulnerable To Data Leak Vulnerability

LOW
Advisory Identifier: GHSA-3g92-w8c5-73pq
CVSS 2.0
CWE-201
Published
Advisory Summary

CVE-2024-38372 is a LOW (CVSS 2.0) undici vulnerable to data leak vulnerability (CWE-201: Insertion of Sensitive Information Into Sent Data) affecting Undici libraries in the npm ecosystem. The issue involves undici vulnerable to data leak when using response.arraybuffer(). Remediation is available by upgrading affected packages to version 6.19.2.

CVE-2024-38372 at a Glance

CVE Identifier CVE-2024-38372
GHSA Identifier GHSA-3g92-w8c5-73pq
Severity LOW
CVSS v3.1 Base Score 2.0
CWE Classification CWE-201: Insertion of Sensitive Information Into Sent Data
Affected Product Undici
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 2.0

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

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

How to Fix CVE-2024-38372

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

undici fixed: 6.19.2
npm install undici@6.19.2
Verify Direct and Transitive Dependencies

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

npm ls undici

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2024-38372, inspect your project dependencies using npm:

npm ls undici

Analyze the terminal output to locate any version of Undici in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 6.19.2), your application is affected.

Note: The npm ls undici command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-201: Insertion of Sensitive Information Into Sent Data, where the code transmits data to another actor, but a portion of the data includes sensitive information that should not be accessible to that actor. In Undici, 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 Depending on network and process conditions of a `fetch()` request, `response.arrayBuffer()` might include portion of memory from the Node.js process. ### Patches This has been patched in v6.19.2. ### Workarounds There are no known workaround. ### References https://github.com/nodejs/undici/issues/3337 https://github.com/nodejs/undici/issues/3328 https://github.com/nodejs/undici/pull/3338 https://github.com/nodejs/undici/commit/f979ec3204ca489abf30e7d20e9fee9ea7711d36

CVE-2024-38372 Affected Undici Versions

1 component(s)
Fixed Versions:
6.19.2
Product / Package Ecosystem Affected Versions Fixed Version
undici
npm
≥ 6.14.0
< 6.19.2
6.19.2

References

Frequently Asked Questions

What is CVE-2024-38372?
CVE-2024-38372 is a security vulnerability in Undici involving Undici vulnerable to data leak when using response.arrayBuffer() under CWE-201: Insertion of Sensitive Information Into Sent Data.
Which Undici versions are affected?
Affected versions include releases prior to 6.19.2 across affected packages: undici.
What version fixes CVE-2024-38372?
Upgrading to 6.19.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is undici affected?
Yes, undici is affected in releases prior to 6.19.2. Upgrade your dependency to 6.19.2 or later.
What is the CVSS score of CVE-2024-38372?
CVE-2024-38372 has a CVSS v3.1 base score of 2.0 (LOW) with vector string CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:U/C:L/I:N/A:N.
What CWE is associated with CVE-2024-38372?
CVE-2024-38372 is classified under CWE-201: Insertion of Sensitive Information Into Sent Data (The code transmits data to another actor, but a portion of the data includes sensitive information that should not be accessible to that actor.).
How can I check npm dependencies for CVE-2024-38372?
Run the dependency tree command: 'npm ls undici'. 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-3g92-w8c5-73pq",
  "modified" : "2024-07-09T13:32:30Z",
  "published" : "2024-07-09T13:32:30Z",
  "aliases" : [ "CVE-2024-38372" ],
  "summary" : "Undici vulnerable to data leak when using response.arrayBuffer()",
  "details" : "### Impact\n\nDepending on network and process conditions of a `fetch()` request, `response.arrayBuffer()` might include portion of memory from the Node.js process.\n\n### Patches\n\nThis has been patched in v6.19.2.\n\n### Workarounds\n\nThere are no known workaround.\n\n### References\n\nhttps://github.com/nodejs/undici/issues/3337\nhttps://github.com/nodejs/undici/issues/3328\nhttps://github.com/nodejs/undici/pull/3338\nhttps://github.com/nodejs/undici/commit/f979ec3204ca489abf30e7d20e9fee9ea7711d36",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:U/C:L/I:N/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:H/AT:N/PR:H/UI:P/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "undici"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "6.14.0"
      }, {
        "fixed" : "6.19.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/nodejs/undici/security/advisories/GHSA-3g92-w8c5-73pq"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-38372"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nodejs/undici/issues/3328"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nodejs/undici/issues/3337"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nodejs/undici/pull/3338"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nodejs/undici/commit/f979ec3204ca489abf30e7d20e9fee9ea7711d36"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/nodejs/undici"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-201" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-07-09T13:32:30Z",
    "nvd_published_at" : "2024-07-08T21:15:12Z"
  }
}