Fedora Account System
Red Hat Associate
Red Hat Customer
When HAProxyMessageDecoder decodes a PROXY v2 header, direct child TLVs of a PP2_TYPE_SSL TLV are exposed both as children of the SSL TLV and as flattened entries in HAProxyMessage.tlvs(). HAProxyMessageEncoder then encodes the SSL TLV's children recursively and also iterates the flattened list as top-level TLVs. The PROXY v2 length field is computed from one TLV layout, while the bytes actually written follow a different one, because the encoder also advances the reader indexes of TLV content while encoding. As a result, re-encoding a decoded message that contains nested SSL TLVs produces a PROXY v2 frame whose declared length is larger than the number of bytes written. A downstream PROXY v2 decoder consumes bytes from the start of the following application stream to fill the advertised length. An attacker who can send or influence an accepted PROXY v2 header can therefore cause TLV-shaped bytes from the application stream to be interpreted as PROXY metadata, such as an injected ALPN TLV. If the following bytes are not TLV-shaped, downstream PROXY parsing can stall or close the connection. The impact is integrity loss through TLV injection and stream desynchronization, plus limited denial of service. Downstream routing, ALPN or authority handling, TLS or client-certificate metadata checks, and other decisions that trust PROXY v2 TLVs may be affected. Affected are users of netty-codec-haproxy who decode PROXY v2 messages with HAProxyMessageDecoder and forward the decoded HAProxyMessage by re-encoding it with HAProxyMessageEncoder, as in multi-hop proxy deployments. The issue affects versions 4.1.49.Final through 4.1.138.Final and 4.2.0.Final through 4.2.18.Final. It is fixed in 4.1.139.Final and 4.2.19.Final. Affected versions: >= 4.1.49.Final, <= 4.1.138.Final; >= 4.2.0.Final, <= 4.2.18.Final Patched versions: 4.1.139.Final; 4.2.19.Final CVSS: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:L (8.2) CWE: CWE-130, CWE-436 Upstream advisory: https://github.com/netty/netty/security/advisories/GHSA-frq3-7pw6-36cg CVE requested by the Netty Project via PSIRTSUPT-32166.