CVE-2016-9879: High severity VMware Spring Security vulnerability
An issue was discovered in Pivotal Spring Security before 3.2.10, 4.1.x before 4.1.4, and 4.2.x before 4.2.1. Spring Security does not consider URL path parameters when processing security constraints. By adding a URL path parameter with an encoded "/" to a request, an attacker may be able to bypass a security constraint. The root cause of this issue is a lack of clarity regarding the handling of path parameters in the Servlet Specification. Some Servlet containers include path parameters in the value returned for getPathInfo() and some do not. Spring Security uses the value returned by getPathInfo() as part of the process of mapping requests to security constraints. The unexpected presence of path parameters can cause a constraint to be bypassed. Users of Apache Tomcat (all current versions) are not affected by this vulnerability since Tomcat follows the guidance previously provided by the Servlet Expert group and strips path parameters from the value returned by getContextPath(), getServletPath(), and getPathInfo(). Users of other Servlet containers based on Apache Tomcat may or may not be affected depending on whether or not the handling of path parameters has been modified. Users of IBM WebSphere Application Server 8.5.x are known to be affected. Users of other containers that implement the Servlet specification may be affected.
Other sources
Spring Security does not consider URL path parameters when processing security constraints. By adding a URL path parameter with an encoded "/" to a request, an attacker may be able to bypass a security constraint. The root cause of this issue is a lack of clarity regarding the handling of path parameters in the Servlet Specification (see below). Some Servlet containers include path parameters in the value returned for getPathInfo() and some do not. Spring Security uses the value returned by getPathInfo() as part of the process of mapping requests to security constraints. The unexpected presence of path parameters can cause a constraint to be bypassed.
Users of Apache Tomcat (all current versions) are not affected by this vulnerability since Tomcat follows the guidance previously provided by the Servlet Expert group and strips path parameters from the value returned by getContextPath(), getServletPath() and getPathInfo() [1].
Users of other Servlet containers based on Apache Tomcat may or may not be affected depending on whether or not the handling of path parameters has been modified.
Users of IBM WebSphere Application Server 8.5.x are known to be affected.
Users of other containers that implement the Servlet specification may be affected.
[1] https://issues.apache.org/bugzilla/showbug.cgi?id=25015
Affected Pivotal Products and Versions Severity is high unless otherwise noted. - Spring Security 3.2.0 - 3.2.9 - Spring Security 4.0.x - 4.1.3 - Spring Security 4.2.0 - Older unsupported versions are also affected
Mitigation Adopting one of the following mitigations will protect against this vulnerability.
- Use a Servlet container known not to include path parameters in the return values for getServletPath() and getPathInfo() - Upgrading to Spring Security 3.2.10, 4.1.4 or 4.2.1 will reject the request with a RequestRejectedException if the presence of an encoded "/" is detected. Note: If you wish to disable this feature it can be disabled by setting the DefaultHttpFirewall.allowUrlEncodedSlash = true. However, disabling this feature will mean applications are vulnerable (in containers that return path parameters in getServletPath() or getPathInfo()).
Credit The issue was identified by Shumpei Asahara & Yuji Ito from NTT DATA Corporation and responsibly reported to Pivotal.
— GitHub
Spring Security does not consider URL path parameters when processing security constraints. By adding a URL path parameter with an encoded "/" to a request, an attacker may be able to bypass a security constraint. The root cause of this issue is a lack of clarity regarding the handling of path parameters in the Servlet Specification (see below). Some Servlet containers include path parameters in the value returned for getPathInfo() and some do not. Spring Security uses the value returned by getPathInfo() as part of the process of mapping requests to security constraints. The unexpected presence of path parameters can cause a constraint to be bypassed.
Users of Apache Tomcat (all current versions) are not affected by this vulnerability since Tomcat follows the guidance previously provided by the Servlet Expert group and strips path parameters from the value returned by getContextPath(), getServletPath() and getPathInfo().
Users of other Servlet containers based on Apache Tomcat may or may not be affected depending on whether or not the handling of path parameters has been modified.
Users of IBM WebSphere Application Server 8.5.x are known to be affected.
Users of other containers that implement the Servlet specification may be affected.
Upstream bug:
https://github.com/spring-projects/spring-security/issues/4169
External Reference:
https://pivotal.io/security/cve-2016-9879
Mitigation:
Use a Servlet container known not to include path parameters in the return values for getServletPath() and getPathInfo()
— Red Hat
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
maven/org.springframework.security:spring-security-coreto a version that resolves this vulnerability.Fixed in 4.2.1.RELEASE - Upgrade
Upgrade
maven/org.springframework.security:spring-security-coreto a version that resolves this vulnerability.Fixed in 4.1.4.RELEASE - Upgrade
Upgrade
maven/org.springframework.security:spring-security-coreto a version that resolves this vulnerability.Fixed in 3.2.10.RELEASE - Upgrade
Upgrade
redhat/springframework-securityto a version that resolves this vulnerability.Fixed in 3.2.10 - Upgrade
Upgrade
redhat/springframework-securityto a version that resolves this vulnerability.Fixed in 4.1.4 - Upgrade
Upgrade
redhat/springframework-securityto a version that resolves this vulnerability.Fixed in 4.2.1 - Upgrade
Upgrade
Spring Securityto a version that resolves this vulnerability.Fixed in 3.2.10 - Upgrade
Upgrade
Spring Securityto a version that resolves this vulnerability.Fixed in 4.1.4 - Upgrade
Upgrade
Spring Securityto a version that resolves this vulnerability.Fixed in 4.2.1 - Configuration
To disable the feature that rejects encoded '/' in URLs, set DefaultHttpFirewall.allowUrlEncodedSlash = true.
Spring Security DefaultHttpFirewall allowUrlEncodedSlash = true - Compensating control
Use a Servlet container known not to include path parameters in the return values for getServletPath() and getPathInfo(). (Apache Tomcat is noted as not affected; IBM WebSphere Application Server 8.5.x is known to be affected.)
Event History
Frequently Asked Questions
What is the severity of CVE-2016-9879?
CVE-2016-9879 has a high severity rating due to its potential to allow unauthorized access.
How do I fix CVE-2016-9879?
To fix CVE-2016-9879, upgrade to Spring Security version 3.2.10 or later, 4.1.4 or later, or 4.2.1 or later.
Which versions of Spring Security are affected by CVE-2016-9879?
CVE-2016-9879 affects Spring Security versions prior to 3.2.10, 4.1.4, and 4.2.1.
What type of vulnerability is CVE-2016-9879?
CVE-2016-9879 is a security vulnerability that allows attackers to bypass security constraints via URL path parameters.
Is there a workaround for CVE-2016-9879 if I cannot upgrade?
There is no specific documented workaround for CVE-2016-9879, so upgrading is recommended.