Miggo Logo

CVE-2025-59822: Http4s vulnerable to HTTP Request Smuggling due to improper handling of HTTP trailer section

N/A

CVSS Score

Basic Information

EPSS Score
0.12189%
Published
9/23/2025
Updated
9/23/2025
KEV Status
No
Technology
TechnologyJava

Technical Details

CVSS Vector
-
Package NameEcosystemVulnerable VersionsFirst Patched Version
org.http4s:http4s-ember-core_2.12maven< 0.23.310.23.31
org.http4s:http4s-ember-core_2.13maven< 0.23.310.23.31
org.http4s:http4s-ember-core_3maven< 0.23.310.23.31
org.http4s:http4s-ember-core_2.13maven>= 1.0.0-M1, < 1.0.0-M451.0.0-M45
org.http4s:http4s-ember-core_3maven>= 1.0.0-M1, < 1.0.0-M451.0.0-M45

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability is a classic HTTP Request Smuggling issue (CWE-444) within the http4s library, specifically in the ember-core module. The root cause lies in the incorrect parsing of HTTP trailer headers.

The core of the vulnerability is in the org.http4s.ember.core.Parser.HeaderP.parse function. The original implementation had flawed logic that would incorrectly identify the end of the headers. When parsing a header line that was missing the expected colon (:), the parser would not raise an error but would instead continue until it found a single carriage return/line feed (CRLF). It would then incorrectly terminate the header parsing process. This allowed an attacker to craft a chunked HTTP request where the trailer section contained a malformed header followed by a complete, second HTTP request. The server would parse up to the malformed trailer, stop, and then process the remaining data in the buffer as a new, smuggled request.

The exploitation is initiated when the application processes a chunked request with trailers. The function org.http4s.ember.core.ChunkedEncoding.parseTrailers is responsible for this, and it directly invokes the vulnerable parse method. Therefore, both functions are critical runtime indicators of this vulnerability being triggered.

The patch addresses the vulnerability by introducing stricter validation within the parse function. It now explicitly checks for and rejects invalid characters (like whitespace) in a header field name, throwing a ParseHeadersError. This prevents the parser from being tricked into prematurely ending the header section, thus mitigating the request smuggling vulnerability.

Vulnerable functions

org.http4s.ember.core.Parser.HeaderP.parse
ember-core/shared/src/main/scala/org/http4s/ember/core/Parser.scala
This function is responsible for parsing HTTP headers. The vulnerability lies in its improper handling of malformed header lines, specifically those without a colon. The original logic would prematurely terminate header parsing upon encountering a single CRLF, allowing the subsequent data in the request body (the smuggled request) to be processed as a separate, new request by the server.
org.http4s.ember.core.ChunkedEncoding.parseTrailers
ember-core/shared/src/main/scala/org/http4s/ember/core/ChunkedEncoding.scala
This function is called to parse the trailer section of a chunked encoded HTTP request. It directly calls the vulnerable `org.http4s.ember.core.Parser.HeaderP.parse` function. During an attack, an attacker sends a request with a specially crafted trailer section. This function processes that section, triggering the parsing vulnerability and leading to request smuggling. Therefore, it would be present in the stack trace during exploitation.

WAF Protection Rules

WAF Rule

### Summ*ry *ttp*s is vuln*r**l* to *TTP R*qu*st Smu**lin* *u* to improp*r **n*lin* o* *TTP tr*il*r s**tion. T*is vuln*r**ility *oul* *n**l* *tt**k*rs to: - *yp*ss *ront-*n* s*rv*rs s**urity *ontrols - L*un** t*r**t** *tt**ks ***inst **tiv* us*rs - P

Reasoning

T** vuln*r**ility is * *l*ssi* *TTP R*qu*st Smu**lin* issu* (*W*-***) wit*in t** *ttp*s li*r*ry, sp**i*i**lly in t** *m**r-*or* mo*ul*. T** root **us* li*s in t** in*orr**t p*rsin* o* *TTP tr*il*r *****rs. T** *or* o* t** vuln*r**ility is in t** `or