HIGH 8.7

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)

ArtifactAffected versionsFixed 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

1affected artifacts
210affected versions
10,340dependent artifacts (est.)
555,307dependent versions

64% of the dependent artifacts (6,685) still pull an affected version in their latest release.

DepthDependent 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

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.