Critical

Remote Code Execution in Spring Framework

  • Disclosed: 31.03.2022
  • Updated: 11.10.2026 12:22

CISA confirms exploitation of this vulnerability in real attacks. Prioritise checking whether your application is affected. CISA KEV · CC0 1.0

Spring Framework prior to versions 5.2.20 and 5.3.18 contains a remote code execution vulnerability known as Spring4Shell.

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-webmvc or spring-webflux dependency

Patches

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).

Affected software

Click a technology to see all vulnerabilities affecting it.

PlatformPackageVulnerable versionsFixed in
Java / Kotlin (Maven) org.springframework.boot:spring-boot-starter-web < 2.5.12, >= 2.6.0, < 2.6.6 2.5.12, 2.6.6
Java / Kotlin (Maven) org.springframework.boot:spring-boot-starter-webflux < 2.5.12, >= 2.6.0, < 2.6.6 2.5.12, 2.6.6
Java / Kotlin (Maven) org.springframework:spring-beans < 5.2.20.RELEASE, >= 5.3.0, < 5.3.18 5.2.20.RELEASE, 5.3.18
Java / Kotlin (Maven) org.springframework:spring-webflux < 5.2.20.RELEASE, >= 5.3.0, < 5.3.18 5.2.20.RELEASE, 5.3.18
Java / Kotlin (Maven) org.springframework:spring-webmvc < 5.2.20.RELEASE, >= 5.3.0, < 5.3.18 5.2.20.RELEASE, 5.3.18

References

CVSS score 9.8/10
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H/E:H
Weakness (CWE)
CWE-74, CWE-94
Platform
Java / Kotlin (Maven)
Package
org.springframework.boot:spring-boot-starter-web, org.springframework.boot:spring-boot-starter-webflux, org.springframework:spring-beans
Disclosed
31.03.2022
Updated
11.10.2026 12:22

Sources and licenses

OSV / GitHub Advisory Database - GHSA-36p3-wjmg-h94x - CC BY 4.0

Vulnerability history: org.springframework.boot:spring-boot-starter-webflux

All published vulnerabilities of this package (Java / Kotlin (Maven)), newest first. Shows whether this is a one-off slip or a package that needs watching.

This is the only known vulnerability of this package.

Know which vulnerabilities affect your application

With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.

Connect your application
DockRay newsletter

Application security in your inbox

Important vulnerabilities, actionable guidance and practical advice for your applications. Choose your technologies and follow what matters to your project.

  • A daily digest of new vulnerabilities, critical ones included.
  • Notifications about important updates.
  • Practical advice on application security and monitoring.

Leave empty to receive updates for every technology.

Free to subscribe. Unsubscribe with one click in any email.