Node2Shell Vulnerability Also Affects Python Brotli Packages

Summary
The article identifies CVE-2026-111497 in PyPI Brotli releases through 1.2.0 and brotlicffi releases bundling the 1.2.0 decoder. Fixes are Brotli 1.2.1 and brotlicffi 1.2.1.0; package advisory coverage was absent at publication.
Key points
- Node2Shell is an out-of-bounds write in Brotli’s C decoder. The article says the flaw can crash processes, leak memory or potentially enable remote code execution; Python-side memory corruption and code execution were not tested.
- The article’s source comparison found the upstream fix in Brotli 1.2.1; earlier PyPI Brotli releases through 1.2.0 are affected.
- The authors identify brotlicffi releases bundling the 1.2.0 decoder, including 1.2.0.1 and 1.2.0.2, as affected, and report 1.2.1.0 as the fix. They did not diff or fuzz its source distributions.
- An AddressSanitizer test of Brotli 1.2.0 with a crafted stream returned NEEDS_MORE_INPUT, while 1.2.1 rejected it with error −17, FORMAT_BLOCK_SWITCH.
- Python services may encounter attacker-controlled Brotli data when HTTP clients decode responses or frameworks decode Brotli-compressed request bodies.
- The article recommends upgrading to Brotli 1.2.1 or later and brotlicffi 1.2.1.0 or later; it reports that package advisory listings and scanners did not yet cover the affected PyPI packages.
Article Details
- Attack Vectors
- A crafted Brotli stream can trigger an invalid block-type switch in the vulnerable C decoder; the unchecked return value can leave the decoder running with corrupted state and cause an out-of-bounds write.
- The vulnerable decoder may receive attacker-controlled compressed data in Brotli-encoded HTTP response bodies fetched by Python services or in inbound requests using Content-Encoding: br.
- The article reports that the same decoder flaw is reachable in Node.js through fetch(), Express 5 / body-parser request bodies, and node:zlib. It says the flaw can crash a process, leak memory, or potentially enable remote code execution; Python-extension memory corruption and code execution were not tested.
- Defensive Notes
- Upgrade PyPI Brotli to 1.2.1 or later and brotlicffi to 1.2.1.0 or later; rebuild container images and wheels that bundle either package.
- If an upgrade is not immediately possible, uninstall Brotli and brotlicffi, remove br from outbound Accept-Encoding headers, or reject inbound Content-Encoding: br.
- Check installed versions in each environment. The article says pip-audit, Dependabot, and Safety did not flag these PyPI package exposures as of 23 October 2026.
MITRE ATT&CK
CVE
Vendors
Products
BrotliNode2Shell ain’t just a Node.js bug: the PyPI Brotli and brotlicffi packages ship the same vulnerable C decoder.brotlicffiNode2Shell ain’t just a Node.js bug: the PyPI Brotli and brotlicffi packages ship the same vulnerable C decoder.Bunthrough fetch(), Express 5 / body-parser request bodies, and node:zlib, earning the “Node2Shell” name), Bun, and the PyPI Brotli/brotlicffi packages — and can crash a process, leak memory, or potentially lead toNode.jsNode2Shell ain’t just a Node.js bug: the PyPI Brotli and brotlicffi packages ship the same vulnerable C decoder.