What to do4 steps
Install
Brotli>=1.2.1andbrotlicffi>=1.2.1.0.Then update lockfiles, rebuild images and restart the processes.
Until you can, uninstall both packages.
Uninstall extras such as
httpx[brotli]too. Then requests, urllib3 and aiohttp fall back to gzip and deflate.Do not rely on dropping
brfromAccept-Encoding.It does not fully protect fetched responses. Only an upgrade does.
Refuse untrusted
Content-Encoding: brrequest bodies.Do it at the proxy, load balancer or WAF.
Are you affected?only if all are true
- Brotli or brotlicffi 1.0.3 to 1.2.0 is installed, so requests and urllib3, aiohttp, or httpx with its brotli extra decode a malicious Content-Encoding: br response.
- Middleware or code that decodes Brotli request bodies, uploads or messages an attacker controls.
Check your version
- pip
pip show Brotli brotlicffi - pip
pipdeptree -r -p Brotli - Lockfiles, in the project directory
grep -i brotli poetry.lock uv.lock requirements*.txt Pipfile.lock 2>/dev/null - Prompt for your own agent, read-onlyAm I affected by Python2Shell?
Read the prompt
Check whether the systems I am authorized to inspect are affected by Python2Shell (CVE-2026-111497). The Brotli decoder out-of-bounds write in the PyPI Brotli and brotlicffi packages, which requests, urllib3, aiohttp and httpx load automatically to decode Brotli responses. It is exploitable under these conditions: - Brotli or brotlicffi 1.0.3 to 1.2.0 is installed, so requests and urllib3, aiohttp, or httpx with its brotli extra decode a malicious Content-Encoding: br response. - Middleware or code that decodes Brotli request bodies, uploads or messages an attacker controls. Fixed releases: - PyPI Brotli: 1.2.1 (branch 1.2); before 1.0.3 is not affected Only the 1.2 line gets a release; 1.0.3 to 1.1.x should move to 1.2.1. - brotlicffi: 1.2.1.0 (branch 1.2); before 1.0.3 is not affected Commands the catalog lists to find the version or the setting (read each one before you run it): - pip: pip show Brotli brotlicffi - pip: pipdeptree -r -p Brotli - Lockfiles, in the project directory: grep -i brotli poetry.lock uv.lock requirements*.txt Pipfile.lock 2>/dev/null What the catalog says to do on an affected system (report these, do not carry them out): 1. Install Brotli>=1.2.1 and brotlicffi>=1.2.1.0. 2. Until you can, uninstall both packages. 3. Do not rely on dropping br from Accept-Encoding. 4. Refuse untrusted Content-Encoding: br request bodies. For each host, container image or application, report affected, not affected, fixed or unknown, with the evidence, and list anything you could not access. Work read-only: do not change configuration, restart services or send exploit input. More: https://python.2shell.wtf/python2shell
Affected versions2 branches
| PyPI Brotli branch | Fixed in |
|---|---|
| 1.2 | 1.2.1 |
PyPI Brotli before 1.0.3 is not affected.
Only the 1.2 line gets a release; 1.0.3 to 1.1.x should move to 1.2.1.
| brotlicffi branch | Fixed in |
|---|---|
| 1.2 | 1.2.1.0 |
brotlicffi before 1.0.3 is not affected.
Proof of concept1 public PoC
For testing systems you own or are authorized to test. A PoC repository can be fake or carry malware: read it before you run it.
- Open the PoC
Public proof of concept on GitHub. No popular PyPI brotli or brotlicffi PoC exists; the most-starred for this CVE, dimasma0305/CVE-2026-111497-POC, reproduces the shared decoder bug with Node-specific, lab-gated code execution.
Timeline5 events
Public PoC
Public proof of concept on GitHub. No popular PyPI brotli or brotlicffi PoC exists; the most-starred for this CVE, dimasma0305/CVE-2026-111497-POC, reproduces the shared decoder bug with Node-specific, lab-gated code execution.
Patched
Brotli 1.2.1 on PyPI
Patched
brotlicffi 1.2.1.0 on PyPI
Reported to the vendor
OpenSourceMalware shows the PyPI packages ship the vulnerable decoder
Added to CISA KEV
Added to CISA Known Exploited Vulnerabilities
Sources6 links
Sources checked on . This page tells you how to check and what to install. It cannot tell you that you are safe.
6 changes since it was published
- Linked the most-starred public proof of concept (shared CVE-2026-111497).
- Fixed the brotlicffi 1.2.1.0 PyPI release date to 2026-10-22 (actual upload).
- Remediation steps got short titles; no fact changed.
- Updated source links that moved to a new address.
- Added the Cloudflare Zero Wire briefing.
- Added the CISA KEV listing.
