HTTP2Shell: the Brotli bug is not just Node.js — and the attack arrives in the response, not the request
The name suggests HTTP/2, but HTTP2Shell is CVE-2026-111497 seen from the shared-library angle: Express 5, fetch(), Python with Brotli installed, curl --compressed, Parquet, JPEG XL and a long list of software embedding the same C decoder. Understand the three exposure vectors, the WAF blind spot, and how to audit your environment.
When CVE-2026-111497 dropped on October 21, 2026, the headline was “RCE in Node.js”. Imperva named the flaw Node2Shell; days later, Strobes published an analysis under another name — HTTP2Shell — with a different thesis, one that matters more if you defend a real environment: the bug is not Node.js’s. It belongs to the C Brotli decoder that dozens of products compile into themselves. Node is merely the most famous carrier.
The “HTTP2Shell” name can also mislead: there is no HTTP/2 protocol flaw (nor HPACK). The name exists because the natural delivery vector is HTTP — a Brotli-compressed body traveling normally — and HTTP/2 is where Content-Encoding: br is most common. Strobes’s lesson is the opening line of their write-up: the bug lives in the shared library, not in one runtime.
If you have read our Node2Shell analysis, the internal mechanism is the same (a decoder that answers “send more data” to an impossible stream and overflows an 8-byte buffer). This post covers the rest: how the attack actually gets in, who else is exposed, and how to audit.
Executive summary
- The flaw: out-of-bounds write in the C Brotli decoder (versions 1.0.3 through 1.2.0) — CVE-2026-111497, CVSS 9.2/9.8.
- The thesis: any stack that decodes Brotli is exposed — not just Node.js. That includes Python (
Brotliandbrotlicffipackages ≤ 1.2.0, loaded automatically by HTTP clients), Bun, and a long list of software embedding copies of the decoder. - The most dangerous detail: the most realistic vector is outbound — your application fetching a URL chosen by the attacker (webhooks, link previews, crawlers, OIDC discovery, AI agents). The malicious content arrives in the response, bypassing WAFs that only inspect requests.
- Fixes: Node.js 22.23.4 / 24.22.1 / 26.12.1; Bun 1.4.4; Python
Brotli1.2.1 andbrotlicffi1.2.1.0; native Brotli 1.2.1 / 1.1.1 / 1.0.10.
The three exposure vectors
The right question is not “do we use Node.js?”, but “what in my system decompresses Brotli from someone I don’t trust?”. There are three families of answer.
1. Request bodies inbound — the Express 5 case
The scenario Imperva used in the RCE demonstration: a server accepting compressed request bodies. The detail that catches many by surprise:
- Express 5 (5.0.0–5.3.0) with body-parser 2.x decompresses request bodies by default (the
inflateoption defaults totrue). An innocent line likeapp.use(express.json())already puts the decoder in the path of untrusted data. - Express 4 / body-parser 1.x answer
415 Unsupported Media Typeto Brotli — not exposed through this path. - A bare Node.js HTTP server (
http.createServer) without middleware decompresses nothing — not exposed.
Immediate mitigation, without upgrading: express.json({ inflate: false }), or reject Content-Encoding: br at the proxy/WAF before it reaches the application.
2. Responses outbound — the WAF blind spot
Here is the vector most teams forget. These clients decompressed Brotli automatically, without anyone writing “brotli” anywhere in the code:
- Node.js: the built-in
fetch(); - Python:
urllib3/requests,aiohttpandhttpx(with the brotli extra) loadBrotli/brotlicffiif installed — even if your code never imports the package; - curl with
--compressed(via the system libcurl).
Attack channels, in order of realism: webhooks fetching the URL you registered (the attacker registers theirs), link previews (message cards with thumbnails), crawlers and URL validators, OIDC/OAuth discovery (a malicious provider’s .well-known/openid-configuration), and AI agents fetching arbitrary URLs — the case Imperva demonstrated, with the agent fetching the malicious compressed response.
And the blind spot: the payload arrives in the response of a connection the application itself initiated. WAF and traffic inspection that only look at inbound see nothing. Naive rejection also fails: removing br from your Accept-Encoding does not stop a malicious server from sending Brotli anyway — whoever answers decides the content.
3. Direct decoding and file formats
Brotli is not just HTTP. The decoder shows up in: zlib.brotliDecompress() called manually; Brotli-compressed Parquet; JPEG XL (its compression layer is Brotli); PDFs; archives and caches. If your pipeline accepts third-party files and opens them in-process, it decompresses with the same C code.
The list nobody audits: vendored copies
Strobes did the exercise that was missing: hunting for vendored copies of the decoder in other projects. As of October 24, still embedding unpatched code:
- .NET (internal Brotli copy)
- PHP brotli extension
- Ruby gem
- DuckDB and ClickHouse
- Apache Arrow, libjxl, MuPDF, EDK II (firmware!)
Already fixed at the time: Chromium, Firefox, ngx_brotli, Brotli4j. Not affected for using their own implementations: the Java/JavaScript/C# reimplementations, and Rust’s brotli-decompressor. And a note that wrongly reassures people: Apache and Nginx, on defaults, are not vectors — they compress responses, they do not decompress request bodies. The danger lies in the layers that decode.
On the Python side there is a management aggravator: the CVE was published against the Google repository, and for days pip-audit, Dependabot and Safety reported nothing — the Brotli package on PyPI remained “clean” in reports. Auditing by package name is not enough; you must look at where the code comes from.
How to audit your environment in five commands
# Node.js: bundled brotli version
node -p "process.versions.brotli" # 1.1.0 = vulnerable; 1.2.1+ = ok
# Python: the packages wrapping the C decoder
pip show Brotli brotlicffi
pipdeptree -r -p Brotli # who pulls this dependency
# Node: middleware that decompresses requests
npm ls express body-parser # Express 5.x + body-parser 2.x = inflate by default
# Where else the code appears (grep sources/lockfiles)
grep -ri "brotlidec\|brotli-decompressor\|libbrotlidec" --include=*.lock --include=*.toml .
# Running processes with the decoder loaded in memory
grep -l brotlidec /proc/*/maps
And the places this checklist usually hits that nobody watches: container images, CI runners, serverless functions, and lockfiles of old internal projects.
Mitigation when patching is not immediate
- Reject
Content-Encoding: bron request bodies at the proxy/WAF (does not affect the response vector). express.json({ inflate: false })(and equivalents on frameworks using body-parser 2).- Uninstall the Python
Brotli/brotlicffipackages if nothing needs them — the only measure in this list that covers the response vector, because HTTP clients only decode Brotli when the package exists. - After upgrading: restart every process and rebuild images — the decoder is compiled into the binary; updating a package without restarting does not swap the running code.
None of these replace the patch. They shrink the surface while the update happens.
What the attack looks like to detection
Without sending test traffic to production, the available signals are behavioral: abnormally large and repetitive Brotli bodies (the known vector packs millions of identical commands — in our reproduction, a 7-byte pattern repeated up to ~29 MB); processes at high CPU on a single core after handling compressed content (the decoder’s infinite loop); segmentation faults in workers; and, on patched systems, a rise in ERR__ERROR_FORMAT_BLOCK_SWITCH as a probing indicator. Sysdig published detection guidance for runtime security teams.
Our reproduction of the Node.js 24.22.0 (vulnerable) vs 24.22.1 (patched) differential is in the Node2Shell post — with the vulnerable process stuck in an infinite loop and the patched one rejecting the same stream in milliseconds.
Conclusion
HTTP2Shell formalizes something this incident deserved to scale beyond Node: when a vulnerability lives in an omnipresent C library, the inventory of “who embeds it” is the security question — and no SCA tool matching package names will answer it for you. Express 5 with json() and inflate on, a forgotten Brotli in requirements.txt, a crawler fetching third-party URLs: each is an unguarded C decoder running inside your process.
Patch, uninstall what you don’t use, restart everything. And the next time a native-library CVE drops, before asking “do we use that runtime?”, ask: “who else compiled that code?”
Sources
- Strobes — HTTP2Shell: Brotli RCE in Node.js and Python
- Sysdig — Node2Shell (CVE-2026-111497): Detecting the Node.js Brotli RCE
- Imperva — Node2Shell: From Brotli Data to Remote Code Execution
- Node.js — Wednesday, October 21, 2026 Security Releases
- Fix in google/brotli (commit 0ed4268a)
- HeroDevs — CVE-2026-111497 (Node2Shell): Node.js Brotli RCE Fix
- Gila Security — Node2Shell: technical analysis and lab reproduction