# CVE-2018-1260: Spring Security OAuth vulnerable to remote code execution (RCE)

> Attackers can achieve remote code execution by crafting malicious authorization requests in Spring Security OAuth.

- **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:** 11 May 2018
- **Updated:** 17 Sep 2024
- **Also known as:** GHSA-rrpm-pj7p-7j9q

## What is CVE-2018-1260?

CVE-2018-1260 is a critical code injection vulnerability in Pivotal Spring Security OAuth, published on 11 May 2018. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

Spring Security OAuth, versions 2.3 prior to 2.3.3, 2.2 prior to 2.2.2, 2.1 prior to 2.1.2, 2.0 prior to 2.0.15 and older unsupported versions contains a remote code execution vulnerability. A malicious user or attacker can craft an authorization request to the authorization endpoint that can lead to remote code execution when the resource owner is forwarded to the approval endpoint.

Weakness: CWE-94 (Improper Control of Generation of Code)

## Which versions are affected by CVE-2018-1260?

10 open source packages ship an affected version, including org.springframework.security.oauth:spring-security-oauth2. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `org.springframework.security.oauth:spring-security-oauth2` | Maven | From 1.0.0 to 1.0.5 | None |
| `org.springframework.security.oauth:spring-security-oauth2` | Maven | From 1.0.0 to 1.0.5 | None |
| `org.springframework.security.oauth:spring-security-oauth2` | Maven | From 2.0.0 | 2.0.15 |
| `org.springframework.security.oauth:spring-security-oauth2` | Maven | From 2.0.0 | 2.0.15 |
| `org.springframework.security.oauth:spring-security-oauth2` | Maven | From 2.1.0 | 2.1.2 |
| `org.springframework.security.oauth:spring-security-oauth2` | Maven | From 2.1.0 | 2.1.2 |
| `org.springframework.security.oauth:spring-security-oauth2` | Maven | From 2.2.0 | 2.2.2 |
| `org.springframework.security.oauth:spring-security-oauth2` | Maven | From 2.2.0 | 2.2.2 |
| `org.springframework.security.oauth:spring-security-oauth2` | Maven | From 2.3.0 | 2.3.3 |
| `org.springframework.security.oauth:spring-security-oauth2` | Maven | From 2.3.0 | 2.3.3 |

Products: Pivotal Software Spring Security Oauth.

## How do I fix CVE-2018-1260?

Upgrade org.springframework.security.oauth:spring-security-oauth2 to a fixed version for your release line: 2.0.15, 2.1.2, 2.2.2 or 2.3.3.

## Is CVE-2018-1260 being exploited?

There is no known exploitation of CVE-2018-1260 in the wild and no public exploit code.

Public exploit code:

- https://github.com/shoucheng3/SpringSource__spring-security-oauth_CVE-2018-1260_2-3-2-RELEASE (github_poc): https://github.com/shoucheng3/SpringSource__spring-security-oauth_CVE-2018-1260_2-3-2-RELEASE

## Other vulnerabilities in Pivotal Spring Security OAuth

- [CVE-2018-15758](https://insights.sbomify.com/CVE-2018-15758/): Privilege Escalation in spring-security-oauth2 (critical 9.6)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2018-1260 and fix it if it is affected.

What it is: CVE-2018-1260 is a critical code injection vulnerability in Pivotal Spring Security OAuth, published on 11 May 2018. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2018-1260 in the wild and no public exploit code.

Affected packages and fixed versions:
- org.springframework.security.oauth:spring-security-oauth2 (Maven): affected from 1.0.0 up to 1.0.5; no fix listed
- org.springframework.security.oauth:spring-security-oauth2 (Maven): affected from 1.0.0 up to 1.0.5; no fix listed
- org.springframework.security.oauth:spring-security-oauth2 (Maven): affected from 2.0.0; fixed in 2.0.15
- org.springframework.security.oauth:spring-security-oauth2 (Maven): affected from 2.0.0; fixed in 2.0.15
- org.springframework.security.oauth:spring-security-oauth2 (Maven): affected from 2.1.0; fixed in 2.1.2
- org.springframework.security.oauth:spring-security-oauth2 (Maven): affected from 2.1.0; fixed in 2.1.2
- org.springframework.security.oauth:spring-security-oauth2 (Maven): affected from 2.2.0; fixed in 2.2.2
- org.springframework.security.oauth:spring-security-oauth2 (Maven): affected from 2.2.0; fixed in 2.2.2
- org.springframework.security.oauth:spring-security-oauth2 (Maven): affected from 2.3.0; fixed in 2.3.3
- org.springframework.security.oauth:spring-security-oauth2 (Maven): affected from 2.3.0; fixed in 2.3.3

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-2018-1260/ (Markdown: https://insights.sbomify.com/CVE-2018-1260/index.md)
```

## Sources

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

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