CVE-2021-23597: Fastify multipart Uncaught Exception Vulnerability

HIGH
Advisory Identifier: GHSA-qh73-qc3p-rjv2
CVSS 7.5
CWE-400
Published
Advisory Summary

CVE-2021-23597 is a HIGH (CVSS 7.5) uncaught exception vulnerability (CWE-400: Uncontrolled Resource Consumption) affecting Fastify multipart libraries in the npm ecosystem. The issue involves uncaught exception in fastify-multipart. Remediation is available by upgrading affected packages to version 5.3.1.

CVE-2021-23597 at a Glance

CVE Identifier CVE-2021-23597
GHSA Identifier GHSA-qh73-qc3p-rjv2
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-2021-23597

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: 5.3.1
npm install fastify-multipart@5.3.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-2021-23597, 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 5.3.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 This is a bypass of CVE-2020-8136 (https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-8136). By providing a `name=constructor` property it is still possible to crash the application. The original fix only checks for the key `__proto__` (https://github.com/fastify/fastify-multipart/pull/116). All users are recommended to upgrade ### Patches v5.3.1 includes a patch ### Workarounds No workarounds are possible. ### References Read up https://www.fastify.io/docs/latest/Guides/Prototype-Poisoning/ ### For more information If you have any questions or comments about this advisory: * Open an issue in [https://github.com/fastify/fastify-multipart](https://github.com/fastify/fastify-multipart) * Email us at [hello@matteocollina.com](mailto:hello@matteocollina.com)

CVE-2021-23597 Affected Fastify multipart Versions

1 component(s)
Fixed Versions:
5.3.1
Product / Package Ecosystem Affected Versions Fixed Version
fastify-multipart
npm
< 5.3.1
5.3.1

References

Frequently Asked Questions

What is CVE-2021-23597?
CVE-2021-23597 is a security vulnerability in Fastify multipart involving Uncaught Exception in fastify-multipart under CWE-400: Uncontrolled Resource Consumption.
Which Fastify multipart versions are affected?
Affected versions include releases prior to 5.3.1 across affected packages: fastify-multipart.
What version fixes CVE-2021-23597?
Upgrading to 5.3.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 5.3.1. Upgrade your dependency to 5.3.1 or later.
What is the CVSS score of CVE-2021-23597?
CVE-2021-23597 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-2021-23597?
CVE-2021-23597 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-2021-23597?
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-qh73-qc3p-rjv2",
  "modified" : "2022-02-23T22:11:16Z",
  "published" : "2022-02-11T18:57:53Z",
  "aliases" : [ "CVE-2021-23597" ],
  "summary" : "Uncaught Exception in fastify-multipart",
  "details" : "### Impact\n\nThis is a bypass of CVE-2020-8136 (https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-8136).\nBy providing a `name=constructor` property it is still possible to crash the application.\nThe original fix only checks for the key `__proto__` (https://github.com/fastify/fastify-multipart/pull/116).\n\nAll users are recommended to upgrade\n\n### Patches\n\nv5.3.1 includes a patch\n \n### Workarounds\n\nNo workarounds are possible.\n\n### References\n\nRead up https://www.fastify.io/docs/latest/Guides/Prototype-Poisoning/\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in [https://github.com/fastify/fastify-multipart](https://github.com/fastify/fastify-multipart)\n* Email us at [hello@matteocollina.com](mailto:hello@matteocollina.com)\n",
  "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" : "5.3.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/fastify/fastify-multipart/security/advisories/GHSA-qh73-qc3p-rjv2"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-23597"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/fastify/fastify-multipart/pull/116"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/fastify/fastify-multipart/commit/a70dc7059a794589bd4fe066453141fc609e6066"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/fastify/fastify-multipart"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/fastify/fastify-multipart/releases/tag/v5.3.1"
  }, {
    "type" : "WEB",
    "url" : "https://snyk.io/vuln/SNYK-JS-FASTIFYMULTIPART-2395480"
  }, {
    "type" : "WEB",
    "url" : "https://www.fastify.io/docs/latest/Guides/Prototype-Poisoning"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-400" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-02-11T18:57:53Z",
    "nvd_published_at" : "2022-02-11T17:15:00Z"
  }
}