Latest

Cybersecurity

Node2Shell: the Brotli flaw that forces half the stack to be patched

The Brotli out-of-bounds write, CVE-2026-111497, leaves code execution possible in Node.js and forces binaries and containers to be rebuilt.

Node2Shell: the Brotli flaw that forces half the stack to be patched
Node2Shell: the Brotli flaw that forces half the stack to be patched

A malformed Brotli stream, an error the decoder mistook for a request for more data, and eight bytes of internal buffer that were no longer enough. That is the mechanism behind Node2Shell, the flaw that for five days has forced binaries to be rebuilt across half of the web infrastructure. The out-of-bounds write lives in Google's Brotli decoder and was logged as CVE-2026-111497, with a CVSS v4 score of 9.2 and remote exploitation without credentials.

The name was coined by the team that on October 22 turned the bug into code execution on an unmodified official Node.js image, a day after the runtime published its patches. The surface is wider than the nickname suggests: Brotli 1.0.3 to 1.2.0 ships inside Node.js and inside the Python bindings, inside the Envoy and Istio proxies of service meshes and even inside Firefox. Akamai telemetry puts at 61% the networks still running affected versions of Node.js.

The awkward part comes when patching. Updating the system library does not touch the copy a runtime compiled into its binary, so real remediation requires restarting processes and rebuilding containers, Python wheels and packaged executables. Any service that decompresses request bodies or third-party responses has reason to start there.

A format error treated as missing data

The Brotli decoder switches blocks while decompressing, and that jump depends on a function that in vulnerable versions only returned true or false. The problem is that a false meant two things at once: that the stream was malformed or that more bytes were needed. When the stream requested an impossible block switch, the decoder chose the second reading and kept working with a state that was no longer valid.

The decompression loop then appended the incoming bytes to an internal buffer of eight slots and wrote past the end. From that point the corruption does not affect the format but the memory of the process doing the decompressing.

The fix published in Brotli 1.2.1 on October 21 does exactly the opposite of the vulnerable code: it returns its own error, `BROTLI_DECODER_ERROR_FORMAT_BLOCK_SWITCH`, with the value -17, and stops decompression at the first invalid block. Node.js applied that same patch to its embedded copy across the three supported branches, and from there comes the inventory problem that eats up half an afternoon for any platform team.

Who carries their own copy and which version closes it?

The affected ranges do not match the version numbers of the products that inherit them, and that gap is what breaks automated inventories. A scanner reads the version of the package that appears in the dependency manager, not that of the native code that package compiled in.

Component Affected versions First fixed version
Brotli (C, upstream) 1.0.3 to 1.0.9, 1.1.0 and 1.2.0 1.0.10, 1.1.1 and 1.2.1
Node.js 26.x, 24.x and 22.x prior to the patch, plus unsupported branches 26.12.1, 24.22.1 and 22.23.4
Python `brotli` up to 1.2.0 1.2.1
`brotlicffi` up to 1.2.0.2 1.2.1.0
Bun 1.0.21 to 1.4.3 1.4.4
Envoy deployments with the Brotli decompressor enabled 1.40.0, 1.39.3, 1.38.6 or 1.37.8
Istio meshes with Brotli decompression enabled 1.31.2 or 1.30.6

Dates matter almost as much as the figures. Node.js published its three versions on 21 October, PyPI received `brotli` 1.2.1 and `brotlicffi` 1.2.1.0 the following day, and Bun closed the gap in 1.4.4. Anyone searching the advisories for Node2Shell Brotli will also find the aliases HTTP2Shell, Broccoli2Shell and Brotli2Shell, which different teams added to the same identifier as they confirmed the flaw was not confined to one runtime.

What has been demonstrated, what is disputed and what is not on record

Code execution is not a closed laboratory hypothesis. Imperva's red team managed to execute commands in the official Node.js 24.22.0 image for Linux arm64, both in a response the application downloaded with `fetch()` and in a request body that Express 5 decompressed on its own. Version 24.22.1 rejected the same data with a format error.

The scope deserves qualification. Imperva needed several attempts, has not published its exploit, and the public PoC circulating since 22 October causes crashes and limited memory reads on standard builds.

Red Hat rates the flaw as important and assigns it a CVSS v3.1 score of 8.1, on the grounds that there is no public, reliable proof of remote execution. Denial of service, by contrast, is within reach of anyone able to send a request. The original advisory mentions process crash, reading of foreign memory and arbitrary code execution without ruling out any of the three.

No attacks in production have been reported, and CISA's catalog of exploited vulnerabilities did not include the flaw on 24 October. JFrog reproduced a ClickHouse hang with a 23 MB body sent with `Content-Encoding: br`, and the fix remains in the repository with no published release.

What else needs fixing besides the system library

Decompressing third-party data is the condition that makes the flaw matter, and in Node.js that condition arrives through paths almost nobody audits. The built-in `fetch()` decompresses Brotli responses without asking, so a hostile server can attack the client querying it. Express 5 and body-parser 2 accept bodies with `Content-Encoding: br` because the `inflate` option is enabled by default.

If you cannot patch today, the way out is to cut the path. A proxy or WAF that rejects `br` in incoming requests removes the entry vector, and `express.json({ inflate: false })` closes it inside the code itself. Neither measure protects the outbound path, because removing `br` from `Accept-Encoding` does not stop a malicious server from sending Brotli anyway.

The inventory is the hard part, and the pattern repeats outside this flaw. When browsers blocked eight eMudhra intermediates, each operator had to work out on their own which chains depended on them; the Indian company announced its withdrawal from the global SSL/TLS business on October 22 with the same underlying logic, a trust component that no one was keeping track of.

Updating the package on the laptop does not change the image that was deployed last week. Running processes keep the old code until they are restarted, and binaries that bundle the runtime on their own, including Bun builds, carry their own copy and must be regenerated with the fixed version.

Two “Shell” flaws in two days and the same lesson

The calendar refutes the idea that this is a run of bad luck. php2shell was also closed on October 21, the same day Node.js published its patches, and the name Node2Shell appeared the following day. Two memory flaws in two pieces of infrastructure that no team would inventory separately, with the difference that the PHP one lived in the engine itself and this one lives in a library that several languages compile into their binaries.

What is left for system administrators is not a list of CVEs. If the next flaw lands in the copy of OpenSSL that a runtime carries, the system patch will arrive too late. A prepared team knows which version of Brotli travels inside its processes.

José Maldonado

Author

José Maldonado

Activist and blogger on technology, free software and blockchain.

The latest
From Huang to Botín, from Zara to Byron: corporate responsibility in global capitalism

Keep reading