CVE-2026-21710

Denial of Service
Affects
Node.js
in
Node.js
No items found.
Versions
>=16.17.0 <=16.20.2 >=18.3.0 <=18.20.8 >=19.0.0 <=19.9.0 >=20.0.0 <20.20.2 >=21.0.0 <=21.7.3 >=22.0.0 <22.22.2 >=23.0.0 <=23.11.1 >=24.0.0 <24.14.1 >=25.0.0 <25.8.2

Patch Available.

Exclamation circle icon
Patch Available

This Vulnerability has been fixed in the Never-Ending Support (NES) version offered by HeroDevs.

Overview

Node.js is an asynchronous, event-driven JavaScript runtime designed for building scalable network applications. Its built-in http module parses incoming requests into IncomingMessage objects. Since Node.js 16.17.0 and 18.3.0, those objects expose headersDistinct and trailersDistinct, which return each header name mapped to an array of all the values received for it.

A denial of service vulnerability (CVE-2026-21710) has been identified in Node.js's HTTP request handling. When an application reads req.headersDistinct, Node.js builds that object from the raw headers and appends each value to the array stored under the header's name. However, the object was created as a plain JavaScript object, so a header named __proto__ looks up Object.prototype instead of an empty slot, and calling .push() on it throws a TypeError. The exception is raised synchronously inside a property getter and cannot be caught by error event listeners, so one crafted request can crash the whole Node.js process.

This behaviour maps to CWE-843 (Access of Resource Using Incompatible Type) and CWE-770 (Allocation of Resources Without Limits or Throttling), the two weaknesses NVD lists for this CVE. The first describes code that accesses a resource using a type incompatible with its actual type. In Node.js, the code expects an array or nothing under each header name, but the special __proto__ key yields the object prototype instead. The result is an unhandled exception that terminates the server.

Exploitation requires only the ability to send an HTTP request with a header named __proto__ to a Node.js server whose code, or a framework or middleware it uses, reads req.headersDistinct (or res.trailersDistinct for trailers). No authentication or user interaction is needed. Applications that never access these properties are not affected. The Node.js project describes the issue as affecting all HTTP servers on its supported 20.x, 22.x, 24.x and 25.x lines. The same code is also present in the End-of-Life 16.x, 18.x, 19.x, 21.x and 23.x lines from the release that introduced headersDistinct.

Details

Module Info

  • Product: Node.js
  • Affected packages: node (built-in http module, lib/_http_incoming.js)
  • Affected versions: >=16.17.0 <=16.20.2 >=18.3.0 <=18.20.8 >=19.0.0 <=19.9.0 >=20.0.0 <20.20.2 >=21.0.0 <=21.7.3 >=22.0.0 <22.22.2 >=23.0.0 <=23.11.1 >=24.0.0 <24.14.1 >=25.0.0 <25.8.2
  • GitHub repository: https://github.com/nodejs/node
  • Published packages: https://nodejs.org/en/download
  • Package manager: Not applicable; Node.js is distributed as runtime builds from nodejs.org rather than as a published npm package
  • Fixed in: Node.js 20.20.2, 22.22.2, 24.14.1, and 25.8.2 (upstream fixes, released March 24, 2026); Node.js NES v22.22.3 (22.x line, shipped March 25, 2026), v20.20.3 (20.x line, shipped March 27, 2026), v18.20.16 (18.x line, shipped March 30, 2026), and v16.20.11 (16.x line, shipped April 3, 2026), the last two for lines that never received an upstream fix before reaching End-of-Life

Vulnerability Info

This High-severity vulnerability is found in the headersDistinct and trailersDistinct getters of IncomingMessage in Node.js's http module. NVD records a CVSS v3.1 score of 7.5 from the CISA ADP, matching the HackerOne CNA's CVSS v3.0 score of 7.5.

On first access, the getter is supposed to create an empty map, walk the raw header list, and for each header either start a new array or append to the existing one under that name. In the vulnerable implementation, the map was an ordinary object literal ({}), which inherits from Object.prototype. When the incoming header list contains __proto__, the lookup returns Object.prototype rather than undefined. The code then treats it as an existing array and calls .push() on it, throwing a TypeError out of the getter. The fix creates both maps with a null prototype ({ __proto__: null }), so __proto__ behaves like any other header name. The fix landed upstream as commit 00ad47a28e on the 25.x line and was backported to 20.x, 22.x and 24.x (changelog entries for nodejs-private/node-private#821).

An attacker would need network access to the HTTP server and a code path that reads req.headersDistinct for the request they send. Many routing and logging layers read headers on every request, so a single request can be enough to stop the process.

Note: Because the crash only happens when req.headersDistinct or res.trailersDistinct is read, applications and frameworks that use only req.headers or req.rawHeaders are not exposed by this issue.

Mitigation

Node.js 22.x and 24.x are still supported and are fixed in 22.22.2 and 24.14.1 and later. Node.js 25.x reached End-of-Life on June 1, 2026, so the fix in 25.8.2 is the last for that line. Node.js 20.x reached End-of-Life on April 30, 2026, after its fix in 20.20.2. The 16.x, 18.x, 19.x, 21.x and 23.x lines never received an upstream fix. Node.js 16.x reached End-of-Life on September 11, 2023; Node.js 18.x on April 30, 2025; Node.js 19.x on June 1, 2023; Node.js 21.x on June 1, 2024; and Node.js 23.x on June 1, 2025. For more information see here.

Users of the affected components should apply one of the following mitigations:

  • Upgrade to Node.js 22.22.2 or later on the 22.x line, or to 24.14.1 or later on the 24.x line, both of which include this fix.
  • Migrate affected applications away from the End-of-Life Node.js release lines.
  • Leverage a commercial support partner like HeroDevs for post-EOL security support, through Node.js NES.

Credits

  • yushengchen (reporter)
  • Matteo Collina (remediation developer)
Vulnerability Details
Severity
Level
CVSS Assessment
Low
>=0 <4
Medium
>=4 <6
High
>=6 <8
Critical
>=8 <10
High
ID
CVE-2026-21710
PROJECT Affected
Node.js
Versions Affected
>=16.17.0 <=16.20.2 >=18.3.0 <=18.20.8 >=19.0.0 <=19.9.0 >=20.0.0 <20.20.2 >=21.0.0 <=21.7.3 >=22.0.0 <22.22.2 >=23.0.0 <=23.11.1 >=24.0.0 <24.14.1 >=25.0.0 <25.8.2
NES Versions Affected
Published date
October 13, 2026
≈ Fix date
March 25, 2026
Category
Denial of Service
Vex Document
Download VEXHow do I use it?
Sign up for the latest vulnerability alerts fixed in
NES for Node.js
Rss feed icon
Subscribe via RSS
or

By submitting the form I acknowledge receipt of our Privacy Policy.

Thanks for signing up for our Newsletter! We look forward to connecting with you.
Oops! Something went wrong while submitting the form.