Node2Shell: The Brotli Flaw in Node.js
A flaw in the Brotli decoder bundled with Node.js can crash servers or run code. Fixed 21 Oct 2026 — here is who is exposed and how to check.
27 Oct 2026 · 6 min read · Hazentic Quantum
Update (27 October 2026): CISA has added CVE-2026-111497 to its Known Exploited Vulnerabilities (KEV) catalogue, based on evidence of active exploitation — federal agencies were ordered to patch by 10 November 2026 under Binding Operational Directive 26-04. Exploit traffic was observed in the wild from 26 October 2026. The original statement in this article that there was "no confirmed exploitation in the wild" was correct at publication and is no longer correct. Source: CISA alert
Node2Shell is the nickname for CVE-2026-111497, a flaw in the Brotli decoder bundled with Node.js that can crash a server, leak process memory, or run attacker code. Node.js rates it High; Google, as the CVE numbering authority, scores it 9.2. It was fixed on 21 October 2026 in Node.js 26.12.1, 24.22.1 and 22.23.4. If your team runs Node.js anywhere, find every runtime, not just your laptop's, and update it.
What Brotli is, and what broke
Brotli is Google's algorithm for shrinking text-based web content — HTML, CSS and JavaScript — so pages load faster. When one side says it accepts Brotli, the other sends compressed data, and the receiver decompresses it first.
The bug is an out-of-bounds write in the decoder itself. A crafted stream tells the decoder to switch block types in a way it should refuse. The old decoder reported "I need more input" instead of "this stream is broken", kept appending input into a small internal buffer, and wrote past the end of it. Writing past a buffer corrupts nearby memory, and a careful stream can steer that into code execution.
The same decoder library is bundled into many products — Bun, .NET and PowerShell also shipped fixes — but for a Node.js team the point is narrower: the flaw is a property of the Node.js binary, not of any npm package, so only updating the runtime fixes it. PHP had its own critical flaws fixed the same week — see PHP2Shell: two critical PHP flaws.
How it reaches you
Most teams do not think of themselves as "decompression code" — exactly why this flaw has a wide blast radius. Node.js runs its bundled decoder in three kinds of places:
- Explicitly, through the node:zlib Brotli APIs, when your code decompresses data on purpose.
- Implicitly, through the built-in fetch, which transparently decodes responses sent with Content-Encoding: br. If your server-side code fetches a URL and the response comes back Brotli-compressed, your process decompresses it without you writing a line of decompression code.
- Implicitly, through body-parsing middleware that inflates compressed request bodies. Express 5's body-parser and HTTP client libraries such as axios, got and node-fetch were named as representative exposure paths.
So the exposed set is not "apps that use Brotli" but "apps that decompress data they do not control" — for a typical web API, most of them.
Who is exposed, and who is not
You are exposed if you run an unpatched Node.js 22, 24 or 26 build in anything that decompresses untrusted data — which, given fetch and body parsers, covers most production Node.js services. You are also exposed if Docker images, CI runners or serverless runtimes pin an old Node.js version, even if your laptop is current.
You are probably not exposed only if your process never decompresses Brotli data from untrusted sources and never fetches remote URLs — a narrow set, mostly batch jobs with no network input. Do not guess: check what your app actually does first.
Two cautions. Code execution has been demonstrated, but only narrowly: Imperva showed it on the official Node.js 24.22.0 image for Linux arm64, after several attempts, and has not released its exploit code, while early public proof-of-concept code crashed vulnerable versions. And as of the reports checked on 26 October 2026, no confirmed exploitation in the wild had been reported, and the CVE was not in CISA's Known Exploited Vulnerabilities catalogue. A crash-on-demand bug in your request parser is still not acceptable to leave unpatched.
How to check everywhere
Check every place, not just one:
1. Every server: run node -v on each machine running your app, not just your laptop. If you use PM2, check which binary PM2 actually uses. 2. Every Dockerfile and base image: search for node:22, node:24, node:26 and floating tags like node:lts. Pin to a fixed release: 22.23.4, 24.22.1 or 26.12.1, or later. 3. CI runners and preview environments: these often lag production and get forgotten. 4. Serverless and platform runtimes: check what the platform pins, and whether you control it. 5. End-of-life lines: Node.js 20 and older have no official fix. If still on one, your options are a vendor build that backports the fix, or an upgrade to a supported line. Node.js 24 moved to Maintenance LTS on 20 October 2026 and Node.js 26 becomes Active LTS on 28 October 2026, so 24 or 26 are the sensible destinations.
Note: npm audit checks packages, not the runtime. A clean audit says nothing about this flaw.
The upgrade path
Update the runtime to 26.12.1, 24.22.1 or 22.23.4 (or later), rebuild your containers, and redeploy. The same release also fixed TLS and DNS issues — one more reason to take the whole release.
After upgrading, confirm the new version is actually running — node -v in production and the image tag in your deployment.
What to do this week
- Inventory every Node.js runtime: servers, Docker images, CI runners, platform runtimes.
- Update each to 26.12.1, 24.22.1 or 22.23.4 or later, and rebuild containers.
- Verify the running version in production, not just in the build log.
- Plan the move off any end-of-life Node.js line still in production.
- Add the runtime version to your regular patch checklist, next to npm audit, so the next runtime flaw does not wait for someone to remember it.
If you want someone to run this checklist against your app, our custom web apps work includes Node.js reviews and hardening — see our work — or contact us and send us your stack. For the wider set of Node.js threats beyond this one flaw, see Node.js threats in production.
FAQ
Is Node2Shell a problem in my npm packages?
No. The flaw is in the Brotli decoder compiled into the Node.js binary; the npm package named brotli is a separate project, not the vulnerable component. Updating packages helps in general, but does not fix this.
My app does not use Brotli. Am I safe?
Probably not automatically: built-in fetch decodes Brotli responses on its own, and body parsers inflate compressed request bodies, so most web services decompress data they do not control without realising it. Check your actual request paths before deciding.
How hard is it to exploit in practice?
Harder than the headlines suggest, easier than comfortable: public proof-of-concept code initially crashed vulnerable versions, and demonstrated code execution covers one official build so far. Treat it as patch-now, not theoretical.
We are on Node.js 20. What do we do?
Node.js 20 reached end of life on 30 April 2026 and gets no official fix. Move to 24 or 26, or use a vendor build that backports the fix — and do not leave an unpatched runtime facing the internet.
Let’s find your bottleneck.
Tell us what is slowing the business down. We reply within one business day — with an honest answer, even if we are not the right fit.
Free website teardown · contact@hazenticquantum.com