Broccoli2Shell: A Brotli Bug, Remote Code Execution Risk! (CVE-2026-111497)

When you hear “Broccoli,” you probably think of the vegetable. But in cybersecurity, this is a next-level vulnerability. We all use Brotli compression algorithms to boost web app performance and save bandwidth. Now, a critical Node.js vulnerability has hit the Brotli implementation, dubbed Broccoli2Shell (CVE-2026-111497).
Let’s break down how it works, the actual impact, and how to secure our servers before things go south.
The Core Issue
Node.js natively supports Brotli compression through the zlib module. Web servers routinely accept compressed payloads (like HTTP requests with Content-Encoding: br).
The root cause of this bug is memory allocation mismanagement during the decompression phase. When an attacker sends a maliciously crafted Brotli stream, it causes a memory buffer overflow in Node.js, which leads straight to Remote Code Execution (RCE).
Technical Breakdown: How it Executes
- Malicious Payload Injection: The attacker crafts a heavily nested, malformed Brotli payload and fires it at a target Node.js server.
- Integer Overflow: When Node.js tries to decompress this malformed structure, an integer overflow is triggered during the memory allocation process.
- Heap Corruption: Because there are no proper bounds checks, data overwrites memory outside the allocated buffer (Heap-based buffer overflow).
- Shell Access: By exploiting this memory corruption, the attacker can execute arbitrary code in the context of the Node process and pop a reverse shell. The server is compromised.
The Impact
Treat this as a zero-click exploit. No authentication is required. If your server is publicly exposed and processes incoming Brotli compressed requests, you are vulnerable.
- Complete System Compromise: Attackers can gain root/admin privileges on the host.
- Data Exfiltration: Environment variables, database credentials, and API keys stored in memory can be dumped.
- Denial of Service (DoS): Even if the RCE payload fails to execute properly, the malformed stream will crash the Node.js process (SIGSEGV) and take the server offline.
Mitigation & Remediation
If you are running Node.js in production, you need to act on this immediately. Here is the action plan:
- Patch Node.js: The Node core team has released a security patch. Upgrade your environments to the latest patched LTS version immediately.
- Disable Brotli (Workaround): If you are in a frozen environment and cannot patch right away, disable Brotli decompression at your reverse proxy layer (Nginx / Cloudflare / HAProxy). Fall back to standard Gzip temporarily.
- WAF Rules: Deploy strict Web Application Firewall (WAF) rules to inspect and drop suspicious
Content-Encoding: brpayloads. - Observability is Key: Pull up your Grafana dashboards and check your Fluent Bit logs. Set up alerts for sudden Node.js process crashes, unexpected memory spikes, or SIGSEGV errors. If you see these patterns, someone is likely scanning or attempting to exploit your infrastructure.
Threat actors are already automating this exploit for mass scanning. Patching is the only reliable way out. Stay secure!