CVE-2020-1935 - Inconsistent Interpretation of HTTP Requests ('HTTP Request Smuggling')

Severity

48%

Complexity

22%

Confidentiality

41%

In Apache Tomcat 9.0.0.M1 to 9.0.30, 8.5.0 to 8.5.50 and 7.0.0 to 7.0.99 the HTTP header parsing code used an approach to end-of-line parsing that allowed some invalid HTTP headers to be parsed as valid. This led to a possibility of HTTP Request Smuggling if Tomcat was located behind a reverse proxy that incorrectly handled the invalid Transfer-Encoding header in a particular manner. Such a reverse proxy is considered unlikely.

In Apache Tomcat 9.0.0.M1 to 9.0.30, 8.5.0 to 8.5.50 and 7.0.0 to 7.0.99 the HTTP header parsing code used an approach to end-of-line parsing that allowed some invalid HTTP headers to be parsed as valid. This led to a possibility of HTTP Request Smuggling if Tomcat was located behind a reverse proxy that incorrectly handled the invalid Transfer-Encoding header in a particular manner. Such a reverse proxy is considered unlikely.

CVSS 3.1 Base Score 4.8. CVSS Attack Vector: network. CVSS Attack Complexity: high. CVSS Vector: (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N).

CVSS 2.0 Base Score 5.8. CVSS Attack Vector: network. CVSS Attack Complexity: medium. CVSS Vector: (AV:N/AC:M/Au:N/C:P/I:P/A:N).

Demo Examples

Inconsistent Interpretation of HTTP Requests ('HTTP Request Smuggling')

CWE-444

In the following example, a malformed HTTP request is sent to a website that includes a proxy server and a web server with the intent of poisoning the cache to associate one webpage with another malicious webpage.


               
Connection: Keep-Alive

When this request is sent to the proxy server, the proxy server parses the POST request in the first seven lines, and encounters the two "Content-Length" headers. The proxy server ignores the first header, so it assumes the request has a body of length 44 bytes. Therefore, it treats the data in the next three lines that contain exactly 44 bytes as the first request's body. The proxy then parses the last three lines which it treats as the client's second request.

The request is forwarded by the proxy server to the web server. Unlike the proxy, the web server uses the first "Content-Length" header and considers that the first POST request has no body, and the second request is the line with the first GET (note that the second GET is parsed by the web server as the value of the "Bla" header).

The requests the web server sees are "POST /foobar.html" and "GET /poison.html", so it sends back two responses with the contents of the "foobar.html" page and the "poison.html" page, respectively. The proxy matches these responses to the two requests it thinks were sent by the client "POST /foobar.html" and "GET /page_to_poison.html". If the response is cacheable, the proxy caches the contents of "poison.html" under the URL "page_to_poison.html", and the cache is poisoned! Any client requesting "page_to_poison.html" from the proxy would receive the "poison.html" page.

When a website includes both a proxy server and a web server some protection against this type of attack can be achieved by installing a web application firewall, or use a web server that includes a stricter HTTP parsing procedure or make all webpages non-cacheable.

Additionally, if a web application includes a Java servlet for processing requests, the servlet can check for multiple "Content-Length" headers and if they are found the servlet can return an error response thereby preventing the poison page to be cached, as shown below.


               
}
} catch (Exception ex) {...}// Set up response writer object
}// check for multiple content length headers
count++;
// output error response
// process request

Inconsistent Interpretation of HTTP Requests ('HTTP Request Smuggling')

CWE-444

In the following example, a malformed HTTP request is sent to a website that includes a web server with a firewall with the intent of bypassing the web server firewall to smuggle malicious code into the system..


               
Connection: Keep-Alive

When this request is sent to the web server, the first POST request has a content-length of 49,223 bytes, and the firewall treats the line with 49,152 copies of "z" and the lines with an additional lines with 71 bytes as its body (49,152+71=49,223). The firewall then continues to parse what it thinks is the second request starting with the line with the third POST request.

Note that there is no CRLF after the "Bla: " header so the POST in the line is parsed as the value of the "Bla:" header. Although the line contains the pattern identified with a worm ("cmd.exe"), it is not blocked, since it is considered part of a header value. Therefore, "cmd.exe" is smuggled through the firewall.

When the request is passed through the firewall the web server the first request is ignored because the web server does not find an expected "Content-Type: application/x-www-form-urlencoded" header, and starts parsing the second request.

This second request has a content-length of 30 bytes, which is exactly the length of the next two lines up to the space after the "Bla:" header. And unlike the firewall, the web server processes the final POST as a separate third request and the "cmd.exe" worm is smuggled through the firewall to the web server.

To avoid this attack a Web server firewall product must be used that is designed to prevent this type of attack.

Overview

First reported 4 years ago

2020-02-24 22:15:00

Last updated 4 years ago

2020-10-20 22:15:00

Affected Software

Apache Software Foundation Tomcat

Apache Software Foundation Tomcat 9.0.0

9.0.0

Apache Software Foundation Tomcat 9.0.0 Milestone 1

9.0.0

Apache Software Foundation Tomcat 9.0.0 Milestone 10

9.0.0

Apache Software Foundation Tomcat 9.0.0 Milestone 11

9.0.0

Apache Software Foundation Tomcat 9.0.0 Milestone 12

9.0.0

Apache Software Foundation Tomcat 9.0.0 Milestone 13

9.0.0

Apache Software Foundation Tomcat 9.0.0 Milestone 14

9.0.0

