CVE-2024-40642 Absent Input Validation in BinaryHttpParser in the netty incubator codec.bhttp
Attackers can exploit missing input validation in the Netty binary HTTP parser to perform injection attacks, request smuggling, and SSRF.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2024-40642?
CVE-2024-40642 is a high-severity vulnerability in netty-incubator-codec-ohttp, published on 18 Jul 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
The netty incubator codec.bhttp is a java language binary http parser. In affected versions the `BinaryHttpParser` class does not properly validate input values thus giving attackers almost complete control over the HTTP requests constructed from the parsed output. Attackers can abuse several issues individually to perform various injection attacks including HTTP request smuggling, desync attacks, HTTP header injections, request queue poisoning, caching attacks and Server Side Request Forgery (SSRF). Attacker could also combine several issues to create well-formed messages for other text-based protocols which may result in attacks beyond the HTTP protocol. The BinaryHttpParser class implements the readRequestHead method which performs most of the relevant parsing of the received request. The data structure prefixes values with a variable length integer value. The parsing code below first gets the lengths of the values from the prefixed variable length integer. After it has all of the lengths and calculates all of the indices, the parser casts the applicable slices of the ByteBuf to String. Finally, it passes these values into a new `DefaultBinaryHttpRequest` object where no further parsing or validation occurs. Method is partially validated while other values are not validated at all. Software that relies on netty to apply input validation for binary HTTP data may be vulnerable to various injection and protocol based attacks. This issue has been addressed in version 0.0.13.Final. Users are advised to upgrade. There are no known workarounds for this vulnerability.
Weakness: CWE-20
Which versions are affected by CVE-2024-40642?
2 open source packages ship an affected version, including io.netty.incubator:netty-incubator-codec-bhttp. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
io.netty.incubator:netty-incubator-codec-bhttp Maven | All versions | 0.0.13.Final |
io.netty.incubator:netty-incubator-codec-bhttp Maven | All versions | 0.0.13.Final |
Products include Netty Netty-Incubator-Codec-Ohttp.
How do I fix CVE-2024-40642?
Upgrade io.netty.incubator:netty-incubator-codec-bhttp to 0.0.13.Final or later.
Is CVE-2024-40642 being exploited?
There is no known exploitation of CVE-2024-40642 in the wild and no public exploit code.
Other vulnerabilities in netty-incubator-codec-ohttp
- CVE-2026-41207 netty-incubator-codec-ohttp's HPKEContext operations may produce empty byte[] on failures
- CVE-2026-48040 netty-incubator-codec-ohttp's Incorrect Native Pointer Derivation in Pooled Direct ByteBuf Fallback Leads to Out-of-Bounds Native Memory Access
- CVE-2024-36121 netty-incubator-codec-ohttp's BoringSSLAEADContext Repeats Nonces
Sources
Also known as GHSA-q8f2-hxq5-cp4h.