Out-of-bounds write (CWE-787) with an unchecked return value (CWE-252) in the bundled Brotli decoder. A crafted stream drives the decoder to write past its buffer. Node.js rates it High; Google scores it 9.2.
The flaw lives in Google’s Brotli library (c/dec/decode.c), versions 1.0.3–1.2.0. Anything that bundles it is in scope — including Bun (through 1.4.3) and standalone Brotli users.
01Executive Summary
On 21 October 2026, the Node.js project shipped emergency security releases fixing CVE-2026-111497, which researchers named Node2Shell. The flaw is an out-of-bounds write in the Brotli decompression library that Node.js bundles — it is not a bug in Node.js’s own code. It was reported by OpenAI Codex Security researchers Khai Tran and Sylvie Mayer. Google, the CVE numbering authority, scores it CVSS v4.0 9.2 (Critical); the Node.js project rates it High.
Shortly after the patch, the Imperva Red Team publicly demonstrated code execution against the official node:24.22.0 Docker image on Linux arm64. The ceiling is remote code execution; the floor — and the far easier outcome — is a reliable crash (denial of service) and memory disclosure. Because Brotli decoding sits behind common framework defaults, the reachable surface is large.
Node.js powers a huge share of modern backends, APIs and build tooling. Brotli (br) is a mainstream content encoding, and decoding it is often automatic: Express 5’s express.json() decompresses br request bodies by default, and Node’s built-in fetch() auto-decompresses br responses. An attacker who can get your service to decode Brotli data they control — a request body, or a response from a server they influence — can reach the bug without any application-level vulnerability.
02What the Vulnerability Is
| Attribute | CVE-2026-111497 — Node2Shell |
|---|---|
| Type | Out-of-bounds write (CWE-787) via an unchecked return value (CWE-252) in the Brotli decoder |
| Component | Google Brotli library (c/dec/decode.c), bundled by Node.js — not Node.js core code |
| Impact | Denial of service (crash) and memory disclosure reliably; remote code execution demonstrated in a narrow setup |
| CVSS v4.0 | 9.2 (Critical) per Google; Node.js rates it High; Debian marks its nodejs entry “unimportant” |
| Reachability | Any code path that Brotli-decompresses attacker-controlled data (request bodies, fetch() responses, direct zlib use) |
| Exploited in wild | None confirmed as of 23 Oct 2026; not in CISA KEV; public PoCs appeared within ~a day of the patch |
2.1 The root cause: a block-switch the decoder should have rejected
Brotli streams are built from blocks, and a stream header declares how many block types it uses. The vulnerability is a parsing-state bug: a crafted stream declares only one block type and then asks the decoder to switch block type anyway. A correct decoder treats that as malformed and stops with an error. The unpatched decoder ignores the error return and keeps processing — Semgrep describes it as the decoder confusing incomplete input with invalid input. Continuing past that point lets the decoder write past the end of its output buffer, corrupting adjacent memory.
The upstream fix (Brotli commit 0ed4268a) makes the decoder fail immediately on a block switch when the stream declared a single block type; Node.js surfaces this as the new error constant BROTLI_DECODER_ERROR_FORMAT_BLOCK_SWITCH. In other words, the fix restores the check that should have halted the malformed stream.
2.2 Where it is reachable
Exposure depends on whether your code — or a dependency — decompresses Brotli that an attacker can shape. The common paths:
- Express 5 + express.json() — exposed by default. Express 5 pulls in body-parser ^2.x, which decodes br request bodies with inflation on.
- Express 4 + express.json() — not exposed via body-parser 1.20.x, which handles only deflate/gzip and returns 415 for br.
- Server-side fetch() — exposed when the response comes from a server an attacker can influence; it auto-decompresses Content-Encoding: br. Sending Accept-Encoding: identity does not reliably prevent it.
- Direct node:zlib — createBrotliDecompress() / brotliDecompress() on attacker-controlled data.
- Koa (via co-body), @koa/bodyparser, koa-body, Egg, Strapi, and Fastify with @fastify/compress (decompression runs before content-type parsing).
- A bare Node HTTP server does not decode incoming Brotli bodies on its own — the exposure comes from the framework or your code.
2.3 How serious is it, really?
The severity is genuinely contested, which is unusual for a 9.2. Imperva reproduced code execution, but only on one platform (Linux arm64, official image) and only after several attempts. One team achieved local command execution three times out of three — but only against an unfixed system Brotli with a predictable memory layout, and reported that blind remote execution with address-space randomisation did not work. Other researchers argue the realistic impact is denial of service. What is not in dispute: unpatched processes crash reliably, and memory disclosure (which can leak credentials from the process) has been shown. Treat RCE as a credible ceiling and DoS/leak as the likely floor.
Whether the practical outcome is RCE or “only” a remote crash of your API, the remedy is identical and cheap: a dependency-level version bump plus a restart. There is no scenario where waiting is the better call.
03Impact & Attack Scenarios
From an unauthenticated request carrying a crafted Brotli body — or a poisoned upstream response your service fetches — the outcomes range from nuisance to full compromise:
- Denial of service — the most reliable result. A single malformed stream crashes the Node worker; repeated requests keep an API down.
- Memory disclosure — leaked process memory can expose secrets handled nearby: tokens, credentials, other users’ request data.
- Remote code execution — in the right conditions, execution as the Node.js process user; demonstrated, if not yet reliable across platforms.
- Lateral movement & data access — once code runs, the attacker inherits the service’s reach: databases, internal services, cloud metadata and tokens in the environment.
- Supply-chain reach — because Brotli is bundled, the same flaw rides along in Bun, in container base images, in CI runners, and in tools that embed their own Node.js, far beyond the obvious web tier.
04Affected & Fixed Versions
The flaw is in the bundled Brotli decoder, so it spans every Node.js SAPI that decodes Brotli. All supported release lines were patched on 21 October 2026; end-of-life lines will not be fixed upstream.
| Component | Status | Fixed in | Action |
|---|---|---|---|
| Node.js 26.x | Affected | 26.12.1 | Upgrade now |
| Node.js 24.x | Affected | 24.22.1 | Upgrade now |
| Node.js 22.x | Affected | 22.23.4 | Upgrade now |
| Node.js 25.x | EoL — affected | No official fix | Migrate to 24.x / 26.x |
| Node.js 20.x & older | EoL — affected | No official fix | Migrate to 22.x / 24.x |
| Bun | Affected ≤ 1.4.3 | 1.4.4 | Upgrade now |
| Brotli library | Affected 1.0.3–1.2.0 | 1.0.10 / 1.1.1 / 1.2.1 | Upgrade standalone / system Brotli |
Some distributions (Ubuntu, Fedora, RHEL, Alpine) build Node.js against the system Brotli rather than the copy in the Node source tree. On those systems the Node.js version number alone will not tell you whether you are patched — you must also check the OS Brotli package (fixed at 1.0.10 / 1.1.1 / 1.2.1). Containers are the fast path: docker pull a refreshed base, pin the Dockerfile to a fixed tag, and verify with node --version.
05Am I Affected?
Assume yes if any Node.js or Bun runtime below the fixed versions decodes Brotli from an untrusted source. To scope it:
# 1. Which runtime is actually serving? (check every host, container, CI runner, serverless fn) node --version # need >= 22.23.4 / 24.22.1 / 26.12.1 bun --version # need >= 1.4.4 # Node 25.x, 20.x and older are end-of-life — no fix, migrate # 2. Does your code (or a dependency) decompress attacker-controlled Brotli? grep -rn "createBrotliDecompress\|brotliDecompress" src/ grep -rn "express.json(\|@koa/bodyparser\|co-body\|@fastify/compress" . # Express 5 + express.json() decodes `br` request bodies by default => exposed # Server-side fetch() auto-decompresses Content-Encoding: br responses => exposed # 3. Distro builds may use the SYSTEM Brotli, not the bundled copy # confirm the OS package: brotli 1.0.10 / 1.1.1 / 1.2.1 are fixed
Do not forget the non-obvious runtimes: CI/CD runners, serverless functions, build servers, desktop apps that embed Node, and container base images. Each is a separate copy to patch.
06Mitigation & Remediation
The fix is a clean dependency bump. Patching is decisive; the reachability reductions below are defence-in-depth, not substitutes.
Upgrade Node.js to 26.12.1 / 24.22.1 / 22.23.4, Bun to 1.4.4, and any standalone or system Brotli to 1.2.1 / 1.1.1 / 1.0.10. Rebuild container images from a refreshed base (docker pull first), pin Dockerfiles to a fixed tag, and restart the service so the old runtime leaves memory. Replace end-of-life Node 20.x / 25.x with a supported line.
Where you accept request bodies, set express.json({ inflate: false }) to reject compressed bodies with a 415 (note: this also rejects gzip — test your clients first). Reject Content-Encoding: br at the proxy or load balancer. Audit fetch() calls to servers you do not control and any direct createBrotliDecompress(). A WAF rule on untrusted Brotli traffic is a useful layer.
Run Node.js services as an unprivileged user, keep secrets out of the process environment where you can, and watch web-facing Node processes for shell spawns and unexpected outbound connections. These limit what a successful exploit can reach.
Confirm node --version reports a fixed build everywhere, including containers, CI and serverless. Then watch for the easy-to-reproduce symptom: repeated Node.js process crashes on web-facing services, especially correlated with incoming br-encoded traffic, followed by any unexpected program execution in the same workload.
07Disclosure Timeline
| Date / time (2026, UTC) | Event |
|---|---|
| 14 October | Node.js pre-announces the security release, naming the affected lines and “high” severity. |
| 21 October · 10:38 | Node.js publishes v22.23.4, v24.22.1 and v26.12.1. |
| 21 October · 15:47 | First public GitHub repository referencing the CVE appears. |
| 21 October · ~19:27 | The Brotli project publishes 1.0.10, 1.1.1 and 1.2.1. |
| 22 October | Google’s CVE record is published with a 9.2 CVSS v4.0 score; Imperva publishes research showing code execution on Node 24.22.0 (Linux arm64, official image). |
| 23 October | No confirmed in-the-wild exploitation; not in CISA KEV; roughly a dozen public PoC repositories circulating. |
| 27 October | This advisory. Patch adoption underway; monitor for maturing exploits. |
08Conclusion
Node2Shell is a sharp reminder that risk does not stop at the code your team writes — it extends to every library your runtime ships. The vulnerability lives in a compression path that widely-used frameworks activate by default, reachable through something as routine as an inbound HTTP body. Debate around real-world exploitability is fair: reliable cross-platform RCE has so far been demonstrated only under controlled conditions, whereas crashes and memory leaks are straightforward. But that nuance cuts in one direction: patch now, because the cost is negligible — update the runtime, rebuild the image, restart the service — while the cost of delaying rises as public tooling matures.
Treat this as an urgent but manageable patch.
- Inventory — Identify every affected runtime across servers, containers, CI runners, serverless functions, and embedded deployments.
- Patch & restart — Update to the fixed versions and restart all affected services.
- Harden in depth — Where untrusted compressed data is decoded, apply inflate: false and reject the encoding at the proxy layer as a lasting additional control.
Cytomate's security operations team can help you map your exposure across affected environments, verify remediation completeness, and keep watch as exploit tooling continues to evolve.
Cytomate Threat Intelligence. Classification TLP:CLEAR · Report date 27 October 2026. This advisory is provided for defensive and informational purposes. Version numbers, scores, exploitability claims and timeline details are drawn from public reporting available at the time of writing and may be refined as more information emerges — notably, the practical exploitability of this flaw remains actively debated. Validate fixed versions against your own vendor’s advisory before relying on them.
