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

High 7.5 Published Updated

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

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

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

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.

PackageAffectedFixed in
org.springframework:spring-webflux MavenFrom 5.3.0 to 5.3.39None
org.springframework:spring-webflux MavenFrom 5.3.0 to 5.3.39None
org.springframework:spring-webflux MavenFrom 6.0.0 to 6.0.23None
org.springframework:spring-webflux MavenFrom 6.0.0 to 6.0.23None
org.springframework:spring-webflux MavenFrom 6.1.06.1.13
org.springframework:spring-webflux MavenFrom 6.1.06.1.13
6 more packages
org.springframework:spring-webmvc MavenFrom 5.3.0 to 5.3.39None
org.springframework:spring-webmvc MavenFrom 5.3.0 to 5.3.39None
org.springframework:spring-webmvc MavenFrom 6.0.0 to 6.0.23None
org.springframework:spring-webmvc MavenFrom 6.0.0 to 6.0.23None
org.springframework:spring-webmvc MavenFrom 6.1.06.1.13
org.springframework:spring-webmvc MavenFrom 6.1.06.1.13

How do I fix CVE-2024-38816?

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

Upgrade, and resolve every user-supplied path against an allowed base folder before opening it. More about Path traversal.

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: 1 Nuclei template and 5 proofs of concept on GitHub.

Sources

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 and 1 more.

Is CVE-2024-38816 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free