CSRF attack via CORS preflight requests with Spring MVC or Spring WebFlux
Published 21 Jan 2020 · Updated 15 Mar 2024
Is your project on an affected org.springframework:spring-webmvc?
Look after several Java apps? Indie watches up to 15 repos, private ones too, for $5 a month. See Indie
Affected packages
- Affected
- >=5.2.0 <5.2.3
- Fixed in
- 5.2.3
mvn versions:use-dep-version -Dincludes=org.springframework:spring-webmvc -DdepVersion=5.2.3 -DforceVersion=true- Affected
- >=5.2.0 <5.2.3
- Fixed in
- 5.2.3
mvn versions:use-dep-version -Dincludes=org.springframework:spring-webflux -DdepVersion=5.2.3 -DforceVersion=trueDetails
Spring Framework, versions 5.2.x prior to 5.2.3 are vulnerable to CSRF attacks through CORS preflight requests that target Spring MVC (spring-webmvc module) or Spring WebFlux (spring-webflux module) endpoints. Only non-authenticated endpoints are vulnerable because preflight requests should not include credentials and therefore requests should fail authentication. However a notable exception to this are Chrome based browsers when using client certificates for authentication since Chrome sends TLS client certificates in CORS preflight requests in violation of spec requirements. No HTTP body can be sent or received as a result of this attack.
Is GHSA-7pm4-g2qj-j85x in any of your client repos?
Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected org.springframework:spring-webmvc, and gives you the command that fixes it.
More advisories for org.springframework:spring-webmvc
- CriticalCVE-2026-47890Spring Framework Server Sent Event stream corruption while rendering fragments · 27 Aug 2026
- CriticalCVE-2026-47884Spring Framework Improper Path Limitation in XsltView · 27 Aug 2026
- MediumCVE-2026-41846Spring Framework Cross-site Scripting via JSP Form Tags · 9 Jun 2026
- MediumCVE-2026-41853Spring Framework Multipart Request Smuggling in Spring MVC and WebFlux · 9 Jun 2026
- HighCVE-2026-41845Spring Framework Cross-site Scripting via JavaScriptUtils · 9 Jun 2026
- HighCVE-2026-41842Spring Framework Denial of Service via Versioned Resources in Spring MVC and WebFlux · 9 Jun 2026
References
- Advisorynvd.nist.gov/vuln/detail/CVE-2020-5397
- Linkgithub.com/spring-projects/spring-framework/commit/bc7d01048579430b4b2df668178809b63d3f1929
- Packagegithub.com/spring-projects/spring-framework
- Linkpivotal.io/security/cve-2020-5397
- Linkwww.oracle.com//security-alerts/cpujul2021.html
- Linkwww.oracle.com/security-alerts/cpuapr2020.html
- Linkwww.oracle.com/security-alerts/cpujul2020.html
- Linkwww.oracle.com/security-alerts/cpujul2022.html
- Linkwww.oracle.com/security-alerts/cpuoct2020.html
- Linkwww.oracle.com/security-alerts/cpuoct2021.html
Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.