CVE-2017-8046: Spring Framework Remote Code Execution Vulnerability

CRITICAL
Advisory Identifier: GHSA-9qf9-28h9-hqcj
CVSS 9.8
CWE-20
Published
Advisory Summary

CVE-2017-8046 is a CRITICAL (CVSS 9.8) remote code execution vulnerability (CWE-20: Improper Input Validation) affecting Spring Framework libraries in the Maven ecosystem. The issue involves remote code execution in patch requests in spring data rest. Remediation is available by upgrading affected packages to version 2.6.9.RELEASE, 3.0.1.RELEASE.

CVE-2017-8046 at a Glance

CVE Identifier CVE-2017-8046
GHSA Identifier GHSA-9qf9-28h9-hqcj
Severity CRITICAL
CVSS v3.1 Base Score 9.8
CWE Classification CWE-20: Improper Input Validation
Affected Product Spring Framework
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 9.8

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:H/I:H/A:H).

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 High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2017-8046

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.data:spring-data-rest-core fixed: 2.6.9.RELEASE
<dependency>
    <groupId>org.springframework.data</groupId>
    <artifactId>spring-data-rest-core</artifactId>
    <version>2.6.9.RELEASE</version>
</dependency>
org.springframework.data:spring-data-rest-core fixed: 3.0.1.RELEASE
<dependency>
    <groupId>org.springframework.data</groupId>
    <artifactId>spring-data-rest-core</artifactId>
    <version>3.0.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.data

How to Check if You Are Affected

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

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

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

Note: The mvn dependency:tree -Dincludes=org.springframework.data 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 CWE-20: Improper Input Validation, where the product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly. 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

Malicious PATCH requests submitted to servers using Spring Data REST versions prior to 2.6.9 (Ingalls SR9), versions prior to 3.0.1 (Kay SR1) can use specially crafted JSON data to run arbitrary Java code.

CVE-2017-8046 Affected Spring Framework Versions

2 component(s)
Fixed Versions:
2.6.9.RELEASE3.0.1.RELEASE
Product / Package Ecosystem Affected Versions Fixed Version
org.springframework.data:spring-data-rest-core
Maven
< 2.6.9.RELEASE
2.6.9.RELEASE
org.springframework.data:spring-data-rest-core
Maven
≥ 3.0.0
< 3.0.1.RELEASE
3.0.1.RELEASE

References

Frequently Asked Questions

What is CVE-2017-8046?
CVE-2017-8046 is a security vulnerability in Spring Framework involving Remote code execution in PATCH requests in Spring Data REST under CWE-20: Improper Input Validation.
Which Spring Framework versions are affected?
Affected versions include releases prior to 2.6.9.RELEASE, 3.0.1.RELEASE across affected packages: org.springframework.data:spring-data-rest-core.
What version fixes CVE-2017-8046?
Upgrading to 2.6.9.RELEASE, 3.0.1.RELEASE (or the latest patched release for your respective branch) resolves the vulnerability.
Is spring-data-rest-core affected?
Yes, org.springframework.data:spring-data-rest-core is affected in releases prior to 2.6.9.RELEASE, 3.0.1.RELEASE. Upgrade your dependency to 2.6.9.RELEASE, 3.0.1.RELEASE or later.
What is the CVSS score of CVE-2017-8046?
CVE-2017-8046 has a CVSS v3.1 base score of 9.8 (CRITICAL) with vector string CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2017-8046?
CVE-2017-8046 is classified under CWE-20: Improper Input Validation (The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.).
How can I check Maven dependencies for CVE-2017-8046?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=org.springframework.data'. 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-9qf9-28h9-hqcj",
  "modified" : "2022-11-04T18:40:40Z",
  "published" : "2022-05-13T01:02:43Z",
  "aliases" : [ "CVE-2017-8046" ],
  "summary" : "Remote code execution in PATCH requests in Spring Data REST",
  "details" : "Malicious PATCH requests submitted to servers using Spring Data REST versions prior to 2.6.9 (Ingalls SR9), versions prior to 3.0.1 (Kay SR1) can use specially crafted JSON data to run arbitrary Java code.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.springframework.data:spring-data-rest-core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.6.9.RELEASE"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.springframework.data:spring-data-rest-core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.0.0"
      }, {
        "fixed" : "3.0.1.RELEASE"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2017-8046"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/spring-projects/spring-data-rest/issues/1487"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/spring-projects/spring-data-rest/issues/1520"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2018:2405"
  }, {
    "type" : "WEB",
    "url" : "https://bugzilla.redhat.com/show_bug.cgi?id=1553024"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/spring-projects/spring-data-rest"
  }, {
    "type" : "WEB",
    "url" : "https://jira.spring.io/browse/DATAREST-1127?redirect=false"
  }, {
    "type" : "WEB",
    "url" : "https://pivotal.io/security/cve-2017-8046"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-20" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-11-04T18:40:40Z",
    "nvd_published_at" : "2018-01-04T06:29:00Z"
  }
}