CVE-2017-5664: High severity Apache Tomcat vulnerability
The error page mechanism of the Java Servlet Specification requires that, when an error occurs and an error page is configured for the error that occurred, the original request and response are forwarded to the error page. This means that the request is presented to the error page with the original HTTP method.
If the error page is a static file, expected behaviour is to serve content of the file as if processing a GET request, regardless of the actual HTT method. Tomcat's Default Servlet did not do this. Depending on the original request this could lead to unexpected and undesirable results for static error pages including, if the DefaultServlet is configured to permit writes, the replacement or removal of the custom error page.
Affects: 7.0.0 to 7.0.77, 8.0.0.RC1 to 8.0.43, 8.5.0 to 8.5.14
Upstream fixes:
Tomcat 7.x:
https://svn.apache.org/viewvc?view=revision&revision=1793471 https://svn.apache.org/viewvc?view=revision&revision=1793491
Tomcat 8.0.x:
https://svn.apache.org/viewvc?view=revision&revision=1793470 https://svn.apache.org/viewvc?view=revision&revision=1793489
Tomcat 8.5.x:
https://svn.apache.org/viewvc?view=revision&revision=1793469 https://svn.apache.org/viewvc?view=revision&revision=1793488
External References:
https://tomcat.apache.org/security-7.html#FixedinApacheTomcat7.0.78 https://tomcat.apache.org/security-8.html#FixedinApacheTomcat8.0.44 https://tomcat.apache.org/security-8.html#FixedinApacheTomcat8.5.15
Other sources
The error page mechanism of the Java Servlet Specification requires that, when an error occurs and an error page is configured for the error that occurred, the original request and response are forwarded to the error page. This means that the request is presented to the error page with the original HTTP method. If the error page is a static file, expected behaviour is to serve content of the file as if processing a GET request, regardless of the actual HTTP method. The Default Servlet in Apache Tomcat 9.0.0.M1 to 9.0.0.M20, 8.5.0 to 8.5.14, 8.0.0.RC1 to 8.0.43 and 7.0.0 to 7.0.77 did not do this. Depending on the original request this could lead to unexpected and undesirable results for static error pages including, if the DefaultServlet is configured to permit writes, the replacement or removal of the custom error page. Notes for other user provided error pages: (1) Unless explicitly coded otherwise, JSPs ignore the HTTP method. JSPs used as error pages must must ensure that they handle any error dispatch as a GET request, regardless of the actual method. (2) By default, the response generated by a Servlet does depend on the HTTP method. Custom Servlets used as error pages must ensure that they handle any error dispatch as a GET request, regardless of the actual method.
— GitHub
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
maven/org.apache.tomcat:tomcatto a version that resolves this vulnerability.Fixed in 7.0.78 - Upgrade
Upgrade
maven/org.apache.tomcat:tomcatto a version that resolves this vulnerability.Fixed in 8.0.44 - Upgrade
Upgrade
maven/org.apache.tomcat:tomcatto a version that resolves this vulnerability.Fixed in 8.5.15 - Upgrade
Upgrade
maven/org.apache.tomcat:tomcatto a version that resolves this vulnerability.Fixed in 9.0.0.M21 - Upgrade
Upgrade
redhat/tomcatto a version that resolves this vulnerability.Fixed in 7.0.78 - Upgrade
Upgrade
redhat/tomcatto a version that resolves this vulnerability.Fixed in 8.0.44 - Upgrade
Upgrade
redhat/tomcatto a version that resolves this vulnerability.Fixed in 8.5.15 - Upgrade
Upgrade
Apache Tomcat 7to a version that resolves this vulnerability.Fixed in 7.0.78 - Upgrade
Upgrade
Apache Tomcat 8.0to a version that resolves this vulnerability.Fixed in 8.0.44 - Upgrade
Upgrade
Apache Tomcat 8.5to a version that resolves this vulnerability.Fixed in 8.5.15 - Configuration
Update custom Servlet error-page handlers so that when invoked as an error page they handle the request as a GET request regardless of the original HTTP method.
Custom Servlets used as error pages (Apache Tomcat) error dispatch method handling = handle any error dispatch as a GET request - Configuration
Update JSP error-page handlers so that when invoked as an error page they handle the request as a GET request regardless of the original HTTP method.
JSPs used as error pages (Apache Tomcat) error dispatch method handling = handle any error dispatch as a GET request
Event History
Frequently Asked Questions
What is the severity of CVE-2017-5664?
CVE-2017-5664 has a medium severity level as it allows sensitive information disclosure to unauthorized users.
How do I fix CVE-2017-5664?
To fix CVE-2017-5664, upgrade to Apache Tomcat version 7.0.78, 8.0.44, 8.5.15, or 9.0.0.M21.
What causes CVE-2017-5664?
CVE-2017-5664 is caused by an improper error page handling in Apache Tomcat that can expose sensitive request and response data.
Which versions of Apache Tomcat are affected by CVE-2017-5664?
Apache Tomcat versions from 7.0.0 to 7.0.77 and several versions of 8.x and 9.x are affected by CVE-2017-5664.
What type of vulnerability is CVE-2017-5664?
CVE-2017-5664 is a security vulnerability related to information disclosure due to improper error page handling.