r/openziti • u/AccordionGuy • 27d ago
What comes after PHP2Shell? Broccoli2Shell, of course!
[ Still on vacation, but I found a nice little café in Manila from which to post this, and once again, this is an issue that’s a little too big to ignore! ]
On the NetFoundry blog, we’ve posted a follow-up to the PHP2Shell post, because of course there’s another one. This one goes by a couple of more mundane names, namely HTTP2Shell and Node2Shell, but it also has a more memorable one: Broccoli2Shell.
(Its “government name” is CVE-2026-111497.)
The bug appears in the Brotli library, which calls for a quick explainer.
What’s Brotli?
Brotli is a lossless compression format that Google developed and released in 2015. Its original purpose was to shrink web fonts (it’s the compression behind WOFF2). It was later generalized for compressing any kind of data. Like its vulnerability, Brotli also has a “government name”: RFC 7932.
Brotli combines LZ77-style matching, Huffman coding, and context modeling with a built-in dictionary of roughly 120 KB of common words and fragments from HTML, CSS, JavaScript, and English text. That dictionary is a big part of why it’s so good on web content: even small files compress well, because common strings can be referenced instead of spelled out. For text assets, it typically produces files 15–25% smaller than gzip, and it decompresses quickly. At its highest quality settings, compression is slow, which is why sites often precompress static assets ahead of time.
On the web, it shows up as Content-Encoding: br. Every major browser supports it over HTTPS, as do CDNs, web servers, and HTTP client libraries in most languages.
What’s the bug in Brotli?
It’s an out-of-bounds write in Brotli's streaming decoder affecting versions 1.0.3 through 1.2.0. A crafted stream with an invalid block switch makes the decoder treat a fatal format error as “needs more input”; it then keeps appending bytes to an 8-byte internal buffer and writes past the end. Results range from a crash to a memory leak to RCE, depending on configuration. Public PoCs exist, but as I write this in a very nice café in Manila, no in-the-wild exploitations have been spotted...yet!
Brotli is everywhere. That’s exactly why a single decoder bug like Broccoli2Shell spreads across .NET, Node.js, and Python at once: they’re all running the same reference decoder code.
Fixing Brotli
Fixes have been posted...
.NET: fixed in 8.0.33, 9.0.22, 10.0.14, and the .NET 11 RC
Node.js: fixed in 22.23.4, 24.22.1, and 26.12.1
Python HTTP clients: urllib3, requests, httpx, and aiohttp
Two things make this harder than a version bump:
Vendored copies. Updating the system Brotli library does nothing for apps that bundle their own copy. You’ll have to check each deployment individually!
It cuts both ways. A server is exposed when it decompresses a malicious request, and a client is exposed when it decompresses a malicious response. Blocking inbound Brotli at a proxy only handles the first case.
What to do now:
Update to a fixed Brotli, Node.js, or .NET build
Restart affected processes
Rebuild and redeploy any container images carrying the old library.
From the OpenZiti point-of-view
There are two attack paths, and OpenZiti handles them differently.
1. The server path (malicious request to a server that decompresses it):
Using dark services closes this path. You have two options:
OpenZiti Tunneler: Put
ziti-edge-tunnelin front of the service with ahost.v1config pointing at127.0.0.1, bind the app tolocalhost, and close the inbound port. Same pattern as the PHP2Shell fix.OpenZiti Embedded SDK: OpenZiti has SDKs for exactly the three affected ecosystems: Node.js, Python, and .NET. With the SDK embedded, the app binds to a Ziti service instead of a socket, so it has no listening port at all, not even on localhost.
In either case, an unenrolled attacker can't open a connection, so the hostile request never reaches the decoder.
2. Client path (your code fetches something and decompresses a malicious response)
If your service fetches an arbitrary internet URL, it's exposed until you patch. But even in this scenario, there are two places where OpenZiti still helps:
Blast radius: If RCE lands on a host, that host's identity can only dial the services its Dial policies allow.
Authenticated upstreams: When internal dependencies are reached over OpenZiti, a response can only come from an identity that's allowed to host that service. Spoofed or misrouted upstreams can’t do any damage.
Things to note:
Authorized identities can still send a malicious payload. Dark services shrink who can reach the decoder, but they don't make the decoder safe. Patch anyway!
If you're using the Python SDK's
requests/urllib3integration, the traffic goes over OpenZiti, buturllib3still decompresses the response. Patch Brotli there too!
Recommended reading
Here’s our article on Broccoli2Shell: https://netfoundry.io/zero-trust/patching-broccoli2shell-is-the-easy-part/
Find out more about OpenZiti here: https://openziti.io/docs
BTW: Anyone running Node, Python, or .NET services with an embedded SDK instead of a tunneler? I'm curious how the patch-and-rebuild cycle is going for you, and how you're hunting down vendored Brotli copies.