Node2Shell: Critical Remote Code Execution via Brotli Decoder Flaw in Node.js

October 30, 2026
Node2Shell

Executive Summary

On 21 October 2026, the Node.js project released security updates (22.23.4, 24.22.1 and 26.12.1) fixing CVE-2026-111497, a critical out-of-bounds write in the Brotli decompression library that Node.js bundles. The flaw, publicly referred to as Node2Shell, is rated CVSS v4.0 9.2 and can allow an attacker who supplies a malformed Brotli-compressed stream to crash the process, disclose process memory, or in some configurations execute code with the privileges of the Node.js process. The Brotli project itself published fixed releases (1.0.10, 1.1.1 and 1.2.1) the same day, since the root defect sits in Brotli’s own decoder rather than in Node.js-specific code.

Applications are exposed when they decompress Brotli data they do not fully trust. Independent research identified several common paths that reach the vulnerable decoder by default, including inbound JSON body parsing in a popular web framework’s newest major version, the runtime’s built-in fetch() client when it reads a response carrying a Brotli content-encoding, and several other web framework middleware stacks. A separate, widely used JavaScript runtime bundling the same decoder is also affected.

Denial of service has been reproduced widely and reliably. Remote code execution has been demonstrated by at least one research team against an official Node.js container image, though under conditions that required multiple attempts and a specific architecture; other researchers have argued the practical impact may be limited to crashes in most real deployments. As of this writing, a national cyber agency’s known-exploited-vulnerabilities catalog has listed this flaw following confirmed active exploitation, and tracking has broadened beyond Node.js to cover other software bundling the same vulnerable Brotli versions.

Immediate priorities are to patch every Node.js and Brotli-bundling runtime to a fixed version, rebuild and redeploy container images rather than relying on floating tags, and reduce reachability in the interim by rejecting or disabling compressed-body decoding wherever it is not required. Linux distribution packages that use a system-wide Brotli library need a separate, distribution-level fix independent of the Node.js version in use.


At a Glance

Attribute Assessment
Threat name Node2Shell (public reporting name); later tracking also uses a broader name reflecting impact beyond Node.js
CVE ID CVE-2026-111497
Severity Critical; CVSS v4.0 9.2 (the Node.js project’s own advisory rates runtime impact as high)
Weakness type Out-of-bounds write (CWE-787) resulting from an unchecked decoder error (CWE-252)
Affected component Brotli decompression library, versions 1.0.3 through 1.2.0, as bundled in Node.js and other runtimes
Attack vector / privileges Network or local; no authentication required, provided the target decompresses attacker-influenced Brotli data
Primary risk Denial of service (widely reproduced); remote code execution or memory disclosure under some configurations
Public disclosure / fix date 21 October 2026
Remediation Update Node.js, the bundled runtime’s own Brotli copy, or the operating system’s Brotli package to a fixed version, then rebuild and redeploy

Bar chart of CVE-2026-111497 Brotli decoder flaw scoring 9.2 critical on CVSS v4.0

CVSS v4.0 base score for the tracked CVE.


Key Findings

  • The vulnerable code is in the Brotli decompression library itself, not in Node.js application logic; any software that bundles an affected Brotli build is potentially exposed, regardless of the web framework or application code running on top of it.
  • A newer major version of a popular web framework decompresses Brotli request bodies by default when its standard JSON body-parsing middleware is used; an older major version of the same framework does not, through that specific middleware, though other middleware in the same ecosystem may still be reachable.
  • The runtime’s built-in HTTP client can be made to decompress an attacker-influenced response automatically when a Brotli content-encoding is present, which matters most for server-side code that fetches from user-supplied or otherwise untrusted URLs, such as webhook handlers.
  • Denial of service (process crash) has been reproduced across multiple independent proof-of-concept repositories within roughly a day of the fix shipping. Remote code execution has been demonstrated by at least one research team in a specific configuration; other researchers dispute how broadly it generalizes. Both should be treated as credible risks pending further validation in your own environment.
  • Linux distribution packages that link against a system Brotli library, rather than the copy bundled inside Node.js, require their own, separate patch; a Node.js version number alone does not confirm whether the underlying Brotli library has been fixed on such systems.
  • This flaw has since been listed in a national cyber agency’s known-exploited-vulnerabilities catalog following confirmed active exploitation, and the research community’s tracking has broadened to cover other software and language ecosystems that bundle the same vulnerable Brotli versions.

