CVE-2026-55851
Netty: [codec-haproxy] Signed-Byte Sentinel Collision in HAProxyMessageDecoder Leads to Unbounded Memory Exhaustion
Description
The HAProxyMessageDecoder in netty's codec-haproxy module performs protocol version detection by reading the 13th byte of the inbound stream as a signed Java byte and widening it to int without masking. When an attacker sends a PROXY protocol v2 binary prefix (0D 0A 0D 0A 00 0D 0A 51 55 49 54 0A) followed by version byte 0xFF, the sign extension produces -1, which collides with the decoder's "need more data" sentinel value. This collision traps the decoder in a version-detection loop where it perpetually requests more data without consuming any bytes, never instantiates the HeaderExtractor that enforces header size limits, and causes ByteToMessageDecoder to accumulate all subsequent inbound bytes into an unbounded cumulation buffer until the JVM exhausts its direct memory allocation.
Affected Maven artifacts (1)
| Artifact | Affected versions | Fixed in |
|---|---|---|
| io.netty » netty-codec-haproxy | >= 4.1.0.Final, < 4.1.136.Final>= 4.2.0.Final, < 4.2.16.Final | 4.1.136.Final, 4.2.16.Final |
Blast radius
64% of the dependent artifacts (6,685) still pull an affected version in their latest release.
| Depth | Dependent versions |
|---|---|
| Direct | 7,202 |
| 2 hops | 74,196 |
| 3 hops | 228,331 |
| 4 hops | 137,050 |
| 5 hops | 81,668 |
| 6 hops | 26,860 |
Most used dependents
- io.netty » netty-all3,584 usages
- org.apache.hadoop » hadoop-common3,482 usages
- org.apache.spark » spark-sql3,174 usages
- org.apache.spark » spark-core2,899 usages
- org.apache.zookeeper » zookeeper2,044 usages
- org.apache.hadoop » hadoop-client1,796 usages
- org.apache.kafka » kafka1,450 usages
- org.apache.hadoop » hadoop-hdfs1,377 usages
- org.apache.hadoop » hadoop-mapreduce-client-core1,366 usages
- io.quarkus » quarkus-resteasy1,251 usages
- org.apache.curator » curator-recipes1,197 usages
- org.apache.curator » curator-framework1,070 usages
- org.apache.curator » curator-test1,002 usages
- org.apache.flink » flink-streaming-java982 usages
- org.apache.hbase » hbase-client960 usages
Computed from the dependency graph of build 20261124.0621 (compile and runtime scopes, nearest version wins). Exclusions and dependency management in consuming projects are not applied, so dependents are potentially affected. When several artifacts are affected, a dependent version that pulls more than one of them is counted once per artifact.
References
- Webhttps://github.com/netty/netty/security/advisories/GHSA-q6cq-mhr2-jmr5
- Advisoryhttps://nvd.nist.gov/vuln/detail/CVE-2026-55851
- Webhttps://github.com/netty/netty/commit/5b68c61f37aa4a3045cba624cbea239655c9003b
- Webhttps://github.com/netty/netty/commit/bb2ff68a1fb71cb4b0eb9a9e17b66c52aff680c6
- Packagehttps://github.com/netty/netty
- Webhttps://github.com/netty/netty/releases/tag/netty-4.1.136.Final
- Webhttps://github.com/netty/netty/releases/tag/netty-4.2.16.Final
