Home OffSec
  • Pricing
Blog

Node2Shell: The Brotli Decoder Flaw Behind CVE-2026-111497

Node2Shell: The Brotli Decoder Flaw Behind CVE-2026-111497

Learn all about CVE-2026-111497 – a flaw affects the Brotli code included with Node.js that can let attackers run code on the server.

OffSec Team OffSec Team

10 min read

Overview

A missing error check in Google’s Brotli compression library can let a malicious compressed stream corrupt a program’s memory. On Node.js, researchers have shown that this can sometimes let an attacker run code on the server.

Node.js released security updates for CVE-2026-111497 on October 21, 2026. The flaw affects the Brotli code included with Node.js. Brotli is widely used to compress web traffic, and the vulnerable code is in Google library versions 1.0.3 through 1.2.0. Other projects also use the library, including Python packages, .NET, Bun, Envoy, and Linux distributions.

The flaw is commonly called Node2Shell, the name Imperva’s red team gave its analysis. It is also known as Broccoli2Shell and HTTP2Shell. Khai Tran and Sylvie Mayer of OpenAI Codex Security reported the flaw to Node.js.

Severity ratings vary. The GitHub advisory lists it at 9.2 out of 10, while NVD rates it as high as 9.8. Node.js classifies it as High, and Red Hat rates it 8.1. Red Hat’s lower score reflects the difficulty of carrying out the attack and protections such as ASLR.

The Brotli format itself is not broken. The problem is in its error handling: when the decoder encountered invalid data, it treated the problem as if it needed to wait for more data.

CVECVE-2026-111497
SeverityCritical
CVSS9.2 (CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N)
EPSS55.48% (99.03rd percentile)
CWECWE-787 (Out-of-bounds Write); CWE-252 (Unchecked Return Value)
ImpactUnauthenticated memory corruption → information disclosure, denial of service, or remote code execution
Attack VectorNetwork
AuthenticationNot required
Affected ComponentBrotli decoder (c/dec/decode.c) — invalid block-switch mis-handled as “need more input”, overflowing an 8-byte streaming buffer
ProductGoogle Brotli 1.0.3–1.2.0, bundled in Node.js 22.x / 24.x / 26.x (also Bun, Python brotli packages, Envoy/Istio, .NET, Firefox/Thunderbird)
ReporterKhai Tran & Sylvie Mayer (OpenAI Codex Security), via the Node.js project

Technical overview

Brotli data is divided into blocks, and it can tell the decoder to switch from one block type to another. According to ELLIO’s analysis, the code handling a switch returned “no” both when the switch was invalid and when the decoder had run out of data.

Those situations are different, but the rest of the decoder could not tell them apart. When an attacker sent a stream requesting an impossible switch, the decoder treated it as “need more input” and continued. According to the Node.js advisory, it then kept copying incoming bytes into an eight-byte internal buffer without clearing it. Bytes beyond the first eight overwrote nearby memory.

The fix is small: the decoder now reports an invalid switch as an error and stops. ELLIO says the fix was written on February 27, 2026, but remained in Brotli’s public code for about eight months without a release or advisory. The flaw dates back to Brotli 1.0.3, released in March 2018.


Impact

An application may be at risk if it decompresses Brotli data an attacker can control. In Node.js, this can happen in three main ways:

  • Incoming requests. Express 5 and body-parser 2 automatically decompress request bodies marked as Brotli, and Koa body parsers can decompress them too. An attacker does not need to log in first. Express 4 does not decompress Brotli request bodies.
  • Outgoing requests. Node’s built-in fetch() automatically decompresses Brotli responses. If an application fetches a URL supplied by a user, such as for a webhook or link preview, a malicious server could send a harmful response.
  • Direct use. Any code that passes untrusted data directly to Brotli functions in node:zlib may be exposed, regardless of the framework.

Researchers have demonstrated code execution, but the exploits are unreliable. Imperva achieved it on the official Node.js 24.22.0 Linux arm64 image through both fetch() and Express 5 request bodies. Imperva said the exploit did not succeed every time. ELLIO obtained shells on x86-64 across four setups, but most of its 400 attempts against Express only crashed the worker. ELLIO also found that an exploit must be tuned to a specific Node.js build. Even an unsuccessful attempt can take down the service. One independent analysis considers denial of service the more likely real-world impact.

Attempts began within days of disclosure. At 15:08 UTC on October 26, 2026, ELLIO sensors recorded a single 23 MB request targeting Node.js 24.22.0 on x86-64. When ELLIO replayed it in a lab, it did not produce a shell in 50 attempts; it crashed the process instead. This shows someone tried to exploit the flaw, but the attempt was unsuccessful in ELLIO’s test. CISA added the flaw to its Known Exploited Vulnerabilities catalog the next day.