Vulnerability Technical Analysis

CVE-2026-111497: Brotli Decoder Out-of-Bounds Write

Brotli is a general-purpose compression format with a decoder that reconstructs compressed data block by block. The CVE record attributes the flaw to two related weaknesses: an unchecked return value (CWE-252) and an out-of-bounds write (CWE-787). According to public technical analysis, a crafted compressed stream can declare one block type and then instruct the decoder to switch to another block type in a way that a correct implementation should reject outright. The unpatched decoder does not enforce that rejection consistently; instead of stopping cleanly, it can continue processing the malformed stream and write decoded output past the end of its allocated buffer.

Because the defect lives inside Brotli’s own native decoding code rather than in Node.js-specific logic, every runtime or library that bundles an affected Brotli build needs its own fix. The corrective change enforces the block-type check that was previously missed and introduces a new, explicit error condition for this case, so that a malformed stream now fails safely instead of continuing past the check.


Failure Chain

Five-step failure chain from untrusted Brotli decoding to out-of-bounds write and possible RCE

Five-stage defensive model of the failure chain. Conceptual representation only; not a reproduction procedure.

Stage Security meaning
1. Reachability The target application or runtime decompresses Brotli data that an attacker can influence, directly or through a fetched response.
2. Malformed stream delivered A compressed stream declares a block-type switch that should not be permitted for the stream’s declared structure.
3. Error not enforced The unpatched decoder does not consistently reject the malformed switch.
4. Out-of-bounds write Decoding continues and writes output past the end of its intended buffer.
5. Potential impact Process crash in the general case; memory disclosure or code execution under conditions that have so far been demonstrated in narrower configurations.

Affected Versions and Reachability

Node.js Release Lines

Release line End of life Fixed version Action
26.x 30 April 2029 26.12.1 Update to 26.12.1 or later
24.x 30 April 2028 24.22.1 Update to 24.22.1 or later
22.x 30 April 2027 22.23.4 Update to 22.23.4 or later
25.x Already ended (1 June 2026) No fix Treat as vulnerable; move to a supported line
20.x and older Already ended No fix Treat as vulnerable; move to a supported line

The Node.js project’s own policy treats every end-of-life release line as permanently affected by security releases; organizations still running an end-of-life line should assume it is vulnerable with no further patch coming, and prioritize migration over any interim mitigation.


Beyond Node.js: Brotli Library and Other Runtimes

The underlying defect sits in the Brotli library itself, versions 1.0.3 through 1.2.0, fixed upstream in 1.0.10, 1.1.1 and 1.2.1. Any other software that bundles a Brotli build in the affected range is potentially exposed and should be checked independently of its Node.js status. At least one other popular JavaScript runtime bundles an affected Brotli build and has shipped its own fixed release; package registries for at least one other programming language also distribute wrapper packages around the same vulnerable Brotli code and have needed their own updates.

Linux distribution packages are a particular trap: several mainstream distributions build their Node.js package against the operating system’s own shared Brotli library rather than the copy bundled inside the Node.js source tree. On those systems, updating the Node.js package alone does not fix the flaw; the distribution’s own Brotli package must also reach a fixed build. Administrators should check their distribution’s own security tracker rather than relying on the Node.js version number as a proxy for patch status.


Reachability by Framework and API

Not every Node.js process is exposed: the flaw can only be reached when the process actually decompresses Brotli data that an attacker can influence. The following summarizes publicly reported reachability by common framework and API; treat it as a starting point for your own code review rather than an exhaustive list.

