Path Traversal in Spring WebMvc.fn and WebFlux.fn Static Resource Handling
CVE-2024-38816 is a path traversal vulnerability in Spring Framework functional web applications using WebMvc.fn or WebFlux.fn to serve static resources. The flaw applies where RouterFunctions-based resource handling is explicitly configured with a FileSystemResource location. Insufficient path validation permits crafted HTTP requests containing traversal sequences to resolve files outside the intended static-resource directory.
What it means and what to do now: patch path, interim mitigations, and the assume-compromise checklist.
What an attacker gets, and what they’ve been doing with it.
An unauthenticated attacker able to send requests to a vulnerable static-resource route can read arbitrary files accessible to the operating-system account running the Spring application. Exposure is bounded by that process's filesystem permissions, but may disclose application configuration, credentials, keys, source code, or other sensitive local data.
If you can’t patch tonight, do this now.
Until patching is complete, avoid explicitly configuring FileSystemResource locations for static-resource routes implemented through RouterFunctions. Deploy the Spring Security HTTP Firewall where applicable. Requests exploiting this condition are also blocked when the application is deployed on Tomcat or Jetty.
Patch, then assume compromise.
Upgrade Spring Framework components to a vendor-fixed release. For the 6.1.x release line, upgrade spring-webmvc and/or spring-webflux to version 6.1.13 or later. Deploy the applicable supported patched release for other affected release lines, or migrate to a supported fixed line where no fix is available.
1 exploit validated by Mallory's analysis. Hidden: 2 rejected by Mallory's analysis as not a working exploit; 1 not yet analyzed, such as Exploit-DB entries.
10 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.