For further analysis, see Imperva, ELLIO, and Sysdig.

Downstream Vulnerabilities and Vendor Response

Projects covered in this post track the flaw as CVE-2026-111497. Their fixes differ because they package Brotli in different ways. Some projects include their own copy and need a project release. Others use the operating system’s library and are fixed through a system update.

The table lists the main affected technologies and their fixed versions.

Vendor / affected technologyAdvisoryFixed versions and notes
Google Brotli (C library)GHSA-9v8h-qqgm-4m35Versions 1.0.3 through 1.2.0 are affected. Fixed in 1.0.10, 1.1.1, and 1.2.1.
Node.jsOctober 2026 security releasesFixed in 22.23.4, 24.22.1, and 26.12.1. End-of-life release lines will not receive a fix.
Python brotli and brotlicffiPYSEC-2026-4322, PYSEC-2026-4323Fixed in brotli 1.2.1 and brotlicffi 1.2.1.0. Code execution has not been demonstrated for these packages.
Microsoft .NET, PowerShell, Visual StudioOut-of-band update, October 25 (Microsoft .NET blog and MSRC); summary by CycodeFixed in .NET 8.0.33, 9.0.22, and 10.0.14. PowerShell 7.4.22, 7.5.13, and 7.6.9 include the patched .NET. Brotli decompression is opt-in in .NET. .NET Framework is not affected.
BunBun 1.4.4 release, as reported by Sysdig and CycodeFixed in 1.4.4.
Envoy and IstioGHSA-3wvj-j6qm-62mrFixed in Envoy 1.37.8, 1.38.6, and 1.39.3, and Istio 1.29.9, 1.30.6, and 1.31.2. These products are affected only when the Brotli decompressor is enabled.
Linux distributionsRHSB-2026-015, DSA-6582-1, DLA-4855-1Fixed Brotli packages are available for RHEL, Debian 12 and 13, and Alpine. Distribution builds of Node.js may use the system library.

Detection and Investigation

Two items need to be verified to confirm vulnerability: 

  • First, which systems have the vulnerable decoder;
  • Whether untrusted Brotli data can reach it. 

A vulnerable version is not automatically exploitable, and checking one host does not cover older containers that may still be running.

Check runtime and library versions

First, check the Node.js version inside the running container. The Dockerfile shows the intended version, which may differ from what is deployed:

node –version

docker run –rm –entrypoint node <image> –version

Versions earlier than 22.23.4, 24.22.1, or 26.12.1 in those release lines are affected. All end-of-life lines are affected too. Note that process.versions.brotli is not a reliable check: Node.js patched its bundled Brotli code without changing that version string. A fixed Node.js 24.22.1 build may still report Brotli 1.2.0.

Instead, check whether the runtime recognizes the new error code:

node -p “require(‘zlib’).constants.BROTLI_DECODER_ERROR_FORMAT_BLOCK_SWITCH”

A patched official build prints -17. Treat this as a strong indicator. If your distribution’s Node.js package uses the system Brotli library, check the installed brotli package as well.

For Python environments, check both packages:

pip show brotli brotlicffi

Confirm the decoder is reachable

Find out which services accept compressed request bodies. Express 5, body-parser 2, Koa body parsers, and @fastify/compress decompress them. A basic node:http server does not, unless application code calls node:zlib itself.

Also review outbound traffic. In particular, check whether server-side fetch() requests can use a URL controlled by a user. Setting Accept-Encoding to request gzip does not prevent a hostile server from replying with Brotli.

Finding one of these paths does not prove that it is reachable from the internet. It does help you decide what to patch first.

Review logs and runtime signals

A patched Express 5 application rejects the malicious stream with HTTP 400 and the error code ERR__ERROR_FORMAT_BLOCK_SWITCH. If that error appears in your logs, someone may have sent the trigger to a server that was already patched.

On an unpatched server, an attempt may crash the process. Look for Node.js workers exiting with status 139 (often associated with SIGSEGV) or 134 (often associated with SIGABRT), especially if they restart soon after receiving a large Brotli request. Processes can crash for many reasons, so compare these signals with request logs before drawing a conclusion.

Additional defensive checks

  • Process behavior. Alert when Node.js starts a shell or tools such as curl, wget, or nc. Monitoring will not detect the memory corruption itself, but it may reveal what an attacker does next.
  • Network indicators. ELLIO published the source address 94.154.43.7 for the exploit attempt and the user agent node2shell-check/1.0 for a separate scanner. These indicators can become outdated quickly.
  • Image inventory. Scan container images and software bills of materials (SBOMs) for bundled Brotli copies. An image pinned by digest may not show its version in the tag.
  • Core dumps. A crashed worker may leave a core dump containing session cookies or keys. Restrict access to these files.

