CVE-2023-25576: @fastify/multipart Denial of Service Vulnerability

HIGH
Advisory Identifier: GHSA-hpp2-2cr5-pf6g
CVSS 7.5
CWE-400 CWE-770
Published
Advisory Summary

CVE-2023-25576 is a HIGH (CVSS 7.5) denial of service vulnerability (CWE-400: Uncontrolled Resource Consumption) affecting @fastify/multipart libraries in the npm ecosystem. The issue involves denial of service due to unlimited number of parts. Remediation is available by upgrading affected packages to version 6.0.1, 7.4.1.

CVE-2023-25576 at a Glance

CVE Identifier CVE-2023-25576
GHSA Identifier GHSA-hpp2-2cr5-pf6g
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-400: Uncontrolled Resource Consumption
Affected Product @fastify/multipart
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 7.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:N/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 None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability High (A:H)

How to Fix CVE-2023-25576

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

@fastify/multipart fixed: 6.0.1
npm install @fastify/multipart@6.0.1
@fastify/multipart fixed: 7.4.1
npm install @fastify/multipart@7.4.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 @fastify/multipart

How to Check if You Are Affected

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

npm ls @fastify/multipart

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

Note: The npm ls @fastify/multipart 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 @fastify/multipart, 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 * The multipart body parser accepts an unlimited number of file parts. * The multipart body parser accepts an unlimited number of field parts. * The multipart body parser accepts an unlimited number of empty parts as field parts. ### Patches This is fixed in v7.4.1 (for Fastify v4.x) and v6.0.1 (for Fastify v3.x). ### Workarounds There are no known workaround. ### References Reported at https://hackerone.com/reports/1816195.

CVE-2023-25576 Affected @fastify/multipart Versions

2 component(s)
Fixed Versions:
6.0.17.4.1
Product / Package Ecosystem Affected Versions Fixed Version
@fastify/multipart
npm
< 6.0.1
6.0.1
@fastify/multipart
npm
≥ 7.0.0
< 7.4.1
7.4.1

References

Frequently Asked Questions

What is CVE-2023-25576?
CVE-2023-25576 is a security vulnerability in @fastify/multipart involving Denial of service due to unlimited number of parts under CWE-400: Uncontrolled Resource Consumption.
Which @fastify/multipart versions are affected?
Affected versions include releases prior to 6.0.1, 7.4.1 across affected packages: @fastify/multipart.
What version fixes CVE-2023-25576?
Upgrading to 6.0.1, 7.4.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @fastify/multipart affected?
Yes, @fastify/multipart is affected in releases prior to 6.0.1, 7.4.1. Upgrade your dependency to 6.0.1, 7.4.1 or later.
What is the CVSS score of CVE-2023-25576?
CVE-2023-25576 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2023-25576?
CVE-2023-25576 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-2023-25576?
Run the dependency tree command: 'npm ls @fastify/multipart'. 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-hpp2-2cr5-pf6g",
  "modified" : "2023-02-14T21:49:55Z",
  "published" : "2023-02-14T21:49:55Z",
  "aliases" : [ "CVE-2023-25576" ],
  "summary" : "Denial of service due to unlimited number of parts",
  "details" : "### Impact\n\n* The multipart body parser accepts an unlimited number of file parts.\n* The multipart body parser accepts an unlimited number of field parts.\n* The multipart body parser accepts an unlimited number of empty parts as field\nparts.\n\n\n### Patches\n\nThis is fixed in v7.4.1 (for Fastify v4.x) and v6.0.1 (for Fastify v3.x).\n\n### Workarounds\n\nThere are no known workaround.  \n\n### References\n\nReported at https://hackerone.com/reports/1816195.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@fastify/multipart"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "6.0.1"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@fastify/multipart"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "7.0.0"
      }, {
        "fixed" : "7.4.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/fastify/fastify-multipart/security/advisories/GHSA-hpp2-2cr5-pf6g"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-25576"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/fastify/fastify-multipart/commit/85be81bedf5b29cfd9fe3efc30fb5a17173c1297"
  }, {
    "type" : "WEB",
    "url" : "https://hackerone.com/reports/1816195"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/fastify/fastify-multipart"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/fastify/fastify-multipart/releases/tag/v6.0.1"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/fastify/fastify-multipart/releases/tag/v7.4.1"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-400", "CWE-770" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-02-14T21:49:55Z",
    "nvd_published_at" : "2023-02-14T16:15:00Z"
  }
}