# CVE-2024-38821: Authorization Bypass of Static Resources in WebFlux Applications

> Attackers can bypass authorization rules to access protected static resources in Spring WebFlux applications configured with specific security settings.

- **Severity:** Critical 9.1 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/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:** 28 Oct 2024
- **Updated:** 24 Jan 2025
- **Also known as:** CLEANSTART-2026-TA16647, ECHO-508b-98bd-2308, GHSA-c4q5-6c82-3qpw, ROOT-APP-MAVEN-CVE-2024-38821

## What is CVE-2024-38821?

CVE-2024-38821 is a critical missing authorization vulnerability in Spring, published on 28 Oct 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

Spring WebFlux applications that have Spring Security authorization rules on static resources can be bypassed under certain circumstances.

For this to impact an application, all of the following must be true:

  *  It must be a WebFlux application
  *  It must be using Spring's static resources support
  *  It must have a non-permitAll authorization rule applied to the static resources support

Weakness: CWE-770 (Allocation of Resources Without Limits or Throttling)

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

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


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `org.springframework.security:spring-security-web` | Maven | From 5.0.0 | 5.7.13 |
| `org.springframework.security:spring-security-web` | Maven | From 5.0.0 | 5.7.13 |
| `org.springframework.security:spring-security-web` | Maven | From 5.8.0 | 5.8.15 |
| `org.springframework.security:spring-security-web` | Maven | From 5.8.0 | 5.8.15 |
| `org.springframework.security:spring-security-web` | Maven | From 6.0.0 | 6.0.13 |
| `org.springframework.security:spring-security-web` | Maven | From 6.0.0 | 6.0.13 |
| `org.springframework.security:spring-security-web` | Maven | From 6.1.0 | 6.1.11 |
| `org.springframework.security:spring-security-web` | Maven | From 6.1.0 | 6.1.11 |
| `org.springframework.security:spring-security-web` | Maven | From 6.2.0 | 6.2.7 |
| `org.springframework.security:spring-security-web` | Maven | From 6.2.0 | 6.2.7 |
| `org.springframework.security:spring-security-web` | Maven | From 6.3.0 | 6.3.4 |
| `org.springframework.security:spring-security-web` | Maven | From 6.3.0 | 6.3.4 |

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

Upgrade org.springframework.security:spring-security-web to a fixed version for your release line: 5.7.13, 5.8.15, 6.0.13 or 6.1.11.

## Is CVE-2024-38821 being exploited?

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

Public exploit code:

- cve-2024-38821 (github_poc): https://github.com/mouadk/cve-2024-38821
- https://github.com/masa42/CVE-2024-38821-POC (github_poc): https://github.com/masa42/CVE-2024-38821-POC

## Fix prompt for AI coding agents

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

What it is: CVE-2024-38821 is a critical missing authorization vulnerability in Spring, published on 28 Oct 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-38821 in the wild and no public exploit code.

Affected packages and fixed versions:
- org.springframework.security:spring-security-web (Maven): affected from 5.0.0; fixed in 5.7.13
- org.springframework.security:spring-security-web (Maven): affected from 5.0.0; fixed in 5.7.13
- org.springframework.security:spring-security-web (Maven): affected from 5.8.0; fixed in 5.8.15
- org.springframework.security:spring-security-web (Maven): affected from 5.8.0; fixed in 5.8.15
- org.springframework.security:spring-security-web (Maven): affected from 6.0.0; fixed in 6.0.13
- org.springframework.security:spring-security-web (Maven): affected from 6.0.0; fixed in 6.0.13
- org.springframework.security:spring-security-web (Maven): affected from 6.1.0; fixed in 6.1.11
- org.springframework.security:spring-security-web (Maven): affected from 6.1.0; fixed in 6.1.11
- org.springframework.security:spring-security-web (Maven): affected from 6.2.0; fixed in 6.2.7
- org.springframework.security:spring-security-web (Maven): affected from 6.2.0; fixed in 6.2.7
- org.springframework.security:spring-security-web (Maven): affected from 6.3.0; fixed in 6.3.4
- org.springframework.security:spring-security-web (Maven): affected from 6.3.0; fixed in 6.3.4

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

## Sources

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

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