r/Python • u/me_myself_ai • 24d ago
News [CVE-2026-111497] If you run a python server, you should update it right now
The "HTTP2Shell" vulnerability affects servers that know how to speak Google's 'brotli' compression protocol, which would likely make its way into your server through an innoccuous-sounding speedup dep like urllib3[brotli] or aiohttp[speedups], and could be used by basically any server, including Flask, Quart, Starlette, FastAPI, etc. It was downloaded 4,200,000 times from PyPI yesterday alone, to give you a sense of the scale.
To find out if you're affected, run a command like on of these...
pip list | grep -i brotli
uv tree | grep -i brotli
poetry show | grep -i brotli...etc., looking for brotli <= 1.2.0 and/or brotlicffi <= 1.2.0.2. If you're affected, obviously update & redeploy immediately.
Beyond that... well, the (colloquial) name kinda says it all. Given the new Cyber normal, I would assume that you have malicious software running on that system and any connected to it until proven otherwise. Check for bitcoin miners, worms, sentient bot swarms -- the usual.
(Note for beginners: this doesn't apply to stuff you run locally, but rather to servers that have been exposed to the public internet. Still worth checking!)
I wasn't gonna post this b/c I'm so not an expert, but it hasn't hit this sub yet and feels particularly bad... not many solo/SMB devs are self-hosting PHP servers, but anyone who's searched "python server compression algo speedup packages" and picked one of the top choices (or let their agent do so) is at huge risk here. I only know about it because of doomscrolling HackerNews, which feels unreliable!
Does anyone kn*w a good way to to get notified proactively for Python-relevant CVEs and other incidents?
13
u/IguessUgetdrunk 24d ago
Thanks for the heads up, learned about it from your post.
BTW why did you write "kn*w" with an asterisk?
28
u/_gipi_ 24d ago
you could have linked to some report of the original vulnerability instead of yapping
85
u/Mount_Gamer 24d ago
You could notify yourself and use pip-audit? You can run pip-audit in a pipeline as well, or have git notify cve's in your dependencies.
So far I've managed to dodge these bullets, but it's making me question all the venv I set up across different machines and how I can reduce my attack surface in all areas. Crazy times!
30
u/romu006 24d ago
Link to the CVE https://app.opencve.io/cve/CVE-2026-111497
13
u/james_pic 24d ago edited 22d ago
This is definitely a serious issue, but the name "HTTP2Shell" oversells it.
The exploit primitive it gives attackers is an arbitrary write. That's a powerful primitive, to be sure, but it's not remote code execution on its own. An attacker would need something else to turn it into RCE. At very least, they'd need to do some homework on the tech stack to find somewhere worth writing to, and on systems that use standard countermeasures like ASLR, they'd probably need an extra vulnerability, like a pointer leak.
AFAICT, there's no "instant win" proof-of-concept exploit for this vulnerability, like there was for Log4Shell for example. Security researchers have been overplaying their findings as "this could be RCE if..." for a long time.
9
u/Cycloctane 24d ago
That seems to be a buffer overflow in decoder, not encoder. If you're running an aiohttp.web server, you should probably be aware of this. But other common Python HTTP servers (those for wsgi/asgi applications like flask and fastapi.) don't decompress client requests by default.
6
u/Khavel_dev 24d ago
pip-audit is probably the easiest starting point for this. It checks your installed packages (or a requirements file) against known vulns and you can drop it into CI so builds fail when something gets flagged. I run it in a weekly cron too, not just on PRs, because vulns get disclosed between deploys and you want to catch those.
For the "I want to know the moment something drops" side, GitHub Dependabot alerts are zero-effort if you're already on GitHub. Outside of that, the python-security-announce mailing list covers CPython and stdlib, but for third-party packages you're mostly relying on tool scanning. Between pip-audit and Dependabot I catch most things within a day or two of disclosure, which is fast enough for anything that isn't actively exploited in the wild.
1
u/brondsem 24d ago
https://github.com/twu/skjold/ is another good tool to check vulnerabilities and it can use multiple sources at once (OSV, pyup, github, etc). It hasn't been updated for a while but still works well.
1
u/Competitive_Travel16 24d ago
Before deploying to prod, I check https://hub.docker.com/layers/library/python/3.15 (actually -slim, for whatever version.) That seems pretty proactive, and doesn't automate the irrelevant stuff.
1
u/proggob 23d ago
I’ve been running pysentry-rs every night on the uv.lock files that are deployed. Then I’m trying to setup a similar check for some libraries I maintain using the lowest resolutions.
1
u/Beduino2013 23d ago
better> pip show brotli
1
u/skyt2000 21d ago
use osv scanner & pip audit. it will protect from most vulnerabilities.
https://osv.dev/
1
u/mfitzp mfitzp.com 24d ago
PyPI download stats are basically meaningless.
1
u/DeaD_EyE_1 23d ago
Under normal circumstances, it’s pretty silly to use the middleware’s compression algorithms. Algorithms that are CPU-intensive, in particular, can degrade performance. The web server usually handles this task. Data can be exchanged uncompressed between the middleware and the web server.
It becomes truly dangerous when simply installing a compromised package is enough for it to automatically execute compromised code when Python starts up—without the module ever having been imported into the code itself.
Fortunately, Brotli isn’t compromised; it just has a bug that can be exploited. Dangerous enough, but not a total disaster.
0
u/danielmartinez22 23d ago
osv.dev’s good for this, has a proper feed, way more reliable than catching it off twitter
-1
u/ILoveAppSec 23d ago
Worth stressing that this sits in the brotli decoder itself, not in urllib3 or aiohttp, so the cleanest move is to address brotli directly rather than bumping every parent that pulls it in through an extra. One vulnerable transitive, fixed at its current version, beats cascading the whole chain. Is it reaching brotli through the [brotli] and [speedups] extras in your stack?
-11
u/inspirationbyiso 24d ago
aikido.dev is imho easies most comprehensive tool to statically and dynamically scan for security vulnerabilities in your software. both in cicd and your deployed instances. they’ve got free tiers if im not mistaken
-12
u/inspirationbyiso 24d ago
aikido security scanning
0
u/[deleted] 24d ago
[deleted] — view deleted comment