CVE-2025-41234
Description
Description
In Spring Framework, versions 6.0.x as of 6.0.5, versions 6.1.x and 6.2.x, an application is vulnerable to a reflected file download (RFD) attack when it sets a “Content-Disposition” header with a non-ASCII charset, where the filename attribute is derived from user-supplied input.
Specifically, an application is vulnerable when all the following are true:
- The header is prepared with org.springframework.http.ContentDisposition.
- The filename is set via ContentDisposition.Builder#filename(String, Charset).
- The value for the filename is derived from user-supplied input.
- The application does not sanitize the user-supplied input.
- The downloaded content of the response is injected with malicious commands by the attacker (see RFD paper reference for details).
An application is not vulnerable if any of the following is true:
- The application does not set a “Content-Disposition” response header.
- The header is not prepared with org.springframework.http.ContentDisposition.
- The filename is set via one of: * ContentDisposition.Builder#filename(String), or
- ContentDisposition.Builder#filename(String, ASCII)
- The filename is not derived from user-supplied input.
- The filename is derived from user-supplied input but sanitized by the application.
- The attacker cannot inject malicious content in the downloaded content of the response.
Affected Spring Products and VersionsSpring Framework:
- 6.2.0 - 6.2.7
- 6.1.0 - 6.1.20
- 6.0.5 - 6.0.28
- Older, unsupported versions are not affected
MitigationUsers of affected versions should upgrade to the corresponding fixed version.
Affected version(s)Fix versionAvailability6.2.x6.2.8OSS6.1.x6.1.21OSS6.0.x6.0.29 Commercial https://enterprise.spring.io/ No further mitigation steps are necessary.
CWE-113 in Content-Disposition handling in VMware Spring Framework versions 6.0.5 to 6.2.7 allows remote attackers to launch Reflected File Download (RFD) attacks via unsanitized user input in ContentDisposition.Builder#filename(String, Charset) with non-ASCII charsets.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
org.springframework:spring-webMaven | >= 6.2.0, < 6.2.8 | 6.2.8 |
org.springframework:spring-webMaven | >= 6.1.0, < 6.1.21 | 6.1.21 |
org.springframework:spring-webMaven | >= 6.0.5, <= 6.0.23 | — |
Patches
1f0e7b42704e6Encode non-printable character in Content-Disposition parameter
2 files changed · +8 −0
spring-web/src/main/java/org/springframework/http/ContentDisposition.java+1 −0 modified@@ -68,6 +68,7 @@ public final class ContentDisposition { for (int i=33; i<= 126; i++) { PRINTABLE.set(i); } + PRINTABLE.set(34, false); // " PRINTABLE.set(61, false); // = PRINTABLE.set(63, false); // ? PRINTABLE.set(95, false); // _
spring-web/src/test/java/org/springframework/http/ContentDispositionTests.java+7 −0 modified@@ -313,6 +313,13 @@ void formatWithFilenameWithQuotes() { tester.accept("foo.txt\\\\\\", "foo.txt\\\\\\\\\\\\"); } + @Test + void formatWithUtf8FilenameWithQuotes() { + String filename = "\"中文.txt"; + assertThat(ContentDisposition.formData().filename(filename, StandardCharsets.UTF_8).build().toString()) + .isEqualTo("form-data; filename=\"=?UTF-8?Q?=22=E4=B8=AD=E6=96=87.txt?=\"; filename*=UTF-8''%22%E4%B8%AD%E6%96%87.txt"); + } + @Test void formatWithEncodedFilenameUsingInvalidCharset() { assertThatIllegalArgumentException().isThrownBy(() ->
Vulnerability mechanics
Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
6- github.com/advisories/GHSA-6r3c-xf4w-jxjmghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2025-41234nvdADVISORY
- github.com/spring-projects/spring-framework/commit/f0e7b42704e6b33958f242d91bd690d6ef7ada9cghsaWEB
- github.com/spring-projects/spring-framework/issues/35034ghsaWEB
- spring.io/security/cve-2025-41234nvdWEB
- nvd.nist.gov/vuln-metrics/cvss/v3-calculatornvd
News mentions
0No linked articles in our index yet.