Node2Shell: Brotli Bug Hits Node.js, Bun and .NET
Summary: A memory bug in Google's Brotli decompressor (CVE-2026-111497, nicknamed Node2Shell) lets crafted compressed data write past a buffer. It affects Node.js, Bun, .NET and other software that decodes Brotli. Patches have been out since October 21, 2026, and security vendors report attacks in the wild. Check your Node.js release number, not just your library versions.
What the bug is
Brotli is a compression format used on the web, often for HTTP bodies marked Content-Encoding: br. According to the Node.js security advisory, malformed Brotli input can make the decoder write past an eight-byte internal buffer. The decoder treated an invalid block switch as "need more input" instead of reporting a format error. The advisory lists a crash, memory disclosure or remote code execution as possible outcomes.
Exposure needs one thing: your application must decompress data an attacker can influence. Node.js describes the path as an app that feeds untrusted data to node:zlib. Security firm ELLIO traces the flaw back to Brotli 1.0.3, released in March 2018.
Severity
Node.js rates it High. The CVE record, issued by Google, scores it 9.2 (Critical) on the CVSS 4.0 scale, according to both Datadog Security Labs and ELLIO. I could not open the NVD or CISA pages myself, so treat any other score you see as unchecked.
Who needs to patch
| Software | Fixed in |
|---|---|
| Node.js 22, 24, 26 | 22.23.4, 24.22.1, 26.12.1 (released October 21, 2026) |
| Google Brotli | 1.0.10, 1.1.1, 1.2.1 |
| .NET 8, 9, 10 | 8.0.33, 9.0.22, 10.0.14 (out-of-band update, October 25, 2026) |
| Bun | 1.4.4 (affected: 1.0.21 to 1.4.3) |
| Python Brotli / brotlicffi | 1.2.1 / 1.2.1.0 |
The versions for .NET, Bun and Python come from Datadog's table. I could not load Microsoft's own announcement, so confirm .NET against Microsoft's advisory. Node.js 20, 23 and 25 are end of life, are affected, and will not get a fix (ELLIO and Datadog agree). If you run one of those, upgrading to a supported line is the only route.
One trap: both Datadog and ELLIO say process.versions.brotli reports 1.2.0 on patched and vulnerable Node.js builds. Check the Node.js release version instead. Linux distributions often backport fixes under older version numbers, so use your distro's advisory there.
Is it being exploited?
A public proof of concept appeared on October 22, according to Datadog. ELLIO reported exploit traffic against its sensors on October 26. ELLIO also says its own test of the attacker's exploit chain got zero hits in 50 attempts, so reliability looks uneven. Datadog's October 29 article states that exploitation is confirmed and that CISA's Known Exploited Vulnerabilities catalog lists the CVE. I am relying on Datadog for the CISA listing because I could not read the catalog entry.
What to do
- Upgrade Node.js, Bun, .NET and any Brotli bindings to the fixed versions above, then rebuild container images.
- If you cannot patch yet and run Express 5 or body-parser 2, Datadog suggests setting
inflate: falseor rejectingContent-Encoding: brat your reverse proxy. Both only reduce risk, and they can break legitimate clients that send compressed bodies. - Know what the stopgap misses. Neither source offers a workaround for Brotli responses your own app fetches with
fetch, axios or similar clients, and Datadog notes a WAF does not see the decoded content. - Watch for web workers that crash or restart in a loop after receiving Brotli data.
The flaw was reported by Khai Tran and Sylvie Mayer of OpenAI Codex Security, per the Node.js advisory.
Comments
Post a Comment