CVE-2022-22965: Spring Framework JDK 9+ Remote Code Execution Vulnerability
A Spring MVC or Spring WebFlux application running on JDK 9+ may be vulnerable to remote code execution (RCE) via data binding. The specific exploit requires the application to run on Tomcat as a WAR deployment. If the application is deployed as a Spring Boot executable jar, i.e. the default, it is not vulnerable to the exploit. However, the nature of the vulnerability is more general, and there may be other ways to exploit it.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
maven/org.springframework:spring-webfluxto a version that resolves this vulnerability.Fixed in 5.2.20.RELEASE - Upgrade
Upgrade
maven/org.springframework:spring-webmvcto a version that resolves this vulnerability.Fixed in 5.2.20.RELEASE - Upgrade
Upgrade
maven/org.springframework:spring-beansto a version that resolves this vulnerability.Fixed in 5.2.20.RELEASE - Upgrade
Upgrade
maven/org.springframework.boot:spring-boot-starter-webfluxto a version that resolves this vulnerability.Fixed in 2.6.6 - Upgrade
Upgrade
maven/org.springframework.boot:spring-boot-starter-webfluxto a version that resolves this vulnerability.Fixed in 2.5.12 - Upgrade
Upgrade
maven/org.springframework:spring-webfluxto a version that resolves this vulnerability.Fixed in 5.3.18 - Upgrade
Upgrade
maven/org.springframework.boot:spring-boot-starter-webto a version that resolves this vulnerability.Fixed in 2.6.6 - Upgrade
Upgrade
maven/org.springframework.boot:spring-boot-starter-webto a version that resolves this vulnerability.Fixed in 2.5.12 - Upgrade
Upgrade
maven/org.springframework:spring-webmvcto a version that resolves this vulnerability.Fixed in 5.3.18 - Upgrade
Upgrade
maven/org.springframework:spring-beansto a version that resolves this vulnerability.Fixed in 5.3.18 - Upgrade
Upgrade
Spring Bootto a version that resolves this vulnerability.Fixed in 2.6.6 - Upgrade
Upgrade
Spring Bootto a version that resolves this vulnerability.Fixed in 2.5.12 - Upgrade
Upgrade
Spring Frameworkto a version that resolves this vulnerability.Fixed in 5.3.18 - Upgrade
Upgrade
Spring Frameworkto a version that resolves this vulnerability.Fixed in 5.2.20.RELEASE - Configuration
If unable to upgrade, apply the centrally applied workaround by setting `disallowedFields` on `WebDataBinder` via an `@ControllerAdvice` for Spring MVC/WebFlux. Note: controllers that define `disallowedFields` locally using their own `@InitBinder` can override the global setting.
Spring MVC (WebDataBinder / WebMvcRegistrations / RequestMappingHandlerAdapter) disallowedFields on WebDataBinder (via ControllerAdvice) = set disallowedFields on WebDataBinder through an @ControllerAdvice - Configuration
For a more fail-safe workaround, extend `RequestMappingHandlerAdapter` (Spring MVC) to update `WebDataBinder` at the end, after all other initialization, to reduce loopholes from locally overridden `disallowedFields`.
Spring MVC (RequestMappingHandlerAdapter) WebDataBinder updated at end of initialization = extend RequestMappingHandlerAdapter to update WebDataBinder at the end after other initialization
Event History
Frequently Asked Questions
What is the severity of CVE-2022-22965?
CVE-2022-22965 has been assigned a severity rating that indicates a high risk of remote code execution in affected Spring MVC or Spring WebFlux applications.
How do I fix CVE-2022-22965?
To mitigate CVE-2022-22965, update your Spring Framework to version 5.2.20.RELEASE or later, or ensure you are using Spring Boot 2.5.12 or later.
Which applications are affected by CVE-2022-22965?
CVE-2022-22965 affects Spring MVC or Spring WebFlux applications running on JDK 9+ deployed as WAR files on Tomcat.
Is CVE-2022-22965 exploitable if using Spring Boot executable jar?
No, CVE-2022-22965 is specifically exploitable only in Spring MVC or Spring WebFlux applications deployed as WAR files on Tomcat.
What versions of Spring Framework are vulnerable to CVE-2022-22965?
Versions of Spring Framework prior to 5.2.20.RELEASE and from 5.3.0 up to 5.3.18 are considered vulnerable to CVE-2022-22965.