CVE-2024-24750: Undici Fetch(url) Leads To A Memory Vulnerability

MODERATE
Advisory Identifier: GHSA-9f24-jqhm-jfcw
CVSS 6.5
CWE-400 CWE-401
Published
Advisory Summary

CVE-2024-24750 is a MODERATE (CVSS 6.5) fetch(url) leads to a memory vulnerability (CWE-400: Uncontrolled Resource Consumption) affecting Undici libraries in the npm ecosystem. The issue involves fetch(url) leads to a memory leak in undici. Remediation is available by upgrading affected packages to version 6.6.1.

CVE-2024-24750 at a Glance

CVE Identifier CVE-2024-24750
GHSA Identifier GHSA-9f24-jqhm-jfcw
Severity MODERATE
CVSS v3.1 Base Score 6.5
CWE Classification CWE-400: Uncontrolled Resource Consumption
Affected Product Undici
Package Ecosystem npm
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:N/UI:R/S:U/C:N/I:N/A:H).

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

How to Fix CVE-2024-24750

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.6.1
npm install undici@6.6.1
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-24750, 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.6.1), 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-400: Uncontrolled Resource Consumption, where the product does not properly control the allocation and maintenance of a limited resource. 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 Calling `fetch(url)` and not consuming the incoming body ((or consuming it very slowing) will lead to a memory leak. ### Patches Patched in v6.6.1 ### Workarounds Make sure to always consume the incoming body.

CVE-2024-24750 Affected Undici Versions

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

References

Frequently Asked Questions

What is CVE-2024-24750?
CVE-2024-24750 is a security vulnerability in Undici involving fetch(url) leads to a memory leak in undici under CWE-400: Uncontrolled Resource Consumption.
Which Undici versions are affected?
Affected versions include releases prior to 6.6.1 across affected packages: undici.
What version fixes CVE-2024-24750?
Upgrading to 6.6.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is undici affected?
Yes, undici is affected in releases prior to 6.6.1. Upgrade your dependency to 6.6.1 or later.
What is the CVSS score of CVE-2024-24750?
CVE-2024-24750 has a CVSS v3.1 base score of 6.5 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2024-24750?
CVE-2024-24750 is classified under CWE-400: Uncontrolled Resource Consumption (The product does not properly control the allocation and maintenance of a limited resource.).
How can I check npm dependencies for CVE-2024-24750?
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-9f24-jqhm-jfcw",
  "modified" : "2024-04-19T09:30:47Z",
  "published" : "2024-02-16T15:59:38Z",
  "aliases" : [ "CVE-2024-24750" ],
  "summary" : "fetch(url) leads to a memory leak in undici",
  "details" : "### Impact\n\nCalling `fetch(url)` and not consuming the incoming body ((or consuming it very slowing) will lead to a memory leak. \n\n### Patches\n\nPatched in v6.6.1\n\n### Workarounds\n\nMake sure to always consume the incoming body.\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "undici"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "6.0.0"
      }, {
        "fixed" : "6.6.1"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 6.6.0"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/nodejs/undici/security/advisories/GHSA-9f24-jqhm-jfcw"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-24750"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nodejs/undici/commit/87a48113f1f68f60aa09abb07276d7c35467c663"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/nodejs/undici"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nodejs/undici/releases/tag/v6.6.1"
  }, {
    "type" : "WEB",
    "url" : "https://security.netapp.com/advisory/ntap-20240419-0006"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-400", "CWE-401" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-02-16T15:59:38Z",
    "nvd_published_at" : "2024-02-16T22:15:07Z"
  }
}