# CVE-2024-38816: CVE-2024-38816: Path traversal vulnerability in functional web frameworks

> Attackers can read arbitrary files via path traversal in Spring functional web frameworks when serving static resources from the filesystem.

- **Severity:** High 7.5 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/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:** 13 Sep 2024
- **Updated:** 18 Mar 2025
- **Also known as:** CLEANSTART-2026-OB69984, CLSA-2024-1727136032, DEBIAN-CVE-2024-38816, ECHO-a7b5-9790-ee2f, GHSA-cx7f-g6mp-7hqm, ROOT-APP-MAVEN-CVE-2024-38816, UBUNTU-CVE-2024-38816

## What is CVE-2024-38816?

CVE-2024-38816 is a high-severity path traversal vulnerability in Spring, published on 13 Sep 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

Applications serving static resources through the functional web frameworks WebMvc.fn or WebFlux.fn are vulnerable to path traversal attacks. An attacker can craft malicious HTTP requests and obtain any file on the file system that is also accessible to the process in which the Spring application is running.

Specifically, an application is vulnerable when both of the following are true:

  *  the web application uses RouterFunctions to serve static resources
  *  resource handling is explicitly configured with a FileSystemResource location

However, malicious requests are blocked and rejected when any of the following is true:

  *  the  Spring Security HTTP Firewall https://docs.spring.io/spring-security/reference/servlet/exploits/firewall.html  is in use
  *  the application runs on Tomcat or Jetty

Weakness: CWE-22 (Improper Limitation of a Pathname to a Restricted Directory)

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

12 open source packages ship an affected version, including org.springframework:spring-webflux and org.springframework:spring-webmvc.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `org.springframework:spring-webflux` | Maven | From 5.3.0 to 5.3.39 | None |
| `org.springframework:spring-webflux` | Maven | From 5.3.0 to 5.3.39 | None |
| `org.springframework:spring-webflux` | Maven | From 6.0.0 to 6.0.23 | None |
| `org.springframework:spring-webflux` | Maven | From 6.0.0 to 6.0.23 | None |
| `org.springframework:spring-webflux` | Maven | From 6.1.0 | 6.1.13 |
| `org.springframework:spring-webflux` | Maven | From 6.1.0 | 6.1.13 |
| `org.springframework:spring-webmvc` | Maven | From 5.3.0 to 5.3.39 | None |
| `org.springframework:spring-webmvc` | Maven | From 5.3.0 to 5.3.39 | None |
| `org.springframework:spring-webmvc` | Maven | From 6.0.0 to 6.0.23 | None |
| `org.springframework:spring-webmvc` | Maven | From 6.0.0 to 6.0.23 | None |
| `org.springframework:spring-webmvc` | Maven | From 6.1.0 | 6.1.13 |
| `org.springframework:spring-webmvc` | Maven | From 6.1.0 | 6.1.13 |

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

Upgrade org.springframework:spring-webflux to 6.1.13 or later.

## Is CVE-2024-38816 being exploited?

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

Public exploit code:

- CVE-2024-38816 Proof of Concept (github_poc): https://github.com/WULINPIN/CVE-2024-38816-PoC
- https://github.com/startsw1th/cve-2024-38816-demo (github_poc): https://github.com/startsw1th/cve-2024-38816-demo
-  CVE-2024-38816 (github_poc): https://github.com/Anthony1078/App-vulnerable
- Fixed cve-2024-38816 based on version 5.3.39 (github_poc): https://github.com/wdragondragon/spring-framework
- Fork spring-webmvc 5.3.39 to fix CVE-2024-38816, CVE-2024-38819 (github_poc): https://github.com/jaloon/spring-webmvc5
- WebMvc.fn/WebFlux.fn - Path Traversal (nuclei): http/cves/2024/CVE-2024-38816.yaml

## Fix prompt for AI coding agents

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

What it is: CVE-2024-38816 is a high-severity path traversal vulnerability in Spring, published on 13 Sep 2024. 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-2024-38816 exists.

Affected packages and fixed versions:
- org.springframework:spring-webflux (Maven): affected from 5.3.0 up to 5.3.39; no fix listed
- org.springframework:spring-webflux (Maven): affected from 5.3.0 up to 5.3.39; no fix listed
- org.springframework:spring-webflux (Maven): affected from 6.0.0 up to 6.0.23; no fix listed
- org.springframework:spring-webflux (Maven): affected from 6.0.0 up to 6.0.23; no fix listed
- org.springframework:spring-webflux (Maven): affected from 6.1.0; fixed in 6.1.13
- org.springframework:spring-webflux (Maven): affected from 6.1.0; fixed in 6.1.13
- org.springframework:spring-webmvc (Maven): affected from 5.3.0 up to 5.3.39; no fix listed
- org.springframework:spring-webmvc (Maven): affected from 5.3.0 up to 5.3.39; no fix listed
- org.springframework:spring-webmvc (Maven): affected from 6.0.0 up to 6.0.23; no fix listed
- org.springframework:spring-webmvc (Maven): affected from 6.0.0 up to 6.0.23; no fix listed
- org.springframework:spring-webmvc (Maven): affected from 6.1.0; fixed in 6.1.13
- org.springframework:spring-webmvc (Maven): affected from 6.1.0; fixed in 6.1.13

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

## Sources

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

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