Skip to main content

Wolfcore Cyber Security

Spring4Shell (CVE-2022-22965): What It Is and How to Fix It

Written by Ruben Selby, founder and penetration tester at Wolfcore. Last reviewed 28 November 2026.

Part of the Wolfcore Resources library: Vulnerabilities.

In one sentence: Spring4Shell is a serious flaw in a widely used Java web framework that, under specific conditions, lets a stranger on the internet run commands on your web server.

What it is

Spring is a free framework many businesses use to build Java web applications. In March 2022 its maintainers published CVE-2022-22965, rated critical. The security community nicknamed it Spring4Shell or SpringShell. A CVE is a public reference number for a security flaw.

The flaw sits in “data binding”, the feature that copies values from a web request into the application’s internal objects. On newer Java versions, that copying could reach parts of the system it was never meant to reach.

It is easy to over-state. Spring’s advisory says the known attack needs all of these at once: Java 9 or later, Apache Tomcat as the server, the app packaged as a WAR file, and the spring-webmvc or spring-webflux component. An app built as a Spring Boot executable jar, the default, is not vulnerable to that known attack. Spring also warns the weakness is more general, so patching is still the answer.

How it works

  1. The application accepts a web request and binds the request’s fields to a Java object.
  2. On Java 9 and later, a specially formed field name can reach the class loader, a core internal part of Java, through that object.
  3. Microsoft’s analysis describes how this can be used to change Tomcat’s logging settings, so the server writes a file of the attacker’s choosing into a web-accessible folder.
  4. That file acts as a web shell: a small page that lets the attacker send commands to the server through the browser.
  5. From there the attacker can run commands as the web application, look around and try to steal data or move deeper.

We deliberately do not publish request details. Spring and Microsoft explain the mechanism, and the fix is a version upgrade.

The attack path at a glance

Internet requestSpring app, Tomcat WAR, Java 9+File written to web rootCommands runSpring4Shell: all four conditions must be true for the known attack

Who it affects and how badly

Any organisation running a Java web application built on Spring Framework, anywhere in the world: SaaS start-ups, fintech and insurance firms, retailers, councils and software suppliers whose products embed Spring. Many businesses use the framework without knowing it, because a supplier’s product contains it.

  • Sole trader to 10 staff: usually exposed only through a supplier’s software. Worst case is a hacked customer portal and a few days of disruption.
  • 50 to 250 staff: an internet-facing Spring app on Tomcat could give an attacker a foothold in the network, leading to data theft and downtime while you rebuild the server.
  • Regulated business: a compromised server holding personal data triggers breach reporting duties and client notification.

Microsoft reported a low volume of exploit attempts across its cloud services in the days after disclosure. That was an early observation. Your exposure depends on your own configuration.

Real examples

We do not name a victim organisation, because we did not open a primary source confirming one.

What we check on a test

  • Which internet-facing applications are Java, and which run on Tomcat as a WAR deployment.
  • The Spring Framework and Java versions the application reports, and, where you give us access, its build files and dependency list.
  • Whether a web application firewall sits in front of the app and whether it blocks or only logs.
  • Whether the web server process runs with more rights than it needs, which decides how bad a compromise would be.
  • Whether old, forgotten Tomcat instances are still reachable.

We confirm exposure safely and stop at proof. We do not run destructive actions.

Worked example (illustration only)

A 30-person logistics firm pays a developer for a customer tracking portal. It runs on Tomcat and Java 11, and nobody has updated the framework since 2021. If an attacker reached the server, they could read the shipment database and email customers pretending to be the firm. The cost would be days offline, a notification exercise and lost trust. The fix is a framework upgrade to a fixed release and a short test.

How to detect it

  • Search your dependency lists for Spring Framework 5.3.0 to 5.3.17 and 5.2.19 or earlier, the affected ranges in Spring’s advisory.
  • In Microsoft Defender for Endpoint, use threat and vulnerability management and search for CVE-2022-22965 on the Weaknesses page, as Microsoft describes.
  • Look for the Defender alert titled “Possible SpringShell exploitation” and for unexpected .jsp files in the Tomcat web root.
  • Review web server logs for unusual requests followed by new files appearing in the application folder.

How to fix or prevent it

  1. Upgrade Spring Framework to 5.3.18 or 5.2.20 or later, the fixed versions in the advisory.
  2. If you cannot upgrade yet, apply the workaround in Spring’s early announcement and plan the upgrade.
  3. Keep a list of every Java application and its framework version, including supplier products.
  4. Run the web server as a low-privilege account and keep the application folder read-only where possible.
  5. Put a web application firewall in blocking mode in front of public apps.
  6. Remove unused Tomcat instances from the internet.

Rules and regulators

  • UK: a compromised server holding personal data may be a personal data breach under UK GDPR, reportable to the ICO within 72 hours of discovery if it meets the threshold. See the ICO 72-hour rule.
  • EU: GDPR Article 33 has the same 72-hour rule for supervisory authorities.
  • US: state breach notification laws apply, depending on where affected people live.

FAQ

Is every Spring application vulnerable? No. The known attack needs Java 9 or later, Tomcat, a WAR deployment and spring-webmvc or spring-webflux.

Is a Spring Boot jar safe? Spring says the default executable jar is not vulnerable to the known exploit, but the flaw is more general, so upgrade anyway.

Which versions fix it? Spring Framework 5.3.18 and 5.2.20.

Related terms

Log4Shell (CVE-2021-44228): what it is and how to fix it, What is patch management? How to keep software updated safely, CISA KEV catalogue: Known Exploited Vulnerabilities, What does exploited in the wild mean? Why it should move a patch to the top of the list, Supply chain attack, What is vulnerability scanning? How automated checks find known weaknesses

How Wolfcore helps

A Wolfcore penetration test finds this the way an attacker would, by hand, not with a scanner. Start with the free web vulnerability scan at wolfcore.co.uk/free-web-vulnerability-scan and see our penetration testing service. Staff are often the first step in an attack, so you can also test them safely with our phishing simulation software or start the Phishy free trial.

Wolfcore

Would your staff click a phishing email?

Run a real, safe phishing test on your team with Phishy. Free for 14 days, up to 10 staff, no card. We help you set it up.

Start a free phishing testFree website security scanor book a 30 minute call