Path Reaches the decoder? Notes
Newer major version of a popular web framework’s default JSON body parser Yes, by default Its underlying body-parsing dependency decodes Brotli-encoded request bodies by default; a bare runtime HTTP server does not do this decoding on its own.
Older major version of the same framework, same middleware Not through this specific middleware That middleware version historically handled only two other compression schemes and rejects other encodings; other middleware in the same ecosystem may still be reachable.
Runtime’s built-in server-side fetch() client Yes, for attacker-influenced responses Automatically decompresses a Brotli-encoded response; refusing to accept the encoding on the request side does not prevent this. Webhook handlers and other code that fetches user-supplied URLs are the primary concern.
Direct use of the runtime’s built-in compression module Yes Any code path that calls the built-in Brotli decompression function on attacker-controlled input is exposed.
Other web framework middleware stacks Yes, in several cases Multiple other popular request-body and compression middleware packages have also been reported as reaching the vulnerable decoder; a framework-by-framework code review is recommended rather than assuming safety by default.

Inbound reachability through request-body decompression should be prioritized first, since it is often reachable from any public route that accepts a request body. Outbound reachability through fetch() or similar HTTP clients matters wherever a service retrieves data from a URL it does not fully control.


Public Threat Status

Independent research teams reproduced denial-of-service crashes against unpatched builds within about a day of the fix shipping, and this has been confirmed across multiple, independently published proof-of-concept repositories. Remote code execution has been demonstrated by at least one research team against an official container image for a specific architecture, requiring multiple attempts under controlled conditions; the same team reported that the patched release correctly rejected the same crafted input. A separate research team reported local code execution in a modified configuration that loaded an unfixed system Brotli library with a predictable memory layout, but stated that blind remote execution against a build with standard memory-layout protections enabled did not succeed in their testing.

Other public analysis has disputed how broadly the out-of-bounds write can be turned into code execution, arguing the more consistently reproducible impact is denial of service rather than remote code execution, and noting that the upstream fix commit itself characterizes the underlying defect as difficult to exploit. As of this writing, a national cyber agency’s known-exploited-vulnerabilities catalog has added this flaw following confirmed active-exploitation reporting from at least one other research group. The balance of evidence supports treating denial of service as the most likely outcome in most affected deployments, while treating remote code execution as a credible, demonstrated risk wherever Brotli decompression of untrusted data is reachable.


Disclosure and Early Exploitation Timeline

Timeline from 14 Oct pre-announcement through 21 Oct fixes and PoC to confirmed exploitation

Key disclosure and early-exploitation milestones.

Date Event
14 October 2026 The runtime project pre-announces an upcoming release affecting specific release lines, without publishing technical detail.
21 October 2026, 10:38 UTC Fixed Node.js releases (22.23.4, 24.22.1, 26.12.1) are published.
21 October 2026, approximately 15:47 UTC The first public proof-of-concept repository referencing the CVE appears, roughly five hours after the fix shipped.
21 October 2026, approximately 19:27 UTC The Brotli project publishes its own fixed releases (1.0.10, 1.1.1, 1.2.1), each referencing the CVE.
22 October 2026 The CVE record is published with a CVSS v4.0 score of 9.2; a research team separately publishes analysis demonstrating code execution on an official container image.
23 to 25 October 2026 Multiple independent proof-of-concept repositories are published; public analysis disagrees on how broadly the flaw generalizes to remote code execution versus denial of service only.
26 October 2026 A research group reports confirmed, observed exploitation in the wild.
28 October 2026 The flaw is added to a national cyber agency’s known-exploited-vulnerabilities catalog; public tracking broadens to cover other affected software beyond Node.js.
29 October 2026 This assessment consolidates the official advisories and independent research published to date.

Detection and Threat Hunting

  • A runtime monitoring layer will not observe the memory-corruption event itself, but it can observe the behavior that a failed or successful exploitation attempt tends to produce. Because public testing reports that exploitation attempts often require multiple tries, a pattern of repeated process crashes followed by unexpected process activity in the same workload is a meaningful signal.
  • Correlate a Node.js (or other affected runtime) process crash with any program execution that follows shortly afterward in the same container or host; this combination has been specifically called out in public detection guidance as characteristic of exploitation attempts against this flaw.
  • Monitor for unexpected child processes spawned from a Node.js worker, especially interactive shells, download utilities, or cryptocurrency-mining binaries, which are common post-exploitation outcomes once code execution is achieved under a service account.
  • Watch for unusual outbound network connections or data transfers originating from Node.js processes, particularly immediately following a crash-and-restart cycle.
  • Review ingress logs for repeated malformed or unusually structured compressed request bodies directed at routes that accept a Content-Encoding of br, and for abnormal response-handling errors on outbound fetch() calls to externally supplied URLs.
  • Inventory every Node.js runtime across the estate, including containers, build and CI systems, serverless functions, and any third-party tooling that ships its own bundled Node.js, since these are easy to overlook relative to production application servers.

