Node.js Brotli RCE (CVE-2026-111497): What Happened and How to Patch
Node.js · Security · npm
On October 21, 2026 the Node.js team released security fixes for the 22.x, 24.x and 26.x lines, covering 10 CVEs. The most serious, CVE-2026-111497, is an out-of-bounds write in the Brotli decoder that the advisory says permits remote code execution. The advisory lists no workaround, so the only fix is to update Node.
This post covers what was fixed, how to check if you're exposed, and how to patch your projects and keep an unpatched Node from coming back.
Read more on https://rusu-ionut.ro/blog/node-js-brotli-rce-cve-2026-111497-what-happened-and-how-to-patch
TL;DR
- Update to Node 22.23.4, 24.22.1 or 26.12.1 (or newer).
- There is no workaround for the Brotli bug.
- The advisory doesn't mention Node 20, but it says end-of-life versions are always affected. If you're on one, plan a move to a supported line.
- Add an
engines range to package.json so an unpatched Node gets flagged.
What was fixed
Four High, three Medium and three Low severity issues:
| CVE | Severity | What it is | Lines |
| CVE-2026-111497 | High | Brotli decoder out-of-bounds write permits remote code execution | 22, 24, 26 |
| CVE-2026-105482 | High | dns.resolve truncates names containing a NUL character | 22, 24, 26 |
| CVE-2026-105483 | High | TLS hostname bypass when an IP is written with fullwidth digits | 24, 26 |
| CVE-2026-106069 | High | TLS hostname bypass when a host loosely resolves to an IP | 22, 24, 26 |
| CVE-2026-105481 | Medium | Keep-alive socket processes a response written before the request was sent | 22, 24, 26 |
| CVE-2026-106072 | Medium | Non-canonical IPv4 hostnames let DNS SANs authenticate IP endpoints | 22, 24, 26 |
| CVE-2026-106074 | Medium | crypto.randomUUID() / randomInt() entropy caches saved into startup snapshots repeat the same values | 22, 24, 26 |
| CVE-2026-106070 | Low | ZipFile returns attacker-controlled prefix bytes after failed header validation | 26 |
| CVE-2026-106071 | Low | Permission Model filesystem over-grant via wildcard radix lookup | 26 |
| CVE-2026-106073 | Low | Permission Model bypass with fs.realpathSync | 22, 24, 26 |
The same releases also update bundled dependencies (c-ares, OpenSSL, Undici and others).
Why the Brotli bug is the one to care about
Brotli is a compression format. Node decodes it in several places you may not think about:
fetch() decodes responses sent with Content-Encoding: br.
- Express 5's body parser (
body-parser 2.x) decodes Brotli request bodies by default.
axios asks for Brotli by default.
- Any direct
zlib Brotli decompression call.
Browser JavaScript uses the browser's own decoder, and code that only compresses with Brotli isn't the entry point. The trigger is described as a malformed Brotli stream. Reports on public proof-of-concepts disagree about whether it works against a standard build, and one tracker says no exploitation in the wild had been reported as of October 22. I wouldn't wait to find out: update.
Step 1: check what you're running
node -v
You want 22.23.4+, 24.22.1+ or 26.12.1+. There's also a direct check. The fix adds a decoder error constant, so this prints true only on a patched Node (tested on 24.21.0 → false and 24.22.1 → true):
node -p "'BROTLI_DECODER_ERROR_FORMAT_BLOCK_SWITCH' in require('zlib').constants"
Check every place Node runs: your laptop, CI, Docker base images, and your hosting runtime.
Step 2: update
With nvm:
nvm install 24 # installs the newest 24.x (24.22.1 or later)
nvm alias default 24
nvm use 24
Two traps to watch for:
- An already-open terminal keeps the old Node until you run
nvm use 24.
- Docker and CI need a rebuild on a patched base image (
docker build --pull --no-cache .). Managed runtimes (Firebase, Vercel and similar) choose the patch version for you, so check your provider rather than assuming.
Step 3: stop an unpatched Node from sneaking back in
Updating your machine fixes your machine. To protect the project, declare which Node versions it supports with an engines field in every package.json (root, server, workspaces):
{
"engines": {
"node": ">=22.23.4 <23.0.0 || >=24.22.1 <25.0.0"
}
}
npm also mirrors it into the lockfile's root entry (packages[""].engines). Here's what that range does:
| Node version | Result |
| 22.23.3 | flagged |
| 22.23.4 | allowed |
| 24.21.0 | flagged |
| 24.22.1 | allowed |
| 26.12.1 | flagged, because it isn't in this range |
If you run the 26 line, add || >=26.12.1 <27.0.0.
By default npm only warns (EBADENGINE) and keeps installing:
npm warn EBADENGINE Unsupported engine {
npm warn EBADENGINE required: { node: '>=22.23.4 <23.0.0 || >=24.22.1 <25.0.0' },
npm warn EBADENGINE current: { node: 'v24.21.0', npm: '12.2.0' }
npm warn EBADENGINE }
To make it a hard failure, add this to .npmrc:
engine-strict=true
Step 4: make sure your dependencies accept the patched Node
Before tightening the range, check that no installed package refuses the patched version. Save this as scan-engines.cjs in your project root (it needs semver, which most projects already have in node_modules; otherwise npm i -D semver):
// node scan-engines.cjs 24.22.1
const fs = require("fs");
const path = require("path");
const semver = require("semver");
const target = process.argv[2];
const rejected = [];
let checked = 0;
function scan(dir) {
if (!fs.existsSync(dir)) return;
for (const name of fs.readdirSync(dir)) {
const full = path.join(dir, name);
if (name.startsWith("@")) { scan(full); continue; }
const manifest = path.join(full, "package.json");
if (!fs.existsSync(manifest)) continue;
const { name: pkg, version, engines } = JSON.parse(fs.readFileSync(manifest, "utf8"));
if (!engines?.node) continue;
checked++;
if (!semver.satisfies(target, engines.node)) rejected.push(`${pkg}@${version} needs ${engines.node}`);
}
}
scan(path.resolve("node_modules"));
console.log(`${checked} packages declare engines.node`);
console.log(rejected.length ? rejected.join("\n") : `none reject Node ${target}`);
If it lists any packages, check whether a newer version of each supports the patched Node before you tighten the range.
Checklist
- [ ]
node -v shows a patched version on every machine, CI runner and container
- [ ] Docker images rebuilt with
--pull --no-cache
- [ ] Hosting runtime confirmed with your provider
- [ ]
engines.node set in every package.json (and mirrored in the lockfile)
- [ ] Optional:
engine-strict=true in .npmrc
- [ ] Dependencies checked against the patched Node
Sources