Loading advisory.
Loading advisory.
netty-incubator-codec-ohttp: Binary HTTP parser infinite loop on known-length field section boundary
io.netty.incubator:netty-incubator-codec-bhttp can enter a non-terminating parse loop when a known-length Binary HTTP field section ends exactly after a complete field line.
Published 2026-08-20 18:43 UTC · Modified 2026-11-20 17:53 UTC
Severity and EPSS are shown separately. Helm does not combine them into one score. How tiers work
| Package | Ecosystem | Affected | Fixed in | Upgrade command |
|---|---|---|---|---|
| io.netty.incubator:netty-incubator-codec-bhttp | Maven | < 0.0.23.Final versions 0.0.1.Final, 0.0.10.Final, 0.0.11.Final, 0.0.12.Final, 0.0.13.Final, 0.0.14.Final, 0.0.15.Final, 0.0.16.Final, 0.0.17.Final, 0.0.18.Final, 0.0.19.Final, 0.0.2.Final, 0.0.20.Final, 0.0.21.Final, 0.0.22.Final, 0.0.3.Final, 0.0.4.Final, 0.0.5.Final, 0.0.6.Final, 0.0.7.Final and 2 more | 0.0.23.Final | No single command for Maven. Update to 0.0.23.Final in your build file. |
io.netty.incubator:netty-incubator-codec-bhttp can enter a non-terminating parse loop when a known-length Binary HTTP field section ends exactly after a complete field line. A remote peer that can send Binary HTTP input to a Netty pipeline using BinaryHttpParser / BinaryHttpDecoder can use a tiny malformed request or response to keep the parsing thread busy indefinitely, causing denial of service.
In codec-bhttp/src/main/java/io/netty/incubator/codec/bhttp/BinaryHttpParser.java, readFieldSection(...) tracks the remaining field-section length in fieldSectionLength, then repeatedly calls readFieldLine(...) until the length reaches zero:
readFieldSection(...) parses the known-length field section and enters while (fieldSectionLength != 0) at BinaryHttpParser.java:619.
Inside the loop, it records readableBytes, calls readFieldLine(...), computes read = readableBytes - in.readableBytes(), asserts read > 0, and subtracts read from fieldSectionLength at BinaryHttpParser.java:620-625.
readFieldLine(...) returns null without consuming bytes when the field line ends exactly at the end of the readable slice because it uses if (sumBytes >= in.readableBytes()) return null after adding the value length (BinaryHttpParser.java:678-681).
With JVM assertions disabled (the production default), assert read > 0 is not active. The parser therefore subtracts zero forever and never returns.
The boundary condition is reachable with a valid known-length field section containing exactly one complete field line and no extra byte after that line. Example field section: length 4, then name length 1, name a, value length 1, value b.
Safe local verification performed in this repository:
Compile the module and classpath:
./mvnw -q -pl codec-bhttp -am compile test-compile
./mvnw -q -pl codec-bhttp dependency:build-classpath -Dmdep.outputFile=/tmp/codec-bhttp-cp.txt
printf '%s' "codec-bhttp/target/classes:$(cat /tmp/codec-bhttp-cp.txt)" > /tmp/codec-bhttp-run-cp.txtCompile and run this minimal verifier with production-style assertions disabled:
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import io.netty.incubator.codec.bhttp.BinaryHttpParser;
import io.netty.incubator.codec.bhttp.VarIntCodecUtils;
import java.nio.charset.StandardCharsets;
public final class VerifyBhttpHang {
private static void writeAscii(ByteBuf out, String value) {
VarIntCodecUtils.writeVariableLengthInteger(out, value.length());
out.writeCharSequence(value, StandardCharsets.US_ASCII);
}
public static void main(String[] args) {
ByteBuf buffer = Unpooled.buffer();
VarIntCodecUtils.writeVariableLengthInteger(buffer, 0); // known-length request
writeAscii(buffer, "GET");
writeAscii(buffer, "https");
writeAscii(buffer, "example.com");
writeAscii(buffer, "/");
VarIntCodecUtils.writeVariableLengthInteger(buffer, 4); // field section length
writeAscii(buffer, "a");
writeAscii(buffer, "b");
new BinaryHttpParser(8192).parse(buffer, false);
System.out.println("returned");
}
}Execution result observed locally:
timeout 3 java -cp "/tmp:$(cat /tmp/codec-bhttp-run-cp.txt)" VerifyBhttpHang
exit=124Exit code 124 from timeout confirms the parser did not return within three seconds. When assertions are enabled by Surefire, the same payload fails at BinaryHttpParser.java:622 (assert read > 0), confirming the non-progress condition.
A peer that can deliver crafted BHTTP bytes can cause the parser to loop forever. In Netty deployments this can pin the event-loop thread or worker responsible for the channel, reducing or eliminating availability for other channels on the same event loop. Through OHTTP, the same parser is used after successful decryption of protected payloads, so authenticated/decryptable OHTTP peers can trigger the same condition in the inner BHTTP parser.
Treat readFieldLine(...) == null as incomplete input and return null from readFieldSection(...) instead of continuing.
Replace boundary checks in readFieldLine(...) that require an extra byte after a complete field line. A complete field line ending exactly at the known field-section boundary should be accepted.
Add a production runtime guard that throws a controlled decoder exception if a parser loop iteration makes no progress.
Add regression tests with JVM assertions disabled for known-length header and trailer field sections that end exactly at the field-section boundary.
codec-bhttp/src/main/java/io/netty/incubator/codec/bhttp/BinaryHttpParser.java:619-625
codec-bhttp/src/main/java/io/netty/incubator/codec/bhttp/BinaryHttpParser.java:678-681
RFC 9292: Binary Representation of HTTP Messages
No public exploit code known to Helm's sources (Nuclei templates, Metasploit, Exploit-DB and PoC-in-GitHub). That does not mean none exists.
EPSS went from 0.003 on 2026-11-24 to 0.006 on 2026-11-26, over 2 recorded scores.
| Date | Score | Previous | Model |
|---|---|---|---|
| 2026-11-24 | 0.003 | first score | v2026.06.15 |
| 2026-11-26 | 0.006 | 0.003 | v2026.06.15 |