CVE-2016-9879: Spring Framework Security Constraint Bypass Vulnerability

HIGH
Advisory Identifier: GHSA-v35c-49j6-q8hq
CVSS 7.5
Published
Advisory Summary

CVE-2016-9879 is a HIGH (CVSS 7.5) security constraint bypass vulnerability (General Security Weakness) affecting Spring Framework libraries in the Maven ecosystem. The issue involves security constraint bypass in spring security. Remediation is available by upgrading affected packages to version 3.2.10.RELEASE, 4.1.4.RELEASE, 4.2.1.RELEASE.

CVE-2016-9879 at a Glance

CVE Identifier CVE-2016-9879
GHSA Identifier GHSA-v35c-49j6-q8hq
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification General Security Weakness
Affected Product Spring Framework
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 7.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity High (I:H)
Availability None (A:N)

How to Fix CVE-2016-9879

To remediate this vulnerability, upgrade all affected Spring Framework dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

org.springframework.security:spring-security-core fixed: 3.2.10.RELEASE
<dependency>
    <groupId>org.springframework.security</groupId>
    <artifactId>spring-security-core</artifactId>
    <version>3.2.10.RELEASE</version>
</dependency>
org.springframework.security:spring-security-core fixed: 4.1.4.RELEASE
<dependency>
    <groupId>org.springframework.security</groupId>
    <artifactId>spring-security-core</artifactId>
    <version>4.1.4.RELEASE</version>
</dependency>
org.springframework.security:spring-security-core fixed: 4.2.1.RELEASE
<dependency>
    <groupId>org.springframework.security</groupId>
    <artifactId>spring-security-core</artifactId>
    <version>4.2.1.RELEASE</version>
</dependency>
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

mvn dependency:tree -Dincludes=org.springframework.security

How to Check if You Are Affected

To determine whether your Java application is affected by CVE-2016-9879, inspect your build dependencies using the Maven Dependency Plugin:

mvn dependency:tree -Dincludes=org.springframework.security

Analyze the terminal output to locate any version of Spring Framework in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.2.10.RELEASE), your application is affected.

Note: The mvn dependency:tree -Dincludes=org.springframework.security command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under General Security Weakness. In Spring Framework, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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/show_bug.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.

CVE-2016-9879 Affected Spring Framework Versions

3 component(s)
Fixed Versions:
3.2.10.RELEASE4.1.4.RELEASE4.2.1.RELEASE
Product / Package Ecosystem Affected Versions Fixed Version
org.springframework.security:spring-security-core
Maven
< 3.2.10.RELEASE
3.2.10.RELEASE
org.springframework.security:spring-security-core
Maven
≥ 4.0.0.RELEASE
< 4.1.4.RELEASE
4.1.4.RELEASE
org.springframework.security:spring-security-core
Maven
≥ 4.2.0.RELEASE
< 4.2.1.RELEASE
4.2.1.RELEASE

References

Frequently Asked Questions

What is CVE-2016-9879?
CVE-2016-9879 is a security vulnerability in Spring Framework involving Security Constraint Bypass in Spring Security under General Security Weakness.
Which Spring Framework versions are affected?
Affected versions include releases prior to 3.2.10.RELEASE, 4.1.4.RELEASE, 4.2.1.RELEASE across affected packages: org.springframework.security:spring-security-core.
What version fixes CVE-2016-9879?
Upgrading to 3.2.10.RELEASE, 4.1.4.RELEASE, 4.2.1.RELEASE (or the latest patched release for your respective branch) resolves the vulnerability.
Is spring-security-core affected?
Yes, org.springframework.security:spring-security-core is affected in releases prior to 3.2.10.RELEASE, 4.1.4.RELEASE, 4.2.1.RELEASE. Upgrade your dependency to 3.2.10.RELEASE, 4.1.4.RELEASE, 4.2.1.RELEASE or later.
What is the CVSS score of CVE-2016-9879?
CVE-2016-9879 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N.
What CWE is associated with CVE-2016-9879?
CVE-2016-9879 is classified under General Security Weakness.
How can I check Maven dependencies for CVE-2016-9879?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=org.springframework.security'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-v35c-49j6-q8hq",
  "modified" : "2024-05-15T06:42:07Z",
  "published" : "2020-09-15T20:30:34Z",
  "aliases" : [ "CVE-2016-9879" ],
  "summary" : "Security Constraint Bypass in Spring Security",
  "details" : "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.\n\nUsers 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].\n\nUsers 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.\n\nUsers of IBM WebSphere Application Server 8.5.x are known to be affected.\n\nUsers of other containers that implement the Servlet specification may be affected.\n\n[1] https://issues.apache.org/bugzilla/show_bug.cgi?id=25015\n\n## Affected Pivotal Products and Versions\nSeverity is high unless otherwise noted.\n- Spring Security 3.2.0 - 3.2.9\n- Spring Security 4.0.x - 4.1.3\n- Spring Security 4.2.0\n- Older unsupported versions are also affected\n\n## Mitigation\nAdopting one of the following mitigations will protect against this vulnerability.\n\n- Use a Servlet container known not to include path parameters in the return values for getServletPath() and getPathInfo()\n- 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()).\n\n## Credit\nThe issue was identified by Shumpei Asahara & Yuji Ito from NTT DATA Corporation and responsibly reported to Pivotal.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.springframework.security:spring-security-core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.2.10.RELEASE"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.springframework.security:spring-security-core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.0.0.RELEASE"
      }, {
        "fixed" : "4.1.4.RELEASE"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.springframework.security:spring-security-core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.2.0.RELEASE"
      }, {
        "fixed" : "4.2.1.RELEASE"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2016-9879"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2017:1832"
  }, {
    "type" : "WEB",
    "url" : "https://pivotal.io/security/cve-2016-9879"
  }, {
    "type" : "WEB",
    "url" : "http://www.securityfocus.com/bid/95142"
  } ],
  "database_specific" : {
    "cwe_ids" : [ ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-09-15T20:29:50Z",
    "nvd_published_at" : "2017-01-06T22:59:00Z"
  }
}