# CVE-2017-8046: Remote code execution in PATCH requests in Spring Data REST

> Attackers can execute arbitrary Java code via malicious PATCH requests in Spring Data REST and Spring Boot applications.

- **Severity:** Critical 9.8 (`CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 4 Jan 2018
- **Updated:** 5 Aug 2024
- **Also known as:** GHSA-9qf9-28h9-hqcj

## What is CVE-2017-8046?

CVE-2017-8046 is a critical code injection vulnerability in Pivotal Spring Data REST and Spring Boot, published on 4 Jan 2018. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

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) and Spring Boot versions prior to 1.5.9, 2.0 M6 can use specially crafted JSON data to run arbitrary Java code.

Weakness: CWE-20 (Improper Input Validation)

## Which versions are affected by CVE-2017-8046?

4 open source packages ship an affected version, including org.springframework.data:spring-data-rest-core. It affects 3 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `org.springframework.data:spring-data-rest-core` | Maven | All versions | 2.6.9.RELEASE |
| `org.springframework.data:spring-data-rest-core` | Maven | All versions | 2.6.9.RELEASE |
| `org.springframework.data:spring-data-rest-core` | Maven | From 3.0.0 | 3.0.1.RELEASE |
| `org.springframework.data:spring-data-rest-core` | Maven | From 3.0.0 | 3.0.1.RELEASE |

Products: Pivotal Software Spring Data Rest, Vmware Spring Boot, Vmware Spring Data Rest.

## How do I fix CVE-2017-8046?

Upgrade org.springframework.data:spring-data-rest-core to a fixed version for your release line: 2.6.9.RELEASE or 3.0.1.RELEASE.

## Is CVE-2017-8046 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2017-8046 exists.

Public exploit code:

- This is a Java program that exploits Spring Break vulnerability (CVE-2017-8046). (github_poc): https://github.com/m3ssap0/spring-break_cve-2017-8046
- WARNING: This is a vulnerable application to test the exploit for the Spring Break vulnerability (CVE-2017-8046). Run it at your own risk! (github_poc): https://github.com/m3ssap0/SpringBreakVulnerableApp
- Fork of github.com/spring-projects/spring-data-rest (vulnerable to CVE-2017-8046) (github_poc): https://github.com/sj/spring-data-rest-CVE-2017-8046
- PoC for SpringBreak (CVE-2017-8046) (github_poc): https://github.com/FixYourFace/SpringBreakPoC
- This is a Java program that exploits Spring Break vulnerability (CVE-2017-8046). (github_poc): https://github.com/jkutner/spring-break-cve-2017-8046
- cve-2017-8046 (github_poc): https://github.com/cved-sources/cve-2017-8046

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2017-8046 and fix it if it is affected.

What it is: CVE-2017-8046 is a critical code injection vulnerability in Pivotal Spring Data REST and Spring Boot, published on 4 Jan 2018. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2017-8046 exists.

Affected packages and fixed versions:
- org.springframework.data:spring-data-rest-core (Maven): affected all versions; fixed in 2.6.9.RELEASE
- org.springframework.data:spring-data-rest-core (Maven): affected all versions; fixed in 2.6.9.RELEASE
- org.springframework.data:spring-data-rest-core (Maven): affected from 3.0.0; fixed in 3.0.1.RELEASE
- org.springframework.data:spring-data-rest-core (Maven): affected from 3.0.0; fixed in 3.0.1.RELEASE

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2017-8046/ (Markdown: https://insights.sbomify.com/CVE-2017-8046/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2017-8046
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2017-8046
- OSV: https://osv.dev/vulnerability/CVE-2017-8046

---
From sbomify Insights: https://insights.sbomify.com/CVE-2017-8046/
Summaries are generated and may contain mistakes; the official description above is the record.
