# CVE-2024-22257: Erroneous authentication pass in Spring Security

> Developers using Spring Security must upgrade to prevent broken access control when AuthenticatedVoter#vote is called with null authentication.

- **Severity:** High 8.2 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 18 Mar 2024
- **Updated:** 30 Jun 2026
- **Also known as:** CLEANSTART-2026-WY50072, CLSA-2024-1727308812, ECHO-a103-74de-c83b, GHSA-f3jh-qvm4-mg39, RHLW-2026-779e7aa7bc83a4c5, ROOT-APP-MAVEN-CVE-2024-22257

## What is CVE-2024-22257?

CVE-2024-22257 is a high-severity missing authorization vulnerability in Spring Security, published on 18 Mar 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

In Spring Security, versions 5.7.x prior to 5.7.12, 5.8.x prior to 
5.8.11, versions 6.0.x prior to 6.0.9, versions 6.1.x prior to 6.1.8, 
versions 6.2.x prior to 6.2.3, an application is possible vulnerable to 
broken access control when it directly uses the AuthenticatedVoter#vote passing a null Authentication parameter.

Weakness: CWE-862 (Missing Authorization)

## Which versions are affected by CVE-2024-22257?

8 open source packages ship an affected version, including org.springframework.security:spring-security-core.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `org.springframework.security:spring-security-core` | Maven | All versions | 5.7.12 |
| `org.springframework.security:spring-security-core` | Maven | All versions | 5.7.12 |
| `org.springframework.security:spring-security-core` | Maven | From 5.8.0 | 5.8.11 |
| `org.springframework.security:spring-security-core` | Maven | From 5.8.0 | 5.8.11 |
| `org.springframework.security:spring-security-core` | Maven | From 6.0.0 | 6.1.8 |
| `org.springframework.security:spring-security-core` | Maven | From 6.0.0 | 6.1.8 |
| `org.springframework.security:spring-security-core` | Maven | From 6.2.0 | 6.2.3 |
| `org.springframework.security:spring-security-core` | Maven | From 6.2.0 | 6.2.3 |

## How do I fix CVE-2024-22257?

Upgrade org.springframework.security:spring-security-core to a fixed version for your release line: 5.7.12, 5.8.11, 6.1.8 or 6.2.3.

## Is CVE-2024-22257 being exploited?

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

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-22257 and fix it if it is affected.

What it is: CVE-2024-22257 is a high-severity missing authorization vulnerability in Spring Security, published on 18 Mar 2024. 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-2024-22257 in the wild and no public exploit code.

Affected packages and fixed versions:
- org.springframework.security:spring-security-core (Maven): affected all versions; fixed in 5.7.12
- org.springframework.security:spring-security-core (Maven): affected all versions; fixed in 5.7.12
- org.springframework.security:spring-security-core (Maven): affected from 5.8.0; fixed in 5.8.11
- org.springframework.security:spring-security-core (Maven): affected from 5.8.0; fixed in 5.8.11
- org.springframework.security:spring-security-core (Maven): affected from 6.0.0; fixed in 6.1.8
- org.springframework.security:spring-security-core (Maven): affected from 6.0.0; fixed in 6.1.8
- org.springframework.security:spring-security-core (Maven): affected from 6.2.0; fixed in 6.2.3
- org.springframework.security:spring-security-core (Maven): affected from 6.2.0; fixed in 6.2.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-2024-22257/ (Markdown: https://insights.sbomify.com/CVE-2024-22257/index.md)
```

## Sources

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

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