Netty, HTTP Header Injection, CVE-N/A (High)

Listen to this Post

How the mentioned CVE works (20 lines):

  1. Netty’s `HttpProxyHandler` constructs HTTP CONNECT requests for proxy tunneling.
  2. The `newInitialMessage()` method (line 176) creates headers using DefaultHttpHeadersFactory.headersFactory().withValidation(false).
  3. This explicitly disables CRLF validation, which was meant to be fixed by advisory GHSA-84h7-rjj3-6jx4.
  4. User-controlled `outboundHeaders` are passed via the `HttpProxyHandler` constructor.
  5. At lines 188‑190, `req.headers().add(outboundHeaders)` adds those headers without any sanitization.
  6. An attacker can inject CRLF sequences ( `\r\n` ) into header values.
  7. Because validation is off, the CRLF is not rejected or encoded.
  8. The injected CRLF terminates the current header and starts a new one.
  9. This allows arbitrary HTTP headers to be inserted into the CONNECT request.
  10. The proxy server receives the altered request, believing it to be legitimate.
  11. Example injection: `”1.2.3.4\r\nProxy-Authorization: Basic …”` adds a `Proxy-Authorization` header.
  12. This can bypass proxy authentication if the injected header overrides the original.
  13. Another attack: inject `Transfer-Encoding: chunked` and a smuggled request body.
  14. The proxy may then forward the smuggled request to an internal service.
  15. The root cause is an incomplete fix – GHSA-84h7-rjj3-6jx4 enabled validation globally, but `HttpProxyHandler` opted out.
  16. The `outboundHeaders` come directly from application code that might reflect user input.
  17. No CRLF checking occurs even for header values that contain newlines.
  18. The vulnerability affects all Netty versions prior to the patch (e.g., 4.2.12.Final and earlier).
  19. The attack requires that the application uses `HttpProxyHandler` with attacker‑influenced headers.
  20. Exploitation is remote, low complexity, and requires no privileges, leading to high integrity impact.

dailycve form:

Platform: Netty
Version: 4.2.12.Final
Vulnerability: HTTP Header Injection
Severity: High
date: 2026-05-07

Prediction: Patch expected 2026-06-15

What Undercode Say:

Check if your Netty version is vulnerable
mvn dependency:tree | grep netty
Extract HttpProxyHandler class
jar xf netty-handler-4.2.12.Final.jar io/netty/handler/proxy/HttpProxyHandler.class
javap -c io.netty.handler.proxy.HttpProxyHandler | grep -A5 "newInitialMessage"
Test header validation status via reflection (simplified)
echo "HttpHeadersFactory factory = DefaultHttpHeadersFactory.headersFactory(); boolean valid = factory.withValidation(false).isValidation(); echo $valid"

Exploit:

// Attacker-controlled user input
String malicious = "1.2.3.4\r\nX-Admin: true\r\nProxy-Authorization: Basic hacked";
HttpHeaders headers = new DefaultHttpHeaders(false);
headers.set("X-Forwarded-For", malicious);
new HttpProxyHandler(proxyAddr, headers);
// Resulting wire: CRLF injection creates extra headers.

Protection from this CVE:

  • Upgrade to Netty version >= 4.2.13.Final (once patched).
  • Remove `.withValidation(false)` in `HttpProxyHandler` (line 176) – use default factory.
  • Validate all `outboundHeaders` manually with HttpUtil.validateHeaderValue().
  • Sanitize user input – reject or encode CRLF characters (\r, \n).
  • Apply a WAF rule to block CRLF sequences in proxy requests.

Impact:

  • Proxy Authentication Bypass – attacker injects `Proxy-Authorization` to gain unauthorized proxy access.
  • Request Smuggling – injected `Transfer-Encoding` splits the request, leading to internal service compromise.
  • Header Injection – arbitrary headers (e.g., X-Forwarded-For, Cookie) can be added, poisoning logs or altering backend behavior.
  • Integrity loss (High) – no confidentiality or availability impact, but data integrity is fully compromised.

🎯Let’s Practice Exploiting & Learn Patching For Free:

Sources:

Reported By: github.com
Extra Source Hub:
Undercode

🔐JOIN OUR CYBER WORLD [ CVE News • HackMonitor • UndercodeNews ]

💬 Whatsapp | 💬 Telegram

📢 Follow DailyCVE & Stay Tuned:

𝕏 formerly Twitter 🐦 | @ Threads | 🔗 Linkedin Featured Image

Scroll to Top