CVE-2024-40642
Absent Input Validation in BinaryHttpParser in the netty incubator codec.bhttp
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.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- High
- Privileges needed
- None
- User interaction
- None
What an attacker can affect
- Confidentiality
- High
- Integrity
- High
- Availability
- High
Exploit likelihood
What each source reports
CVE List Score used
8.1
Absent Input Validation in BinaryHttpParser in the netty incubator codec.bhttp
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.
- Record
CVE-2024-40642- CVSS 3.1
- 8.1 High
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H - Weakness
- CWE-20
- Updated
- 2026-11-02
EUVDEUVD-2024-2401
8.1
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.
- Record
EUVD-2024-2401- CVSS 3.1
- 8.1 High
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H - Updated
- 2026-11-03
GitHub AdvisoriesGHSA-q8f2-hxq5-cp4h
8.1
Absent Input Validation in BinaryHttpParser
Summary
BinaryHttpParser 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.
Details
Path, Authority, Scheme 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 algorithm to create a variable length integer value is below:
def encode_int(n):
if n < 64:
base = 0x00
l = 1
elif n in range(64, 16384):
base = 0x4000
l = 2
elif n in range(16384, 1073741824):
base = 0x80000000
l = 4
else:
base = 0xc000000000000000
l = 8
encoded = base | n
return encoded.to_bytes()
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.
//netty-incubator-codec-ohttp/codec-bhttp/src/main/java/io/netty/incubator/codec/bhttp/BinaryHttpParser.java
public final class BinaryHttpParser {
...
private static BinaryHttpRequest readRequestHead(ByteBuf in, boolean knownLength, int maxFieldSectionSize) {
...
final long pathLength = getVariableLengthInteger(in, pathLengthIdx, pathLengthBytes);
...
final int pathIdx = pathLengthIdx + pathLengthBytes;
...
/*417*/ String method = in.toString(methodIdx, (int) methodLength, StandardCharsets.US_ASCII);
/*418*/ String scheme = in.toString(schemeIdx, (int) schemeLength, StandardCharsets.US_ASCII);
/*419*/ String authority = in.toString(authorityIdx, (int) authorityLength, StandardCharsets.US_ASCII);
/*420*/ String path = in.toString(pathIdx, (int) pathLength, StandardCharsets.US_ASCII);
/*422*/ BinaryHttpRequest request = new DefaultBinaryHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.valueOf(method),
scheme, authority, path, headers);
in.skipBytes(sumBytes);
return request;
}
...
}
Request Method
On line 422 above, the parsed method value is passed into HttpMethod.valueOf method. The return value from this is passed to the DefaultBinaryHttpRequest constructor.
Below is the code for HttpMethod.valueOf:
public static HttpMethod valueOf(String name) {
// fast-path
if (name == HttpMethod.GET.name()) {
return HttpMethod.GET;
}
if (name == HttpMethod.POST.name()) {
return HttpMethod.POST;
}
// "slow"-path
HttpMethod result = methodMap.get(name);
return result != null ? result : new HttpMethod(name);
}
If the result of methodMap.get is not null, then a new arbitrary HttpMethod instance will be returned using the provided name value.
methodMap is an instance of type EnumNameMap which is also defined within the HttpMethod class:
EnumNameMap(Node<T>... nodes) {
this.values = (Node[])(new Node[MathUtil.findNextPositivePowerOfTwo(nodes.length)]);
this.valuesMask = this.values.length - 1;
Node[] var2 = nodes;
int var3 = nodes.length;
for(int var4 = 0; var4 < var3; ++var4) {
Node<T> node = var2[var4];
int i = hashCode(node.key) & this.valuesMask;
if…
- Record
GHSA-q8f2-hxq5-cp4h- CVSS 3.1
- 8.1 High
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H - Weakness
- CWE-20
- Updated
- 2026-11-02
NVD
8.1
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.
- Record
CVE-2024-40642- CVSS 3.1
- 8.1 High
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H - Weakness
- CWE-20
- Updated
- 2026-11-02
OSV
8.1
Absent Input Validation in BinaryHttpParser in the netty incubator codec.bhttp
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.
- Record
CVE-2024-40642- CVSS 3.1
- 8.1 High
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H - Weakness
- CWE-20
- Updated
- 2026-11-02
OSVGHSA-q8f2-hxq5-cp4h
8.1
Absent Input Validation in BinaryHttpParser
Summary
BinaryHttpParser 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.
Details
Path, Authority, Scheme 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 algorithm to create a variable length integer value is below:
def encode_int(n):
if n < 64:
base = 0x00
l = 1
elif n in range(64, 16384):
base = 0x4000
l = 2
elif n in range(16384, 1073741824):
base = 0x80000000
l = 4
else:
base = 0xc000000000000000
l = 8
encoded = base | n
return encoded.to_bytes()
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.
//netty-incubator-codec-ohttp/codec-bhttp/src/main/java/io/netty/incubator/codec/bhttp/BinaryHttpParser.java
public final class BinaryHttpParser {
...
private static BinaryHttpRequest readRequestHead(ByteBuf in, boolean knownLength, int maxFieldSectionSize) {
...
final long pathLength = getVariableLengthInteger(in, pathLengthIdx, pathLengthBytes);
...
final int pathIdx = pathLengthIdx + pathLengthBytes;
...
/*417*/ String method = in.toString(methodIdx, (int) methodLength, StandardCharsets.US_ASCII);
/*418*/ String scheme = in.toString(schemeIdx, (int) schemeLength, StandardCharsets.US_ASCII);
/*419*/ String authority = in.toString(authorityIdx, (int) authorityLength, StandardCharsets.US_ASCII);
/*420*/ String path = in.toString(pathIdx, (int) pathLength, StandardCharsets.US_ASCII);
/*422*/ BinaryHttpRequest request = new DefaultBinaryHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.valueOf(method),
scheme, authority, path, headers);
in.skipBytes(sumBytes);
return request;
}
...
}
Request Method
On line 422 above, the parsed method value is passed into HttpMethod.valueOf method. The return value from this is passed to the DefaultBinaryHttpRequest constructor.
Below is the code for HttpMethod.valueOf:
public static HttpMethod valueOf(String name) {
// fast-path
if (name == HttpMethod.GET.name()) {
return HttpMethod.GET;
}
if (name == HttpMethod.POST.name()) {
return HttpMethod.POST;
}
// "slow"-path
HttpMethod result = methodMap.get(name);
return result != null ? result : new HttpMethod(name);
}
If the result of methodMap.get is not null, then a new arbitrary HttpMethod instance will be returned using the provided name value.
methodMap is an instance of type EnumNameMap which is also defined within the HttpMethod class:
EnumNameMap(Node<T>... nodes) {
this.values = (Node[])(new Node[MathUtil.findNextPositivePowerOfTwo(nodes.length)]);
this.valuesMask = this.values.length - 1;
Node[] var2 = nodes;
int var3 = nodes.length;
for(int var4 = 0; var4 < var3; ++var4) {
Node<T> node = var2[var4];
int i = hashCode(node.key) & this.valuesMask;
if…
- Record
GHSA-q8f2-hxq5-cp4h- CVSS 3.1
- 8.1 High
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H - Weakness
- CWE-20
- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
io.netty.incubator:netty-incubator-codec-bhttpMaven |
before 0.0.13.Final | 0.0.13.Final |
io.netty.incubator:netty-incubator-codec-bhttpMaven |
before 0.0.13.Final, plus listed versions 0.0.1.Final0.0.10.Final0.0.11.Final0.0.12.Final0.0.2.Final Show 7 moreShow less0.0.3.Final0.0.4.Final0.0.5.Final0.0.6.Final0.0.7.Final0.0.8.Final0.0.9.Final |
0.0.13.Final |
History
| Recorded | Changed | Sources |
|---|---|---|
| aliases | EUVD | |
| first indexed | CVE List, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2024-40642 is a high vulnerability (CVSS 8.1) in Netty Netty-incubator-codec-ohttp, published July 18, 2024. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.68%, the 52nd percentile. Fixed in io.netty.incubator:netty-incubator-codec-bhttp 0.0.13.Final.
References
github.com/netty/netty-incubator-codec-ohttp/security/advisories/GHSA-q8f2-hxq5-cp4h
github.com/netty/netty-incubator-codec-ohttp/commit/b687a0cf6ea1030232ea204d73bce82f2698e571
nvd.nist.gov/vuln/detail/CVE-2024-40642
github.com/advisories/GHSA-q8f2-hxq5-cp4h
github.com/CVEProject/cvelistV5/tree/main/cves/2024/40xxx/CVE-2024-40642.json
github.com/netty/netty-incubator-codec-ohttp
Left out here: the rest of 2 source descriptions. The JSON record has them.