Mitigation and Remediation Plan

Patch

  • Update Node.js to 22.23.4, 24.22.1 or 26.12.1 as applicable; this is the only complete fix for the Node.js-bundled copy of the decoder.
  • Separately verify and update any other JavaScript runtime in use that bundles its own copy of Brotli.
  • Rebuild container images from a patched base rather than assuming an existing image is current; a floating base-image tag can remain on an older, cached build. Pull the latest base image explicitly, then verify the installed runtime version inside the running container rather than trusting the tag alone.
  • On Linux distribution packages that use a system-wide Brotli library, confirm the distribution’s own Brotli package has reached a fixed version; the Node.js package version alone does not confirm this.
  • Replace end-of-life Node.js release lines with a currently supported line; no further security fixes will be issued for them.

Reduce Reachability While Patching

  • Where feasible, disable automatic decompression of compressed request bodies in body-parsing middleware until patched, after confirming this will not break legitimate compressed traffic from clients that require it.
  • Consider rejecting a Content-Encoding of br on inbound requests at a reverse proxy or load balancer for services whose legitimate clients do not send Brotli-compressed bodies; validate this does not silently break expected functionality, and note that it does not address the outbound fetch() exposure.
  • Audit code paths that call fetch() or similar HTTP clients against externally supplied or user-controlled URLs, and any direct use of the runtime’s built-in Brotli decompression function on untrusted input.
  • Where available, apply a web application firewall rule layer to limit untrusted Brotli-encoded traffic on affected routes as a temporary, defense-in-depth measure; this is not a substitute for patching.

Contain the Blast Radius

  • Run Node.js services under an unprivileged account and avoid storing sensitive credentials directly in the process environment, since successful code execution inherits the permissions of the Node.js process.
  • Apply standard least-privilege and network-segmentation practices to web-facing Node.js workloads so that a compromised process has limited lateral reach.

Incident Response if Exploitation Is Suspected

A single process crash is not, by itself, proof of exploitation; crashes can also result from unrelated bugs or malformed but non-malicious input. Escalate when crash activity is temporally correlated with unexpected process execution, new or modified files, unexplained outbound connections, or other signs of post-exploitation activity.

Phase Recommended actions
1. Contain Isolate the affected workload or host where business impact allows; preserve logs and container state before restarting or redeploying.
2. Preserve Collect process crash logs, container runtime logs, network telemetry, and any available memory or core artifacts before the environment is rebuilt.
3. Hunt Review process trees for unexpected children of the Node.js process, new scheduled tasks or services, new user accounts or credentials, and unexplained outbound connections.
4. Eradicate Patch or rebuild from a verified, patched image; remove any unauthorized persistence; rotate credentials and tokens that were accessible to the affected process.
5. Recover Restore traffic only after the patched version is verified in the running environment and temporary mitigations are confirmed no longer necessary.
6. Report Record confirmed facts separately from hypotheses; note the exposed time window, affected versions, and remediation timestamps.

Overall Assessment and Conclusion

Node2Shell (CVE-2026-111497) is a critical, independently confirmed vulnerability in the Brotli decompression library bundled by Node.js and other runtimes. It is not a flaw in every Node.js service, but a flaw in services that decompress Brotli data they do not fully control, a category that includes a substantial share of modern web applications given how common this behavior is in current framework defaults. Denial of service is reliably reproducible and should be assumed wherever the decoder is reachable; remote code execution has been demonstrated in narrower, specific configurations and should be treated as a credible risk rather than a theoretical one.

Because the defect sits in a native library bundled independently by multiple language ecosystems and runtimes, patch verification must go beyond checking the Node.js version number alone; distribution packages, alternate runtimes, and vendored copies in other tooling all need independent confirmation. The short gap between patch release and public proof-of-concept code in this case, on the order of hours, underscores the value of rapid, estate-wide patch verification over incremental, service-by-service remediation.

About the author