Summary
Remote Code Execution in Spring Framework
Spring Framework prior to versions 5.2.20 and 5.3.18 contains a remote code execution vulnerability known as Spring4Shell.
Workarounds
For those who are unable to upgrade, leaked reports recommend setting disallowedFields on WebDataBinder through an @ControllerAdvice. This works generally, but as a centrally applied workaround fix, may leave some loopholes, in particular if a controller sets disallowedFields locally through its own @InitBinder method, which overrides the global setting.
To apply the workaround in a more fail-safe way, applications could extend RequestMappingHandlerAdapter to update the WebDataBinder at the end after all other initialization. In order to do that, a Spring Boot application can declare a WebMvcRegistrations bean (Spring MVC) or a WebFluxRegistrations bean (Spring WebFlux).
Impact
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.
These are the prerequisites for the exploit:
- JDK 9 or higher
- Apache Tomcat as the Servlet container
- Packaged as WAR
spring-webmvcorspring-webfluxdependency
Untrusted input is evaluated as executable code within the application's runtime environment. Typical impact: arbitrary code execution within the application's privilege context.
CVE-2022-22965 has a CVSS score of 9.8 (Critical). The vector is network-reachable, no privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (5.3.18, 2.5.12, 2.6.6, 5.2.20.RELEASE); upgrading removes the vulnerable code path.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Already deployed Kodem?
See it in your environmentNew to Kodem? Get a demo →Remediation advice
Frequently Asked Questions
- What is CVE-2022-22965? CVE-2022-22965 is a critical-severity code injection vulnerability in org.springframework:spring-beans (maven), affecting versions >= 5.3.0, < 5.3.18. It is fixed in 5.3.18, 2.5.12, 2.6.6, 5.2.20.RELEASE. Untrusted input is evaluated as executable code within the application's runtime environment.
- How severe is CVE-2022-22965? CVE-2022-22965 has a CVSS score of 9.8 (Critical). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
- Which packages are affected by CVE-2022-22965?
org.springframework:spring-beans(maven) (versions >= 5.3.0, < 5.3.18)org.springframework:spring-webmvc(maven) (versions >= 5.3.0, < 5.3.18)org.springframework.boot:spring-boot-starter-web(maven) (versions < 2.5.12)org.springframework:spring-webflux(maven) (versions >= 5.3.0, < 5.3.18)org.springframework.boot:spring-boot-starter-webflux(maven) (versions < 2.5.12)
- Is there a fix for CVE-2022-22965? Yes. CVE-2022-22965 is fixed in 5.3.18, 2.5.12, 2.6.6, 5.2.20.RELEASE. Upgrade to this version or later.
- Is CVE-2022-22965 exploitable, and should I be worried? Whether CVE-2022-22965 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether CVE-2022-22965 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix CVE-2022-22965?
- Upgrade
org.springframework:spring-beansto 5.3.18 or later - Upgrade
org.springframework:spring-webmvcto 5.3.18 or later - Upgrade
org.springframework.boot:spring-boot-starter-webto 2.5.12 or later - Upgrade
org.springframework.boot:spring-boot-starter-webto 2.6.6 or later - Upgrade
org.springframework:spring-webfluxto 5.3.18 or later - Upgrade
org.springframework.boot:spring-boot-starter-webfluxto 2.5.12 or later - Upgrade
org.springframework.boot:spring-boot-starter-webfluxto 2.6.6 or later - Upgrade
org.springframework:spring-beansto 5.2.20.RELEASE or later - Upgrade
org.springframework:spring-webmvcto 5.2.20.RELEASE or later - Upgrade
org.springframework:spring-webfluxto 5.2.20.RELEASE or later
- Upgrade