Brotli: Out-of-bounds write in the Brotli decoder ("Node2Shell") also affects the PyPI Brotli packageGHSA-9v8h-qqgm-4m35
Fix: google/brotli@0ed4268GHSA-9v8h-qqgm-4m35 is a remote code execution vulnerability in brotli. A fix is available for brotli — see the affected versions and patch details below.
Real-World Exposure
brotli🐍brotlicffiReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects PyPI packages — download data is not available via public APIs for these ecosystems.
Description
A buffer overflow vulnerability in the Brotli decoder (c/dec/decode.c) in Google Brotli versions 1.0.3 through 1.2.0 on all platforms allows a remote unauthenticated attacker to corrupt adjacent decoder state memory, disclose sensitive memory contents, cause a denial of service, or potentially execute arbitrary code using a crafted Brotli-compressed stream.
Users need to update any Brotli libraries or binaries between 1.0.3 through 1.2.0 to the latest available version: 1.0.10 or 1.1.1 or 1.2.1.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐍PyPI | brotli | ≥ 1.0.3&&< 1.2.1 | 1.2.1pip install --upgrade 'brotli==1.2.1' |
| 🐍PyPI | brotlicffi | ≥ 1.0.3&&< 1.2.1.0 | 1.2.1.0pip install --upgrade 'brotlicffi==1.2.1.0' |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for brotli, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update brotli to 1.2.1 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-9v8h-qqgm-4m35 is resolved across your whole dependency graph.
Workarounds
Stop feeding it untrusted input: reject or quarantine files and payloads from unverified sources until you can upgrade, restrict accepted formats to the ones you actually need, and run the parsing or decoding step in a least-privileged sandbox or short-lived worker so a crash or corrupted read cannot reach the rest of the process.
Frequently Asked Questions
Is GHSA-9v8h-qqgm-4m35 in your dependencies?
Find it across PyPI, including transitive dependencies.