No single check is enough. Combine a version inventory, a review of how data reaches the decoder, and runtime monitoring for a clearer assessment.


Mitigation

  • Upgrade Node.js. Move to 22.23.4, 24.22.1, 26.12.1, or later. The Node.js advisory lists no workaround, so upgrading is the fix. Rebuild and redeploy container images; updating a base image does not patch containers that are already running.
  • Move off end-of-life versions. Node.js 20.x, 23.x, 25.x, and older lines will not be patched. Move affected hosts to a supported release line.
  • Update Brotli in other products. Upgrade Google Brotli to 1.0.10, 1.1.1, or 1.2.1; Python brotli to 1.2.1; brotlicffi to 1.2.1.0; and Bun to 1.4.4. Apply the vendor updates for .NET, PowerShell, Envoy, and Istio if you use them.
  • Install operating system updates. On RHEL, Debian, and Alpine, install the fixed Brotli package. Some distribution builds of Node.js and .NET use the system library. Red Hat marks some Node.js packages as not affected for that reason, but the system library still needs its update.
  • Use temporary controls only while upgrading. Blocking request bodies with Content-Encoding: br at a reverse proxy closes the inbound route. Match the br token exactly, including when it appears in a list such as gzip, br. In Express, express.json({ inflate: false }) rejects all compressed request bodies, including gzip. Neither measure protects outbound fetch() calls. For those, route traffic through an egress proxy that rejects Brotli responses, or disable features that fetch user-supplied URLs.
  • Limit the damage. Run Node.js as an unprivileged user, avoid keeping long-lived secrets in environment variables where possible, and restrict access to cloud metadata endpoints. These steps do not fix the bug, but they can limit what an attacker can reach afterward.
  • Verify the fix. Repeat the version and error-code checks on deployed systems. Check that no pinned image still contains an affected runtime.

Incident Timeline

Key events, from the introduction of the bug to the federal remediation deadline:

  • March 2018: Brotli 1.0.3 is released with the flawed block-switch handling.
  • February 27, 2026: According to ELLIO, the fix is written and merged into Brotli’s public master branch. No release or advisory is published at that time.
  • October 21, 2026: Node.js publishes versions 22.23.4, 24.22.1, and 26.12.1. Google tags Brotli 1.0.10, 1.1.1, and 1.2.1 the same day.
  • October 22, 2026: The GitHub advisory is published. Imperva publishes its Node2Shell analysis, proof-of-concept code becomes public, and fixed Python packages are published to PyPI.
  • October 23, 2026: PyPI advisories for the Python packages are published.
  • October 25, 2026: Microsoft ships out-of-band .NET updates. ELLIO publishes its x86-64 results.
  • October 26, 2026: At 15:08 UTC, ELLIO records the first reported exploit attempt in the wild. Red Hat publishes its security bulletin.
  • October 27, 2026: CISA adds CVE-2026-111497 to its Known Exploited Vulnerabilities catalog, with a remediation deadline of November 10.
  • November 10, 2026: Remediation deadline for U.S. federal agencies under the KEV entry.

The roughly eight-month gap is a key part of this incident. The fix was visible in the public code repository, so someone examining Brotli’s commit history could have found the issue before a fixed release was available.

For vendor-specific information, see the Node.js security release, the Brotli releases page, and the Red Hat bulletin.

Related OffSec Learning

You can practice exploiting this vulnerability in a controlled environment through the OffSec lab CVE-2026-111497. It is available in the Offensive Cyber Range, which is exclusive to Learn Enterprise subscriptions.

The following OffSec resources develop skills for understanding, exploiting, and defending against this type of vulnerability.

ResourceOffSec product / courseWhat you’ll learn
Vulnerability ManagementSEC-100: Cybersecurity EssentialsCore ideas behind memory safety, patching, and vulnerability management.
Server-side Request ForgeryWEB-200: Web Attacks with Kali LinuxHow an attacker-supplied URL can make a server fetch hostile content, the route behind the outbound fetch() exposure.
Stack Overflows and ASLR BypassEXP-301: Windows User Mode Exploit DevelopmentHow memory corruption can lead to code execution, including ASLR bypass and return-oriented programming.
Linux Server Side AttacksSOC-200: Security Operations and Defensive AnalysisHow to identify exploitation attempts and post-exploitation behavior in logs and process telemetry.
Active Incident ContainmentIR-200: Foundational Incident ResponseHow to triage and contain a suspected compromise of an internet-facing service.

Latest from OffSec