http2shell RCE: What It Is and How to Protect Your Stack
If you run any HTTP/2-capable server — Node.js, Python (Hypercorn/uvicorn), Go, or reverse proxies like Envoy and Nginx — the http2shell remote code execution (RCE) disclosure demands immediate attention. This guide gives you the exact detection commands, patch versions, and workarounds to close the hole before attackers exploit it.
The short version: http2shell abuses HTTP/2 request smuggling and header-handling flaws to inject shell commands into backend processes. It is not a single CVE but a class of vulnerability being actively weaponized. If your HTTP/2 endpoints are internet-facing and you haven’t patched in the last 30 days, assume you’re exposed.
Step-by-Step: Detect and Mitigate http2shell
Step 1 — Confirm your HTTP/2 exposure
Run these checks on each production host:
# Check if HTTP/2 is advertised
curl -I --http2 https://yourdomain.com
# Node.js version
node -v
# Python ASGI server version
pip show hypercorn uvicorn h2 | grep -E "Name|Version"
If you see HTTP/2 in the response and you’re running Node < 20.11 or h2 < 4.1.1, you are in the blast radius.
Step 2 — Patch to safe versions
| Runtime / Server | Vulnerable | Patched Version | Action |
|---|---|---|---|
| Node.js | < 20.11.1, < 21.6.2 |
20.11.1 / 21.6.2+ |
nvm install --lts |
Python h2 |
< 4.1.1 |
4.1.1+ |
pip install -U h2 |
| Hypercorn | < 0.16.0 |
0.16.0+ |
pip install -U hypercorn |
| uvicorn | < 0.29.0 |
0.29.0+ |
pip install -U uvicorn |
| Envoy | < 1.29.2 |
1.29.2+ |
Rebuild image |
| Nginx | < 1.25.4 |
1.25.4+ |
apt upgrade nginx |
Step 3 — Apply the temporary workaround (if you can’t patch today)
Disable HTTP/2 at the edge until patched:
- Nginx: remove
http2from thelisten 443 ssl http2;directive. - Envoy: set
http2_protocol_options: { allow_connect: false }and capmax_concurrent_streams. - Node: force HTTP/1.1 by removing
http2.createSecureServerin favor ofhttps.createServer.
Step 4 — Add WAF rules
Block malformed pseudo-headers and oversized :path values:
# Block suspicious HTTP/2 pseudo-header abuse
SecRule REQUEST_HEADERS ":path" "@rx [\x00-\x1f]" "id:1001,deny,status:400"
Step 5 — Verify the fix
nuclei -u https://yourdomain.com -t http/cves/ -tags http2
A clean scan plus a version check against the table above confirms remediation.
Common Issues, Alternatives, and What You Should Know
- False sense of security from TLS termination: If your CDN (Cloudflare, Fastly) terminates HTTP/2, the origin may still speak HTTP/2 internally. Patch both layers.
- Container images lag behind: Base images like
node:18-alpinemay pin old versions. Rebuild with--pullor pin digests. - Kubernetes ingress: Contour and Traefik users should upgrade to Contour
1.27.0+and Traefik2.11.0+. - Detection gap: Most EDR tools don’t parse HTTP/2 frames. Enable verbose access logs (
$http2in Nginx) to spot anomalies. - Cost of inaction: Post-exploitation typically involves cryptominers and credential harvesting within 48 hours of exposure, per Aikido Security’s advisory.
Frequently Asked Questions (FAQ)
What exactly does http2shell exploit?
It chains HTTP/2 header injection with unsafe shell interpolation in server request handlers, letting an attacker pass crafted :path or :authority values that reach a shell call — resulting in RCE.
Does http2shell affect HTTP/1.1 servers?
No — the attack vector requires HTTP/2 framing. However, if you disable HTTP/2 as a workaround, verify no other smuggling path exists via HTTP/1.1 Transfer-Encoding quirks.
Is there a CVE for http2shell?
The disclosure spans multiple CVEs across runtimes rather than one identifier. Track the vendor advisories for Node, Python h2, Envoy, and Nginx directly.
How do I know if I’ve been exploited?
Look for unexpected child processes spawned by your web server user, outbound connections to unknown IPs on ports 3333/4444, and modified crontabs. Run ps aux | grep -E "sh -c|curl|wget" on web nodes.
Final Verdict
Treat http2shell as a patch-now emergency, not a backlog item. Upgrade Node to 20.11.1+, Python h2 to 4.1.1+, and Envoy to 1.29.2+ today. If you cannot patch within hours, disable HTTP/2 at the edge as a stopgap and enable WAF pseudo-header rules. Then run an authenticated scan to confirm — and add HTTP/2 frame logging to your monitoring so the next variant doesn’t catch you blind.