The vulnerability lies in the HTTP parser of the blaze library, which had several laxities in its implementation, making it susceptible to HTTP request smuggling attacks. The analysis of the provided patches reveals that the core of the vulnerability is located in two main functions: org.http4s.blaze.server.Http1ServerParser.headerComplete and org.http4s.blaze.http.parser.BodyAndHeaderParser.parseHeaders. These functions were responsible for parsing and validating HTTP headers. The patches introduce stricter checks in these functions to adhere more closely to RFC specifications. Specifically, the patches add validations to:
- Reject headers with
obs-fold.
- Reject duplicate
Content-Length headers.
- Reject requests that have both
Transfer-Encoding and Content-Length headers.
- Ensure header names consist of valid
tchar characters.
- Reject
Transfer-Encoding values other than chunked.
Prior to these patches, the lack of these validations meant that blaze could interpret a malformed HTTP request differently from a front-end proxy server, creating the disagreement in request boundaries that is necessary for request smuggling. An attacker could exploit this to bypass security controls, poison web caches, or desynchronize the request queue to obtain responses meant for other users. Therefore, any runtime profile of a vulnerable application would show these two functions, Http1ServerParser.headerComplete and BodyAndHeaderParser.parseHeaders, as the key entry points for processing potentially malicious HTTP requests.