What to do3 steps
Upgrade Spring Framework to 5.3.18 or 5.2.20.
For Spring Boot, that is 2.6.6 or 2.5.12.
If you cannot yet, upgrade Tomcat or run on Java 8.
The Tomcat releases are 10.0.20, 9.0.62 or 8.5.78.
As a last resort, set
disallowedFieldsonWebDataBinder.Use it to block
class.*,Class.*,*.class.*and*.Class.*.
Are you affected?only if all are true
- JDK 9 or higher.
- Packaged as a WAR and deployed on Apache Tomcat (10.0.19, 9.0.61, 8.5.77 and earlier); Spring Boot's default executable JAR is not vulnerable to this exploit.
- spring-webmvc or spring-webflux, Spring Framework 5.3.0 to 5.3.17, 5.2.19 or older.
Check your version
- Maven, in the project directory
mvn dependency:tree -Dincludes=org.springframework:spring-beans - Java
java -version - Prompt for your own agent, read-onlyAm I affected by Spring4Shell?
Read the prompt
Check whether the systems I am authorized to inspect are affected by Spring4Shell (CVE-2022-22965). Spring MVC data binding lets a request set nested class properties on JDK 9+, reaching Tomcat's logging settings to write a JSP web shell. It is exploitable under these conditions: - JDK 9 or higher. - Packaged as a WAR and deployed on Apache Tomcat (10.0.19, 9.0.61, 8.5.77 and earlier); Spring Boot's default executable JAR is not vulnerable to this exploit. - spring-webmvc or spring-webflux, Spring Framework 5.3.0 to 5.3.17, 5.2.19 or older. Fixed releases: - Spring Framework: 5.2.20 (branch 5.2), 5.3.18 (branch 5.3) - Spring Boot: 2.5.12 (branch 2.5), 2.6.6 (branch 2.6) Commands the catalog lists to find the version or the setting (read each one before you run it): - Maven, in the project directory: mvn dependency:tree -Dincludes=org.springframework:spring-beans - Java: java -version What the catalog says to do on an affected system (report these, do not carry them out): 1. Upgrade Spring Framework to 5.3.18 or 5.2.20. 2. If you cannot yet, upgrade Tomcat or run on Java 8. 3. As a last resort, set disallowedFields on WebDataBinder. For each host, container image or application, report affected, not affected, fixed or unknown, with the evidence, and list anything you could not access. Work read-only: do not change configuration, restart services or send exploit input. More: https://spring.2shell.wtf/spring4shell
Affected versions4 branches
| Spring Framework branch | Fixed in |
|---|---|
| 5.2 | 5.2.20 |
| 5.3 | 5.3.18 |
| Spring Boot branch | Fixed in |
|---|---|
| 2.5 | 2.5.12 |
| 2.6 | 2.6.6 |
Proof of concept1 public PoC
For testing systems you own or are authorized to test. A PoC repository can be fake or carry malware: read it before you run it.
- Open the PoC
Public proof of concept on GitHub. PoCs spread from the leaked 0day; the most-starred educational lab, BobTheShoplifter/Spring4Shell-POC, ships a vulnerable Tomcat and Spring app with an exploit script.
Timeline3 events
Public PoC
Public proof of concept on GitHub. PoCs spread from the leaked 0day; the most-starred educational lab, BobTheShoplifter/Spring4Shell-POC, ships a vulnerable Tomcat and Spring app with an exploit script.
Patched
Spring Framework 5.3.18 and 5.2.20, Spring Boot 2.6.6 and 2.5.12
Added to CISA KEV
Added to CISA KEV
Sources5 links
Sources checked on . This page tells you how to check and what to install. It cannot tell you that you are safe.
3 changes since it was published
- Linked the most-starred public proof of concept.
- Added two research sources.
- Remediation steps got short titles; no fact changed.