Explore our new Cybersecurity Terms Glossary, explained by our experts.

View the Glossary View the Glossary
PRIVIA

Cybersecurity Terms Glossary

What Is Spring4Shell?

Spring4Shell (CVE-2022-22965) is a remote code execution flaw in the Spring Framework that abuses data binding to reach the Tomcat class loader and write a web shell to disk.

Illustration for the cybersecurity term Spring4Shell
Home / Blog / Cybersecurity Terms / What Is Spring4Shell?
17 November 2026

What Is Spring4Shell?

What Is Spring4Shell?

Spring4Shell is the nickname given to CVE-2022-22965, a remote code execution vulnerability in the Spring Framework disclosed on 31 March 2022 and scored 9.8 under CVSS v3.1. It lets an unauthenticated attacker abuse Spring’s request-to-object data binding to reach objects it was never meant to touch, and on a common deployment pattern that is enough to write a working web shell onto the server.

The name invited comparison with Log4Shell, which had landed three months earlier. The comparison was unfair in one direction and useful in the other: Spring4Shell needs several conditions to line up, so far fewer systems were exploitable, but the ones that were could be taken over with a single HTTP request.

Data Binding and the Class Loader

Spring MVC can map request parameters directly onto the fields of a Java object. Send name=alice to a controller that takes a User argument and Spring will call setName for you. Nested properties are supported too, so address.city=London walks into the nested object.

Every Java object also exposes getClass(). A 2010 vulnerability, CVE-2010-1622, abused that to reach the class loader, and Spring added a filter to block the class.classLoader path. On Java 9 and later, a new route appeared: class.module.classLoader, which the old filter did not cover.

From there, an attacker manipulates the properties of Tomcat’s AccessLogValve, changing its directory, file prefix, suffix, date format, and pattern. The log file becomes a JSP file in the web root whose contents are attacker-controlled, and requesting that JSP executes the code. Tomcat only has to write one log line for the shell to appear.

The Conditions That Must All Be True

A system was exploitable by the original public technique only when every one of these held:

Spring Boot’s default executable JAR packaging therefore spared a great many applications. That said, the underlying class loader access is a framework-level weakness, and other gadget chains beyond the Tomcat valve were demonstrated afterwards, so “not a WAR on Tomcat” was never a reason to skip the patch.

Do Not Confuse It With Its Neighbours

Three Spring-related issues circulated in the same fortnight and were widely conflated:

CVEComponentIssue
CVE-2022-22965Spring FrameworkData binding to class loader, RCE (Spring4Shell)
CVE-2022-22963Spring Cloud FunctionSpEL injection via a routing expression header, RCE
CVE-2022-22947Spring Cloud GatewaySpEL injection via the Actuator endpoint, RCE

All three were added to the CISA Known Exploited Vulnerabilities catalogue in April 2022, and variants of the Mirai botnet were observed using Spring4Shell against exposed servers within days of disclosure.

Fixing and Verifying

The fix is an upgrade: Spring Framework 5.3.18 or 5.2.20, and Spring Boot 2.6.6 or 2.5.12, which pull the corrected framework version in. Tomcat 10.0.20, 9.0.62, and 8.5.78 also shipped a change that breaks the specific AccessLogValve chain, which is a useful second layer but not a substitute for the framework upgrade.

Where an immediate upgrade is impossible, the published workaround is a @ControllerAdvice component that calls setDisallowedFields to block class.*, Class.*, *.class.*, and *.Class.*. Treat it as a holding measure, and remove it once the upgrade lands.

Verification is the part teams get wrong. Check the resolved dependency tree, not the version declared in your build file, because a transitive dependency can pin an older Spring release. A software bill of materials generated at build time answers the question in seconds rather than days.

Cyber Essentials expects internet-facing software to receive critical security updates within 14 days of release, which is a reasonable internal target even if you are not certified. A dependency inventory and automated scanning in the pipeline are what make that target achievable, rather than heroic weekends.

Our Web Application Security Services include dependency review alongside manual testing, so framework-level exposure is found before someone else scans for it.

FAQ – Frequently Asked Questions

Is Spring4Shell as Serious as Log4Shell?

It is equally severe where it applies but applies far less widely. Log4Shell affected nearly every Java application that logged user-controlled strings, with no deployment prerequisites. Spring4Shell requires JDK 9 or later, a vulnerable Spring version, WAR deployment on Tomcat, and a controller that binds request parameters to an object. Fewer systems qualified, but those that did were trivially exploitable.

Am I Safe if I Run Spring Boot as an Executable JAR?

You are not exploitable through the original public technique, which depends on Tomcat’s AccessLogValve being reachable in a WAR deployment. The underlying class loader access weakness is still present in the framework, and researchers demonstrated other gadget chains afterwards. Upgrade to a patched Spring Framework version regardless of how your application is packaged.

How Do I Check Which Spring Version My Application Actually Uses?

Inspect the resolved dependency tree rather than the version string in your build file. Run mvn dependency:tree or gradle dependencies and look for spring-beans and spring-core, since a transitive dependency can override your declared version. Generating a software bill of materials during the build gives you the same answer automatically for every release.

Does a Web Application Firewall Block Spring4Shell?

A WAF rule matching parameter names containing class, module, or classLoader will catch straightforward exploit attempts and is worth deploying as emergency cover. Encoding and parameter ordering give attackers room to evade signature rules, so treat it as time bought for patching rather than as a fix. Remove or review the rules once the upgrade is complete.

Related Terms

You May Be Interested In These

What Is Firmware Security?

Cybersecurity Terms

17 November 2026

What Is Firmware Security?

Read More
What Is a Tabletop Exercise?

Cybersecurity Terms

17 November 2026

What Is a Tabletop Exercise?

Read More