CVE-2022-22965 Explained: Spring4Shell, the Spring Framework RCE Vulnerability
A CVSS 9.8 remote code execution vulnerability in Spring Framework affecting applications running on JDK 9 and later. Feared as the next Log4Shell — here is what it actually does and how to fix it.

Founder & Cybersecurity Evangelist
CVE-2022-22965, named Spring4Shell by the security community, is a critical remote code execution vulnerability in the Spring Framework's data binding functionality. Disclosed on March 31, 2022, it scores 9.8 on the CVSS v3 scale and affects Spring Framework 5.3.x before 5.3.18 and 5.2.x before 5.2.20 when deployed on JDK 9 or later.
The vulnerability was immediately compared to Log4Shell due to Spring Framework's ubiquity in enterprise Java development. Spring is used by an estimated one million developers and is deployed in applications across financial services, government, healthcare, and technology sectors. While Spring4Shell proved less catastrophic than Log4Shell in practice due to its exploitation prerequisites, it remains a critical vulnerability with active exploitation observed in the wild.
How Spring4Shell Works: ClassLoader Manipulation via Data Binding
Spring Framework's data binding feature maps HTTP request parameters to Java object properties using reflection. This includes not just simple properties but also nested properties accessible through getter chains. An attacker can supply HTTP parameters using Spring's dot-notation to traverse object property paths — including paths that reach sensitive Java runtime objects.
The specific exploitation path in CVE-2022-22965 chains through the Java ClassLoader. By supplying parameters like class.module.classLoader.resources.context.parent.pipeline.first.*, an attacker can access and modify properties of the Tomcat log handler, including the log file path, prefix, suffix, and the log pattern. By manipulating these properties, the attacker redirects Tomcat's access log to write to a JSP file in the web application's publicly accessible root directory.
Once the log file is redirected, the attacker sends a request containing JSP code in a header or parameter — which gets written into the log file (now a .jsp file). The JSP file is then requested directly, executing the embedded code as a web shell with the privileges of the Tomcat process.
This exploitation chain requires JDK 9 or later because the module system introduced in Java 9 changed ClassLoader accessibility. Spring's disallowed field list was also updated from earlier versions. Applications running on JDK 8 are not vulnerable via this specific chain.
Identify Spring MVC application
Identify target web applications built on Spring Framework with multipart request handling. Applications exposing endpoints that accept HTTP parameters bound to POJOs with Spring MVC are candidates.
Traverse ClassLoader via binding
Send an HTTP POST with parameters using dot-notation traversal such as class.module.classLoader.resources.context.parent.pipeline.first.fileDateFormat to reach Tomcat's log configuration objects.
Redirect Tomcat log output
Modify the Tomcat AccessLogValve properties to change the log file directory to the web root and the file suffix to .jsp, effectively pointing the access log at a new JSP file.
Write web shell
Send a request with JSP code (e.g., Runtime.exec() wrapping) in a header that gets written to the redirected log file, creating a functional web shell in the application's web root.
Execute shell
Request the newly created JSP file directly via HTTP. The Tomcat servlet container executes the embedded JSP code, providing persistent RCE as the application server process user.
Spring4Shell vs. Log4Shell: Why the Impact Differed
When Spring4Shell dropped, the security industry feared a repeat of Log4Shell — a critical RCE in a foundational Java library with a trivial exploit and universal exposure. The actual impact was more contained, for structural reasons.
Log4Shell's exploit was a single malicious string that could be passed in virtually any user-controlled input field, with no contextual requirements beyond Log4j being present. Spring4Shell's exploitation chain has meaningful prerequisites: JDK 9 or later, deployment on Apache Tomcat as a WAR file, and Spring MVC with the standard data binding configuration.
Applications packaged as JAR files with the embedded Tomcat in Spring Boot's default configuration are not vulnerable via the main exploitation chain, because they do not use the separate Tomcat log file mechanism that the ClassLoader traversal targets. This excluded a large portion of modern Spring Boot applications from the most severe attack scenario.
Nonetheless, exploitation in the wild was confirmed rapidly. Threat actors including ransomware groups were observed scanning for and exploiting CVE-2022-22965 within days of public disclosure. Variants of the exploit targeting different ClassLoader paths and different deployment configurations were identified in subsequent weeks.
“Spring4Shell is a serious vulnerability. While its exploitation prerequisites narrow the affected population compared to Log4Shell, any Spring MVC application on JDK 9+ deployed as a WAR on Tomcat should be treated as vulnerable until patched.”
— VMware Tanzu Spring Security Advisory, March 2022
Patching and Mitigating CVE-2022-22965
VMware and the Spring team released patches on March 31, 2022. The following steps address CVE-2022-22965 completely and provide defense-in-depth for environments where immediate patching is constrained.
Upgrade Spring Framework to 5.3.18 or 5.2.20
The patch adds disallowedFields to DataBinder blocking the ClassLoader traversal path. Upgrade to 5.3.18+, 5.2.20+, or the latest stable release. This is the complete fix.
Upgrade Spring Boot to 2.6.6 or 2.5.12
Spring Boot 2.6.6 and 2.5.12 bundle the patched Spring Framework versions. Applications using Spring Boot dependency management should upgrade the parent POM version.
Update to JDK 8 as a temporary workaround
If the exploitation chain requires JDK 9+, downgrading to JDK 8 prevents this specific attack vector. This is a workaround only — patch Spring Framework as the primary fix regardless of JDK version.
Apply DataBinder field restrictions manually
As a code-level workaround, add setDisallowedFields({"class.*", "Class.*", "*.class.*", "*.Class.*"}) to DataBinder configurations. This blocks the ClassLoader traversal path without requiring an immediate library upgrade.
Deploy WAF rules blocking ClassLoader parameter patterns
Block HTTP requests containing parameters matching class.* patterns, particularly class.module.classLoader.*. Test carefully to avoid false positives on legitimate class-related parameter names in your application.
The bottom line
Spring4Shell demonstrated that the security community learned important lessons from Log4Shell about rapid response to critical framework vulnerabilities — but also that exploitation sophistication and speed continue to accelerate. Proof-of-concept code was available within hours of disclosure, and active exploitation began within days.
The prerequisite conditions that limited Spring4Shell's blast radius compared to Log4Shell are real but not permanent. Researchers identified multiple alternative exploitation chains targeting different ClassLoader paths and different deployment configurations in the weeks following initial disclosure.
The only durable response is patching. Organizations running Spring Framework on JDK 9+ should treat any unpatched deployment as actively exploitable, audit their Java application portfolios for affected versions, and establish processes to discover Spring Framework versions embedded in application dependencies — including those bundled inside WAR files and Docker images.
Get threat intel before your inbox does.
50,000+ security professionals read Decryption Digest for early warnings on zero-days, ransomware, and nation-state campaigns. Free, weekly, no spam.
Unsubscribe anytime. We never sell your data.

Founder & Cybersecurity Evangelist, Decryption Digest
Cybersecurity professional with expertise in threat intelligence, vulnerability research, and enterprise security. Covers zero-days, ransomware, and nation-state operations for 50,000+ security professionals weekly.