Node2Shell: the Node.js Brotli flaw, how to tell if it affects you and what to update
On the same day as PHP2Shell, Node.js shipped the fix for another serious flaw: the Brotli decoder it bundles could write outside its memory and end up running code. Unlike PHP2Shell, not every application is exposed. Here is how to tell whether yours is and what to update.
What happened, in short
- The flaw: CVE-2026-111497, an out-of-bounds write in the Brotli decoder bundled with Node.js. Node.js rates it high and warns that it permits remote code execution.
- The fix: released on October 21, 2026 in 22.23.4, 24.22.1 and 26.12.1. Because the decoder lives inside Node.js, updating your project dependencies is not enough: you have to update Node.js itself.
- Node.js 20 gets no patch: that line reached end of life in April 2026 and does not receive this fix. Neither do 18 or the odd-numbered lines.
- No known attacks yet: there are no reports of real exploitation, but researchers have already achieved code execution in a lab.
Fixed versions
| Line | Update to |
|---|---|
| Node.js 26 | 26.12.1 |
| Node.js 24 | 24.22.1 |
| Node.js 22 | 22.23.4 |
| Node.js 20 and older | No patch: move to 22 or 24 |
| Odd-numbered lines (23, 25) | No patch: move to 22 or 24 |
The same update also fixes three other high-severity flaws from that week, in DNS resolution and TLS certificate checks. One more reason not to put it off.
Is my application exposed?
The flaw triggers when Node.js decompresses Brotli data crafted by an attacker. The key question is whether your application decompresses Brotli coming from someone you do not control:
- Your server accepts compressed requests. With Express 5 or body-parser 2, the middleware decompresses bodies sent with
Content-Encoding: bron its own. Anyone on the internet can send one. - Your app consumes third-party responses. Node.js's built-in
fetch()accepts and decompresses Brotli responses. If you call URLs supplied by users (link previews, webhooks, scrapers) or servers you do not control, a malicious server could send you a crafted response. - Your code uses zlib directly.
zlib.brotliDecompressorcreateBrotliDecompresson user uploads or third-party data. - Low risk: a server that does not decompress request bodies and only calls
fetch()on your own services or trusted APIs. You still need to update, but it is not today's emergency.
How to check in 5 minutes, depending on where it runs
- Servers (EC2, Lightsail, VPS): run
node -vand compare with the table. If you use nvm or several versions, check the one the service starts with, not just your user's. - Containers (ECS, EKS, Docker): look at the base image (for example
node:22-alpine) and the actual version inside the container. An image built before October 21 is still vulnerable even if it says 22: rebuild it and redeploy. - AWS Lambda: on the managed runtimes
nodejs22.xandnodejs24.x, AWS applies security patches for you unless you pinned the runtime version.nodejs20.xreached end of support on April 30, 2026: functions keep running but no longer get Node.js patches. If you use Lambda with a container image, you rebuild it yourself. - Vercel: under Settings, Build and Deployment, Node.js Version. Vercel only offers 22.x and 24.x and applies patches for those lines on its own.
What to do, in order
- 1. Update Node.js to 22.23.4, 24.22.1 or 26.12.1, or later, and restart the service. It is the only complete fix.
- 2. Retire everything still on Node.js 20. Lambda functions on
nodejs20.x,node:20images and old servers: move them to 22 or 24. It is the part people forget. - 3. If you cannot update today, reject request bodies with
Content-Encoding: bron routes that do not need them, at the load balancer, in AWS WAF or in your code. It lowers the risk, but the decoder stays vulnerable until you update. - 4. Watch for odd crashes. If a Node.js process restarts while decompressing data, look into it: it does not prove an attack, but it is the signal to watch.
Frequently asked questions
What is Node2Shell?
It is the name given to CVE-2026-111497: an out-of-bounds write in the Brotli decoder bundled with Node.js. With crafted compressed data it can end in code execution on the server. Node.js fixed it on October 21, 2026.
Which Node.js versions fix it?
22.23.4, 24.22.1 and 26.12.1, or any later release in those lines. Node.js 20, 18 and the odd-numbered lines no longer get patches: move to 22 or 24.
Is my application exposed?
It depends on whether it decompresses Brotli that someone else sends: request bodies with Content-Encoding: br that your server or middleware decompresses, responses from servers you do not control, or uploaded files you decompress with zlib. If your app only talks to its own or trusted services, the risk is low, but you still need to update.
Is it being exploited?
As of October 23, 2026 there are no reports of real attacks. Researchers reproduced code execution in a lab, so it is worth updating without waiting for them.
If you run Lambda functions, containers or servers with Node.js on AWS and do not know which version each one is on, we can help: we take the inventory in your account with read-only access and tell you what to update first.
Request the version reviewSources
- Node.js: October 2026 security releases ↗
- CVE Playground: Node2Shell explained ↗
- Konfirmity: Node.js security release summary ↗
- AWS Lambda: runtimes and end-of-support dates ↗
- Vercel: supported Node.js versions ↗
Information verified on October 23, 2026.