Node2Shell (CVE-2026-111497): Brotli decoder out-of-bounds write, exploited in the wild
An unchecked return value in Google's Brotli C decoder (CVSS 4.0 9.2, on CISA KEV) lets a crafted br stream corrupt memory in Node.js, Bun, Python, Envoy and more. Exposure, detection and the fix.
Node2Shell (also called HTTP2Shell, Broccoli2Shell or Brotli2Shell) isn’t really a Node.js bug. It’s a bug in Google’s Brotli C decoder, which Node bundles, and so do Bun, Python’s brotli/brotlicffi, Envoy, Istio, .NET, curl and others. Any process that decompresses Brotli data an attacker can influence is in scope. CISA added it to the KEV catalog on 27 October 2026. Companion posts: PHP2Shell and Java2Shell.
Scope and ethics. This post covers architecture, exposure checks, detection and remediation. It contains no malicious Brotli streams or exploit offsets. Run any validation on systems you own, in an isolated lab.
At a glance
| CVE | CVE-2026-111497 |
| Severity | CVSS 4.0 9.2 Critical, AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H (Google CNA, via NVD). Node.js rates it High on its own scale |
| CWE | CWE-252 Unchecked Return Value → CWE-787 Out-of-bounds Write |
| Affected | Brotli 1.0.3 – 1.2.0 (bug shipped March 2018) |
| Fixed in | Brotli 1.0.10 / 1.1.1 / 1.2.1. Node.js 22.23.4 / 24.22.1 / 26.12.1 (21 Oct 2026). Bun 1.4.4 |
| Exploited? | Yes. CISA KEV, added 27 Oct 2026 (due 10 Nov) |
| Auth / interaction | None / none |
Description: how the bug works
A Brotli stream is split into metablocks. Within each metablock the decoder tracks three kinds of block (literals, insert-and-copy commands, and distances), each with a counter. When a counter reaches zero, the decoder reads a block switch that says which block type comes next.
If a metablock declares only one block type for a kind, a block switch is invalid. That’s a malformed stream and should be a hard error. The helper that decodes block switches returned a plain boolean, though, and false meant both “this stream is invalid” and “I ran out of input, feed me more.” In streaming mode the caller read false as need more input, so it kept buffering bytes into a small fixed internal buffer (8 bytes), past its end. The result is an out-of-bounds write into adjacent decoder state, with the contents controlled by the attacker.
The upstream fix (google/brotli commit 0ed4268a, “Detect and report invalid stream earlier”) adds a dedicated error code, BROTLI_DECODER_ERROR_FORMAT_BLOCK_SWITCH, so invalid switches fail immediately. The commit landed on master on 27 Feb 2026 with no release or advisory. The patched releases and CVE followed in October. That eight-month gap gave attackers a long time to diff the fix, and ELLIO saw a node2shell-check scanner as early as 13 June 2026.
Impact
Per NVD and CISA: corruption of decoder state, memory disclosure, denial of service (the usual outcome of a failed attempt, which crashes the worker), and potential arbitrary code execution. Imperva showed RCE on the official Node.js 24.22.0 image via both fetch() and Express 5. ELLIO reproduced it on x86-64.
Which applications are reachable
The Node.js advisory frames exposure as “decompresses with node:zlib”. In practice, that covers far more code than direct zlib calls:
| Path | Reaches the decoder? |
|---|---|
zlib.brotliDecompress*() / createBrotliDecompress() on untrusted data |
Yes |
Inbound bodies with Content-Encoding: br: Express 5 express.json()/raw()/text()/urlencoded() via body-parser 2 (inflate: true by default), Koa @koa/bodyparser, @fastify/compress request decompression |
Yes. Any client can send one |
Outbound responses: built-in fetch()/undici, axios, got, SuperAgent, server-side fetch in Next.js |
Yes, if an attacker controls or influences the URL or the upstream response (SSRF, webhooks, link previews) |
A bare node:http server that never decodes bodies |
No |
Python requests/urllib3/httpx/aiohttp/Scrapy with brotli or brotlicffi installed |
Yes, via response Content-Encoding |
| Envoy / Istio with the Brotli decompressor filter configured | Yes |
| .NET with Brotli request decompression enabled (off by default) | Yes |
Prerequisites: the attacker can deliver Brotli bytes that your process decompresses. No credentials and no user interaction are needed. Building a reliable exploit is build-specific, but crashing a worker is not.
Identifying affected systems
Don’t trust process.versions.brotli. It reports 1.2.0 on both patched and unpatched Node builds, because Node cherry-picked the fix without bumping the string. Go by the Node.js version instead:
# 1) Node runtime version: vulnerable if below 22.23.4 / 24.22.1 / 26.12.1, or on 20.x / 23.x / 25.x (EOL, no fix)
node -v
# 2) Does this node binary link the SYSTEM libbrotli? If so, the distro package matters too.
ldd "$(command -v node)" | grep -i brotli || echo "bundled brotli (go by node version)"
dpkg -l | grep -i brotli 2>/dev/null || rpm -qa | grep -i brotli
# 3) Every container image's runtime, not just the host
docker ps --format '{{.Image}}' | sort -u | xargs -I{} sh -c 'echo -n "{}: "; docker run --rm --entrypoint node {} -v 2>/dev/null || echo n/a'
# 4) Python bindings and Bun
pip list 2>/dev/null | grep -iE '^(brotli|brotlicffi) ' # need Brotli>=1.2.1 / brotlicffi>=1.2.1.0
bun --version 2>/dev/null # need >=1.4.4
# 5) Is your app actually decoding inbound br? (look for body-parser 2 / Express 5)
npm ls express body-parser @koa/bodyparser @fastify/compress 2>/dev/null
Fixed distro packages include Debian bookworm brotli 1.0.9-2+deb12u1 (DLA-4855-1), trixie 1.1.0-2+deb13u1 (DSA-6582-1) and Alpine brotli 1.2.1-r0. Envoy is fixed in 1.40.0 / 1.39.3 / 1.38.6 / 1.37.8 / 1.36.12, and the Ruby brotli gem in 0.9.1.
Safe validation in an isolated lab
- Run
node:24.22.0andnode:24.22.1containers on an isolated network, each with a minimal Express 5 app usingexpress.json(). - Send a benign, valid Brotli-compressed JSON body (
echo '{"ok":1}' | brotli -c | curl --data-binary @- -H 'Content-Encoding: br' -H 'Content-Type: application/json' ...) to both. They should both accept it, which proves the decode path is reachable. - Enable your interim control (body-parser
inflate: false, or a proxy rule rejectingbr) and confirm the same request now gets 415 or is blocked. - Confirm your scanner and SBOM tooling flags
24.22.0and passes24.22.1, and that it doesn’t rely onprocess.versions.brotli.
Detection and threat hunting
- Worker crashes. Segfaults in
node,bunorpythonwithBrotliDecoderDecompressStream/libbrotlidecon the stack. Forwarddmesg/kernel messages andsystemd-coredumpevents to your SIEM. Repeated PM2 or Kubernetes restarts of Node pods (CrashLoopBackOff) after inbound POSTs are a strong signal. - Request telemetry. Inbound requests with
Content-Encoding: br(case-insensitive, including lists likegzip, br) to APIs that no legitimate client sends compressed. Most browsers never compress request bodies, so this traffic is rare in normal use. - Process lineage.
node/bun/pythonspawningsh,bash,curl,wget,nc,cat /etc/passwd,cmd.exeorpowershell.exe. - IOCs from ELLIO (26 Oct 2026): exploit traffic from
94.154.43.7, request body SHA-2567fcbdaaecd4419e2930927844f3b772668204737a4e7602a2290c991c93c5c4b. A scanner from AS44620 was active since June. - Core dumps. A crashed worker’s core file can contain session tokens and secrets. Restrict who can read core files and how long they’re kept.
Remediation
- Upgrade Node.js to 22.23.4 / 24.22.1 / 26.12.1 or later (take the latest patch on your line, since later releases fixed other High-severity issues too). Move off EOL 20.x / 23.x / 25.x, which won’t get a fix.
- Update Brotli everywhere: distro
libbrotli, PyPIBrotli>=1.2.1/brotlicffi>=1.2.1.0, Bun ≥ 1.4.4, Envoy, Istio, .NET and the Ruby gem, then refresh lockfiles. - Rebuild and restart. Dockerfiles pinning
node:24.22.0,bun build --compilebinaries and self-contained .NET apps keep the bug until rebuilt. Running processes keep it until restarted.
Interim mitigations (not fixes)
- Express / body-parser:
express.json({ inflate: false })(and the same forraw/text/urlencoded). Compressed bodies are then rejected with 415. - Edge / WAF / proxy: reject inbound requests whose
Content-Encodingcontainsbr. This does not protect outboundfetch()responses. - Outbound: send
Accept-Encoding: gzip, deflate(nobr) on server-side HTTP clients that fetch attacker-influenced URLs, and tighten SSRF egress controls. - Microsegment Node services so a compromised worker can’t reach much.
References
- CVE-2026-111497, NVD · CISA KEV catalog
- Node.js October 2026 security releases
- google/brotli v1.2.1 release · Fix commit 0ed4268a
- Akamai: Inside Node2Shell
- ELLIO: RCE on stock Node.js builds, in-the-wild IOCs
- SOC Prime: detection content
- Cyber Security News: KEV listing coverage
Verify every version against the vendor advisory before acting. Published 20 Nov 2026.