CVE-2016-5007: Spring Framework Spring Security And Spring Framework Vulnerability

HIGH
Advisory Identifier: GHSA-8crv-49fr-2h6j
CVSS 7.5
Published
Advisory Summary

CVE-2016-5007 is a HIGH (CVSS 7.5) spring security and spring framework vulnerability (General Security Weakness) affecting Spring Framework libraries in the Maven ecosystem. The issue involves spring security and spring framework may not recognize certain paths that should be protected. Remediation is available by upgrading affected packages to version 4.3.1, 4.1.1.

CVE-2016-5007 at a Glance

CVE Identifier CVE-2016-5007
GHSA Identifier GHSA-8crv-49fr-2h6j
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-5007

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:spring-core fixed: 4.3.1
<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-core</artifactId>
    <version>4.3.1</version>
</dependency>
org.springframework.security:spring-security-core fixed: 4.1.1
<dependency>
    <groupId>org.springframework.security</groupId>
    <artifactId>spring-security-core</artifactId>
    <version>4.1.1</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

How to Check if You Are Affected

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

mvn dependency:tree -Dincludes=org.springframework

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 4.3.1), your application is affected.

Note: The mvn dependency:tree -Dincludes=org.springframework 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

Both Spring Security 3.2.x, 4.0.x, 4.1.0 and the Spring Framework 3.2.x, 4.0.x, 4.1.x, 4.2.x (as well as other unsupported versions) rely on URL pattern mappings for authorization and for mapping requests to controllers respectively. Differences in the strictness of the pattern matching mechanisms, for example with regards to space trimming in path segments, can lead Spring Security to not recognize certain paths as not protected that are in fact mapped to Spring MVC controllers that should be protected. The problem is compounded by the fact that the Spring Framework provides richer features with regards to pattern matching as well as by the fact that pattern matching in each Spring Security and the Spring Framework can easily be customized creating additional differences.

CVE-2016-5007 Affected Spring Framework Versions

2 component(s)
Fixed Versions:
4.3.14.1.1
Product / Package Ecosystem Affected Versions Fixed Version
org.springframework:spring-core
Maven
< 4.3.1
4.3.1
org.springframework.security:spring-security-core
Maven
< 4.1.1
4.1.1

References

Frequently Asked Questions

What is CVE-2016-5007?
CVE-2016-5007 is a security vulnerability in Spring Framework involving Spring Security and Spring Framework may not recognize certain paths that should be protected under General Security Weakness.
Which Spring Framework versions are affected?
Affected versions include releases prior to 4.3.1, 4.1.1 across affected packages: org.springframework:spring-core, org.springframework.security:spring-security-core.
What version fixes CVE-2016-5007?
Upgrading to 4.3.1, 4.1.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is spring-core affected?
Yes, org.springframework:spring-core is affected in releases prior to 4.3.1. Upgrade your dependency to 4.3.1 or later.
Is spring-security-core affected?
Yes, org.springframework.security:spring-security-core is affected in releases prior to 4.1.1. Upgrade your dependency to 4.1.1 or later.
What is the CVSS score of CVE-2016-5007?
CVE-2016-5007 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-5007?
CVE-2016-5007 is classified under General Security Weakness.
How can I check Maven dependencies for CVE-2016-5007?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=org.springframework'. 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-8crv-49fr-2h6j",
  "modified" : "2024-03-05T17:55:31Z",
  "published" : "2018-10-17T20:30:12Z",
  "aliases" : [ "CVE-2016-5007" ],
  "summary" : "Spring Security and Spring Framework may not recognize certain paths that should be protected",
  "details" : "Both Spring Security 3.2.x, 4.0.x, 4.1.0 and the Spring Framework 3.2.x, 4.0.x, 4.1.x, 4.2.x (as well as other unsupported versions) rely on URL pattern mappings for authorization and for mapping requests to controllers respectively. Differences in the strictness of the pattern matching mechanisms, for example with regards to space trimming in path segments, can lead Spring Security to not recognize certain paths as not protected that are in fact mapped to Spring MVC controllers that should be protected. The problem is compounded by the fact that the Spring Framework provides richer features with regards to pattern matching as well as by the fact that pattern matching in each Spring Security and the Spring Framework can easily be customized creating additional differences.",
  "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:spring-core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.3.1"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.springframework.security:spring-security-core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.1.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2016-5007"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/spring-projects/spring-security/issues/3964"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/spring-projects/spring-framework/commit/a30ab30e4e9ae021fdda04e9abfc228476b846b5"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/spring-projects/spring-security/commit/e4c13e3c0ee7f06f59d3b43ca6734215ad7d8974"
  }, {
    "type" : "ADVISORY",
    "url" : "https://github.com/advisories/GHSA-8crv-49fr-2h6j"
  }, {
    "type" : "WEB",
    "url" : "https://pivotal.io/security/cve-2016-5007"
  }, {
    "type" : "WEB",
    "url" : "https://www.oracle.com/technetwork/security-advisory/cpujul2019-5072835.html"
  }, {
    "type" : "WEB",
    "url" : "http://www.oracle.com/technetwork/security-advisory/cpuapr2018-3678067.html"
  }, {
    "type" : "WEB",
    "url" : "http://www.securityfocus.com/bid/91687"
  } ],
  "database_specific" : {
    "cwe_ids" : [ ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-06-16T21:25:18Z",
    "nvd_published_at" : "2017-05-25T17:29:00Z"
  }
}