Most Node.js security advice is about your code: validate input, avoid eval, keep npm audit clean. CVE-2026-111497 is different. The bug is in a C++ library bundled inside the Node.js runtime itself. Your JavaScript can be flawless, your dependencies fully patched, and you can still be exposed, because the vulnerable code runs when Node decompresses data, before your logic ever sees it.
This note is written for developers and students. It explains what was disclosed, how this class of bug works (with simplified code), what failure looks like in real systems, and the exact steps to fix and verify. It reflects what was public on 23 October 2026. Details were still thin and moving, so always check the official Node.js post linked at the end.
Reading time: about 12 minutes.
What is CVE-2026-111497, in one paragraph
On 21 October 2026 the Node.js project shipped security releases for all three supported lines. One of the ten fixes, CVE-2026-111497, is titled “Node.js Brotli decoder out-of-bounds write permits remote code execution” and is rated High by Node.js. The flaw is in the Brotli decoder: when it processes specially crafted compressed input, it can write outside the memory it should. Memory corruption like this is the classic starting point for remote code execution (RCE).
| CVE | CVE-2026-111497 |
| Component | Brotli decoder bundled in Node.js |
| Bug class | Out-of-bounds write (memory corruption) |
| Severity | High (Node.js rating). A third-party tracker lists CVSS 8.1; Node.js itself published no CVSS score |
| Affected | Node.js 22.x, 24.x and 26.x before the fixed releases below |
| Workarounds | None published. Update. |
| Reported by | OpenAI Codex Security (Khai Tran, Sylvie Mayer); fixed by Matteo Collina and Antoine du Hamel |
Be honest about what is known. The official notice gives the title, severity and credits, but no exploit details, no proof-of-concept and no list of exact code paths. Treat any blog (including this one) that claims more with suspicion. The code-level section below explains the bug class with a teaching sketch, not the real patch.
Why this one is different
Three things make it worth your attention:
- The data is untrusted by nature. Anything compressed that comes from outside, such as an API response, an uploaded file or a proxied download, has to be decoded by someone.
- It is in the runtime.
npm auditchecks packages innode_modules. It cannot see a flaw inside the Node.js binary itself. - It is memory corruption in native code. JavaScript is memory-safe. The C++ underneath it is not.
At the time of writing, the project reported no known exploitation in the wild, and I could not find a confirmed public proof-of-concept. That is a reason to patch calmly and quickly, not a reason to wait.
What is Brotli, and where does Node.js use it?
Brotli is a compression format created by Google, widely used on the web (Content-Encoding: br). It usually compresses text better than gzip, which is why CDNs and browsers love it.
Node.js ships it and exposes it in a few ways:
const zlib = require('node:zlib');
// 1. Explicit use: you decompress bytes yourself
zlib.brotliDecompress(inputBuffer, (err, out) => { /* ... */ });
// 2. Streaming
req.pipe(zlib.createBrotliDecompress()).pipe(destination);
// 3. Implicit use: HTTP clients that auto-decode responses
const res = await fetch('https://partner.example/api/report'); // may answer with br
const data = await res.json(); // decoded for you
If your app never decodes Brotli, your direct exposure is lower. But many apps decode it without the developer writing a line: HTTP clients and proxies do it for them. Do not try to prove you are safe. Patch.
How an out-of-bounds write works (simplified, code level)
The real fix is in the Brotli C/C++ code and the project has not published the exact faulty line. So here is a teaching sketch of the bug class, not the actual code. The idea is the same one students meet in every systems course.
A decoder reads instructions from compressed input and writes output to a buffer. The danger is trusting a number that came from the attacker:
// Simplified sketch of the bug CLASS. NOT real Brotli or Node.js source.
uint8_t out[4096]; // fixed-size output buffer
size_t pos = 0; // how much we have written so far
void decode_copy(const uint8_t *input) {
size_t length = read_length(input); // <- comes from the ATTACKER
size_t distance = read_distance(input); // <- comes from the ATTACKER
// Copy `length` bytes from earlier output to the end of the output.
for (size_t i = 0; i < length; i++) {
out[pos + i] = out[pos - distance + i];
// ^ BUG: nothing checks that pos + length <= sizeof(out)
}
pos += length;
}
If an attacker sets length larger than the space left, the loop keeps writing past the end of out into whatever lives next to it in memory.
The fix for any bug of this class is the same idea, a bounds check before every write:
// The pattern a fix typically follows (sketch, not the actual patch)
if (length > sizeof(out) - pos) {
return DECODE_ERROR; // refuse malformed input instead of trusting it
}
Student takeaway: JavaScript protects your code from this whole family of bugs. But the engine and libraries beneath it are written in C and C++, and a single missing
ifin a decoder can matter more than a thousand lines of careful JavaScript. Untrusted input + native parser = high-value target.
Real-world failure scenarios
These are illustrative composites, built from how the advisory describes the flaw and from mistakes teams routinely make. They are not reports about specific companies.
Scenario 1: “We ran npm audit, it’s clean”
A team’s pipeline blocks releases on npm audit findings. This week it reports zero issues, so everyone assumes they’re safe. But the vulnerable code is in the Node.js binary, not in node_modules.
Fix: track the runtime version as its own asset, with its own check in CI (see the guard script below).
Scenario 2: The integration that calls a partner API
A backend fetches daily reports from a partner’s API. The partner (or something between you and them, such as a compromised proxy) replies with Content-Encoding: br, and fetch decodes it automatically. Your code never mentions Brotli, yet a hostile response reaches the decoder.
Fix: patch the runtime. Treat responses from any third party as untrusted input, even “partners”.
Scenario 3: The container nobody rebuilt
A Dockerfile says FROM node:22. The image was built in September and sits in a registry. A patched base image now exists, but production keeps running the old build because nothing triggers a rebuild.
Fix: rebuild with --pull, redeploy, and check node -v inside the running container.
Scenario 4: Patched the package, not the process
An admin upgrades Node via the OS package manager. The old process keeps running in memory, still on vulnerable code, for weeks. A scanner says “patched”, the running process says otherwise.
Fix: restart or redeploy every process, then verify the running version.
Scenario 5: The end-of-life line
An internal tool runs on Node.js 20, because “it works”. Node.js 20 reached end of life in April 2026 and gets no fix for this CVE. The tool is reachable from the internet through a customer portal.
Fix: upgrade to a supported line. There is no patch to wait for.
Scenario 6: The single-file executable
A CLI tool was bundled with Node.js into a single executable and shipped to customers. Even after you upgrade your servers, every copy in the field still contains the old runtime.
Fix: rebuild and re-release the executable. A runtime fix only helps if it is in the artifact you ship.
Which Node.js versions are safe?
“Safe” means at or above the fixed release for your line:
| Node.js line | Safe version | Status |
|---|---|---|
| 26.x | 26.12.1 or newer | Fixed |
| 24.x | 24.22.1 or newer | Fixed |
| 22.x | 22.23.4 or newer | Fixed |
| 25.x, 23.x, 21.x | None | End of life, no fix. Move to 22, 24 or 26 |
| 20.x and older | None | End of life, no fix. Upgrade |
Caveats worth knowing:
- Linux distributions backport fixes under old version numbers. A Debian, Ubuntu or RHEL package may show an older number and still be patched. Check the vendor security notice or changelog.
- Builds linked to a system Brotli (rather than the bundled copy) depend on that system library being updated too.
node -von your laptop says nothing about the server, the container or the CI runner. They are different installs.- Releases for each line were due “on or shortly after” 21 October. Confirm the version exists for your line before pinning to it.
What to do today: a prevention playbook
Step 1: Find every Node.js you run
# What your shell uses (may NOT be what serves production)
node -v
node -p "process.versions.node + ' (brotli ' + process.versions.brotli + ')'"
# Inside a running container
docker exec <container> node -v
# Kubernetes: version in every running pod
kubectl get pods -o name | xargs -I{} kubectl exec {} -- node -v
# Debian/Ubuntu: was the fix backported?
apt changelog nodejs | grep -i "CVE-2026-111497"
Also check places that quietly embed their own Node: CI runners, serverless runtimes, Electron apps, single-executable builds, and hosting platforms with a pinned runtime setting.
Step 2: Upgrade to a fixed release
# nvm
nvm install 24 && nvm alias default 24 # then confirm >= 24.22.1
# Docker: pull the new base image and rebuild without cache
docker build --pull --no-cache -t myapp:node-patched .
In your Dockerfile, follow your line and rebuild on a schedule, so you are not relying on someone remembering:
FROM node:24-slim # follow the line; rebuild weekly in CI
# Or pin an exact fixed release, then bump it deliberately:
# FROM node:24.22.1-slim
Step 3: Restart every process
Upgrading the binary does not touch processes that are already running.
sudo systemctl restart myapp
pm2 reload all
# Containers / Kubernetes: redeploy so the pods are replaced
kubectl rollout restart deployment/my-app
Step 4: Verify the running version, and automate it
A guard you can run in CI, in a health check, or at startup so a stale runtime is obvious:
// check-node-version.js: fail if Node.js is below the fixed release for its line
const fixed = { 22: '22.23.4', 24: '24.22.1', 26: '26.12.1' };
const [major] = process.versions.node.split('.').map(Number);
const need = fixed[major];
if (!need) {
console.error(`Node ${process.version} has no official fix. Move to 22, 24 or 26.`);
process.exit(1);
}
// Compare "major.minor.patch" numerically, left to right
const cmp = (x, y) => {
const [a, b] = [x.split('.').map(Number), y.split('.').map(Number)];
for (let i = 0; i < 3; i++) if (a[i] !== b[i]) return a[i] - b[i];
return 0;
};
if (cmp(process.versions.node, need) < 0) {
console.error(`Node ${process.version} is vulnerable to CVE-2026-111497. Need >= ${need}.`);
process.exit(1);
}
console.log(`OK: Node ${process.version}`);
A distro build with a backported fix reports an older number, so this script can false-alarm there. For those machines, trust the vendor advisory.
Step 5: Review exposure and logs
There is no confirmed exploitation, but a runtime RCE is worth a quick look:
- unexplained crashes or restarts of Node processes (segfaults,
SIGSEGV, “double free” in logs), - unusual outbound connections from your app servers,
- new or modified files, cron jobs or accounts on the host,
- repeated requests with odd
Content-Encodingheaders or malformed compressed bodies.
If something looks wrong, preserve the logs first, then rotate secrets (database passwords, API keys, .env values) on that host.
If you cannot upgrade right now: reduce exposure
Node.js has published no workaround, and none of these makes an unpatched server safe. They only shrink the attack surface while you schedule the real fix.
// 1. Don't accept Brotli from clients you don't need it from
app.use((req, res, next) => {
if (/\bbr\b/i.test(req.headers['content-encoding'] || '')) {
return res.status(415).send('Unsupported content encoding');
}
next();
});
// 2. When you DO decode explicitly, bound the output (good hygiene, also stops
// decompression bombs). It is NOT a fix for this memory bug.
zlib.brotliDecompress(input, { maxOutputLength: 5 * 1024 * 1024 }, cb);
# 3. Strip Brotli request encodings at the edge, and keep bodies small
client_max_body_size 8m;
if ($http_content_encoding ~* "br") { return 415; }
Other practical notes:
- Ask upstream services and proxies not to send
brto you if you can (Accept-Encoding: gzip). - Take unpatchable, internet-facing workloads off the public internet.
- A WAF rule can help against known patterns, but only for traffic that passes through it.
Defense in depth: reduce the blast radius for next time
This will not be the last runtime bug. Make the next one less painful:
- Run Node as a low-privilege user, never root. The attacker gets only what that user can do.
- Use minimal, rebuilt-often images (
-slim, distroless) with a read-only root filesystem. - Keep secrets out of the process environment where possible. Use a secret manager with short-lived credentials.
- Limit egress: an API server rarely needs to call arbitrary internet hosts.
- Isolate: one service per container, so one compromise does not spread.
- Patch SLAs: high-severity runtime CVEs within 24 to 72 hours, with a named owner.
- Automate rebuilds and version checks (Renovate or Dependabot for the base image, plus the guard script above).
- Track the runtime in your SBOM and your vulnerability scanner, not just
package.json.
A ten-point checklist
- Listed every place Node.js runs (servers, containers, CI, serverless, desktop apps).
- Identified the line for each: 22, 24, 26 (fixed releases exist) or older (no fix).
- Upgraded to 22.23.4 / 24.22.1 / 26.12.1 or newer, or confirmed the vendor backport.
- Rebuilt container images with
--pulland redeployed. - Rebuilt and re-shipped any single-executable or bundled-runtime artifacts.
- Restarted or redeployed every process.
- Verified the running version, not just the installed package.
- Scheduled migration for any app on an end-of-life line.
- Reviewed logs for crashes, odd outbound traffic and unexpected files.
- Added a runtime version check and weekly image rebuilds to CI.
Key takeaways
- CVE-2026-111497 is a High-severity out-of-bounds write in the Brotli decoder bundled with Node.js, which Node.js says can permit remote code execution.
- It lives in the runtime, so
npm auditwill not find it, and your input validation does not run before it. - Safe versions: Node.js 22.23.4, 24.22.1, 26.12.1 or newer. Node.js 20 and older, and odd-numbered lines such as 25 and 23, get no fix.
- Patching is not finished until processes are restarted and the running version is verified.
- No workaround exists. Output limits and header filtering reduce risk but do not replace the update.
- The same release fixed nine other CVEs, so this upgrade is worth doing even if you never touch Brotli.
If you only do one thing today, run node -v on the thing that actually serves your traffic, and compare it with the table above.
Sources and further reading
- Node.js: October 2026 security releases (official)
- Konfirmity: Node.js October 2026 security releases (CVE list and version table)
- Patchstack: Node.js < 22.23.4 RCE (bundled Brotli note and CVSS 8.1 from a third party)
- SecurityOnline: Node.js security release, October 2026
The official notice published few technical details at the time of writing. The bug-class code in this article is a simplified teaching sketch, not the real patch, and some secondary sources list slightly different CVE numbers or severities. Treat the official Node.js post and your distribution’s security notices as the source of truth, and re-check them before acting.