Apache Software Foundation Tomcat 9.0.0 Milestone 15

9.0.0

Apache Software Foundation Tomcat 9.0.0 Milestone 16

9.0.0

Apache Software Foundation Tomcat 9.0.0 Milestone 17

9.0.0

Apache Software Foundation Tomcat 9.0.0 Milestone 18

9.0.0

Apache Software Foundation Tomcat 9.0.0 Milestone 19

9.0.0

Apache Software Foundation Tomcat 9.0.0 Milestone 2

9.0.0

Apache Software Foundation Tomcat 9.0.0 Milestone 20

9.0.0

Apache Software Foundation Tomcat 9.0.0 Milestone 21

9.0.0

Apache Software Foundation Tomcat 9.0.0 Milestone 22

9.0.0

Apache Software Foundation Tomcat 9.0.0 Milestone 23

9.0.0

Apache Software Foundation Tomcat 9.0.0 Milestone 24

9.0.0

Apache Software Foundation Tomcat 9.0.0 Milestone 25

9.0.0

Apache Software Foundation Tomcat 9.0.0 Milestone 26

9.0.0

Apache Software Foundation Tomcat 9.0.0 Milestone 27

9.0.0

Apache Software Foundation Tomcat 9.0.0 Milestone 3

9.0.0

Apache Software Foundation Tomcat 9.0.0 Milestone 4

9.0.0

Apache Software Foundation Tomcat 9.0.0 Milestone 5

9.0.0

Apache Software Foundation Tomcat 9.0.0 Milestone 6

9.0.0

Apache Software Foundation Tomcat 9.0.0 Milestone 7

9.0.0

Apache Software Foundation Tomcat 9.0.0 Milestone 8

9.0.0

Apache Software Foundation Tomcat 9.0.0 Milestone 9

9.0.0

Debian Linux 8.0 (Jessie)

8.0

Debian Linux 9.0

9.0

Canonical Ubuntu Linux 16.04 LTS (Long-Term Support)

16.04

OpenSUSE Leap 15.1

15.1

NetApp Data Availability Services

Oracle Hospitality Guest Access 4.2.0

4.2.0

Oracle Hospitality Guest Access 4.2.1

4.2.1

Oracle Transportation Management 6.3.7

6.3.7

References

openSUSE-SU-2020:0345

[tomcat-announce] 20200224 [SECURITY] CVE-2020-1935 HTTP Request Smuggling

Mailing List, Vendor Advisory

[tomee-commits] 20200323 [jira] [Commented] (TOMEE-2790) TomEE plus(7.0.7) is affected by CVE-2020-1935 & CVE-2019-17569 vulnerabilities

[tomee-commits] 20200320 [jira] [Created] (TOMEE-2790) TomEE plus(7.0.7) is affected by CVE-2020-1935 & CVE-2019-17569 vulnerabilities

[debian-lts-announce] 20200304 [SECURITY] [DLA 2133-1] tomcat7 security update

Third Party Advisory

https://security.netapp.com/advisory/ntap-20200327-0005/

DSA-4673

DSA-4680

[debian-lts-announce] 20200528 [SECURITY] [DLA 2209-1] tomcat8 security update

https://www.oracle.com/security-alerts/cpujul2020.html

[tomcat-users] 20200724 CVE-2020-1935

[tomcat-users] 20200724 Re: CVE-2020-1935

[tomcat-users] 20200724 RE: CVE-2020-1935

[tomcat-users] 20200726 Re: CVE-2020-1935

[tomcat-users] 20200727 RE: CVE-2020-1935

USN-4448-1

openSUSE-SU-2020:0345

Mailing List, Third Party Advisory

[tomcat-users] 20200724 CVE-2020-1935

Mailing List, Vendor Advisory

[tomcat-users] 20200724 Re: CVE-2020-1935

Mailing List, Vendor Advisory

[tomee-commits] 20200323 [jira] [Commented] (TOMEE-2790) TomEE plus(7.0.7) is affected by CVE-2020-1935 & CVE-2019-17569 vulnerabilities

Mailing List, Vendor Advisory

[tomcat-users] 20200727 RE: CVE-2020-1935

Mailing List, Vendor Advisory

[tomcat-users] 20200726 Re: CVE-2020-1935

Mailing List, Vendor Advisory

[tomee-commits] 20200320 [jira] [Created] (TOMEE-2790) TomEE plus(7.0.7) is affected by CVE-2020-1935 & CVE-2019-17569 vulnerabilities

Mailing List, Vendor Advisory

[tomcat-users] 20200724 RE: CVE-2020-1935

Mailing List, Vendor Advisory

[debian-lts-announce] 20200304 [SECURITY] [DLA 2133-1] tomcat7 security update

Mailing List, Third Party Advisory

[debian-lts-announce] 20200528 [SECURITY] [DLA 2209-1] tomcat8 security update

Mailing List, Third Party Advisory

https://security.netapp.com/advisory/ntap-20200327-0005/

Third Party Advisory

USN-4448-1

Third Party Advisory

DSA-4673

Third Party Advisory

DSA-4680

Third Party Advisory

https://www.oracle.com/security-alerts/cpujul2020.html

Patch, Third Party Advisory

https://www.oracle.com/security-alerts/cpuoct2020.html

Stay updated

ExploitPedia is constantly evolving. Sign up to receive a notification when we release additional functionality.

Get in touch

If you'd like to report a bug or have any suggestions for improvements then please do get in touch with us using this form. We will get back to you as soon as we can.