XenonStack

Security Intelligence

XenonStack Insights Spring4Shell (CVE-2022-22965): Affected Versions and Fix

and | Published | Updated

Spring4Shell CVE-2022-22965 guide: affected versions, fixed versions and workarounds, as a four-layer stack from advisory to fix

Key takeaway

  • Spring4Shell (CVE-2022-22965) is a critical Spring Framework flaw. See affected and fixed versions, who is exposed, workarounds and how to confirm the fix.

Spring4Shell is the name given to CVE-2022-22965, a critical remote code execution flaw in the Spring Framework that abuses data binding on JDK 9 or higher. NVD scores it 9.8 (Critical) and describes the known exploit as needing a WAR deployment on Apache Tomcat. The fix is to upgrade to Spring Framework 5.3.18 or 5.2.20 or later.

This guide is for architects, platform leads and security teams who need to decide quickly whether a Java estate is exposed. It sets out the conditions for the known exploit, the exact affected and fixed versions as published by Spring, the tactical workarounds, and how to confirm and govern the fix. For wider hygiene, see our application security checklist.

What is the Spring4Shell vulnerability?

The Spring Framework is a widely used open-source application framework for Java. Spring4Shell (also called SpringShell) is a flaw in how Spring MVC and Spring WebFlux bind HTTP request data to Java objects. According to the Spring advisory, an application on JDK 9 or higher may be open to remote code execution via data binding. NVD classifies the weakness as CWE-94, improper control of generation of code, and rates it CVSS v3.1 9.8 Critical (see NVD).

The Spring advisory was published on 31 March 2022 and NVD lists the entry on 1 April 2022. Data binding itself is a normal feature. The risk comes from letting a request reach parts of the object graph that were never meant to be set by an outside client. The Spring DataBinder documentation carries a warning to this effect.

Is my application affected?

The advisory lists the prerequisites for the known exploit. An application needs all of them:

Two-column diagram: exposure conditions (JDK 9+, Tomcat, WAR, spring-webmvc or webflux) mapped to responses (upgrade Spring, upgrade Tomcat, downgrade to Java 8, disallowed fields).
  • JDK 9 or higher.
  • Apache Tomcat as the servlet container.
  • Packaged as a WAR, not as an executable JAR.
  • A spring-webmvc or spring-webflux dependency.

The advisory adds that default Spring Boot executable JARs are not vulnerable to this exploit, but that the underlying issue is more general and may be exploitable in other ways. Treat that as a reason to patch every affected version, not only the Tomcat WAR case. The early announcement records that on 8 April 2022 Snyk reported a further attack vector for Glassfish and Payara.

ComponentAffected versionsFixed versionsSource
Spring Framework (CVE-2022-22965)5.3.0 to 5.3.17; 5.2.0 to 5.2.19; older versions5.3.18; 5.2.20spring.io
Spring Boot (dependency route)Versions using affected Spring Framework2.6.6; 2.5.12 (depend on 5.3.18)spring.io
Spring Cloud Function (CVE-2022-22963)3.2.2; 3.1.6 and earlier3.2.3; 3.1.7spring.io

How is Spring4Shell different from CVE-2022-22963?

Early reports mixed the two up, because a Spring Cloud Function advisory appeared on 29 March 2022, two days before the Spring Framework one. CVE-2022-22963 is rated critical and concerns routing functionality, where a specially crafted SpEL routing expression can lead to remote code execution. It affects only services using Spring Cloud Function. Spring4Shell (CVE-2022-22965) is a Spring Framework flaw and the Spring early announcement describes the two as unrelated. Check both in an inventory, because a service can be exposed to one and not the other.

How do we confirm exposure without running an exploit?

Work from an inventory, not from probing live endpoints. A defensive check has four steps:

  1. List every Java service and its Spring Framework version from your build files or software bill of materials.
  2. Flag services on 5.3.0 to 5.3.17 or 5.2.19 and earlier.
  3. For those, check the JDK version (9 or higher), the packaging (WAR) and the servlet container (Tomcat).
  4. Check for spring-webmvc or spring-webflux, and separately for Spring Cloud Function 3.2.2 or 3.1.6 and earlier.

A passing probe result does not prove a service is safe, so patching by version is more reliable than testing by request. Review web server and WAF logs for unexpected requests to application endpoints from March 2022 onwards if the estate was exposed to the internet during that period.

How do we fix Spring4Shell?

The advisory's position is that upgrading to a fixed version needs no further steps. The early announcement lists the following options in order of preference.

OptionWhen it fitsStatus
Upgrade Spring Framework to 5.3.18 or 5.2.20 or laterPreferred fix for all affected applicationsFixes the root cause (per the Spring early announcement)
Upgrade Apache Tomcat to 10.0.20, 9.0.62 or 8.5.78Older, unsupported Spring versions that cannot move yetTactical: closes the attack vector on Tomcat's side
Downgrade to Java 8Only if neither Spring nor Tomcat can be upgradedTactical workaround
Set disallowed fields on the data binder globallyDefence in depth while upgradingSpring notes a controller's local @InitBinder can override a global setting

Spring's follow-up notes that Tomcat upgrades are a tactical fix and that teams on unsupported Spring versions should move to a supported version as soon as possible. The early announcement also links a follow-up on a related data binding issue, CVE-2022-22968, which concerns the disallowed fields setting. Confirm current guidance on the Spring advisory page before you act, since advisories are updated.

Why did Spring4Shell become a board-level issue?

CISA added CVE-2022-22965 to its Known Exploited Vulnerabilities catalogue on 4 April 2022 (as shown on NVD), which signals active exploitation. For a CISO or head of platform engineering, the lesson is less about one CVE than about response speed: how quickly you can name every service on a vulnerable library version, and who owns the patch.

Teams that run a security operations function can fold this into routine triage. Our guide to the security operation centre covers how detection and response are organised, and our zero trust security architecture article explains how to limit what a compromised service can reach.

What governance does a library vulnerability need?

ControlWhat it answersOwner
Software bill of materials per serviceWhich services use which Spring version?Platform engineering
Dependency upgrade policy with a deadline for critical CVEsHow fast must a critical fix land?Engineering leadership and CISO
Network segmentation and least privilege for runtime accountsWhat can an attacker reach after code execution?Security architecture
Evidence of the fixCan we show which build closed the exposure?Risk and audit

As teams add AI agents that call internal services, the same discipline applies to what an agent may do. ElixirData Context OS keeps governed context, versioned policy and decision traces in one decision layer above AI agents, and AgentGRC keeps autonomous agent actions inside policy, with the audit trail risk teams need.

When is this advice not enough?

Patching Spring does not remove other weaknesses in the same application, and it does not tell you whether the service was compromised before the patch. If a vulnerable, internet-facing service ran between disclosure and fix, treat it as a possible incident: review logs, check for unexpected files and processes on the host, and follow your incident response plan. This post is general information, not a forensic or legal opinion.

To map one security decision your agents should make, and the context and policy it depends on, book a Context Workshop. See what happens in the workshop.

Frequently asked questions

Is every Spring application affected by Spring4Shell?

No. According to the Spring advisory, the known exploit needs JDK 9 or higher, Apache Tomcat as the servlet container, a WAR deployment and a spring-webmvc or spring-webflux dependency. Default Spring Boot executable JARs are not vulnerable to that exploit, although the advisory notes the underlying issue is more general.

Which Spring Framework versions are affected and which are fixed?

Spring Framework 5.3.0 to 5.3.17, 5.2.0 to 5.2.19 and older versions are affected. The fixed releases are 5.3.18 and 5.2.20, as listed in the advisory and in the early announcement. Spring Boot 2.6.6 and 2.5.12 depend on Spring Framework 5.3.18.

Is Spring4Shell the same as CVE-2022-22963?

No. CVE-2022-22963 is a separate flaw in Spring Cloud Function, where a specially crafted SpEL routing expression can lead to remote code execution. It is fixed in Spring Cloud Function 3.2.3 and 3.1.7. CVE-2022-22965 is the Spring Framework data binding flaw.

If I cannot upgrade Spring straight away, what can I do?

The early announcement lists tactical options: upgrade Apache Tomcat to 10.0.20, 9.0.62 or 8.5.78, downgrade to Java 8, or set disallowed fields on the data binder globally. It names upgrading Spring Framework as the preferred fix.

Was Spring4Shell exploited in the wild?

Yes. NVD records that CISA added CVE-2022-22965 to its Known Exploited Vulnerabilities catalogue on 4 April 2022, with the required action to apply updates per vendor instructions.

Ready to put AI agents to work? See an ElixirClaw demo: the agentic OS to build, orchestrate and govern AI agents across your enterprise systems.

Table of Contents

navdeep-singh-gill

Navdeep Singh Gill

Global CEO and Founder of XenonStack

LinkedIn profile

Navdeep Singh Gill is serving as Chief Executive Officer and Product Architect at XenonStack. He holds expertise in building SaaS Platform for Decentralised Big Data management and Governance, AI Marketplace for Operationalising and Scaling. His incredible experience in AI Technologies and Big Data Engineering thrills him to write about different use cases and its approach to solutions.

Get the latest articles in your inbox

Subscribe Now

Interested in Solving your Challenges with XenonStack Team
Get Started

Get Started with your requirements and primary focus, that will help us to make your solution

Please Select your Industry
Banking
Fintech
Payment Providers
Wealth Management
Discrete Manufacturing
Semiconductor
Machinery Manufacturing / Automation
Appliances / Electrical / Electronics
Elevator Manufacturing
Defense & Space Manufacturing
Computers & Electronics / Industrial Machinery
Motor Vehicle Manufacturing
Food and Beverages
Distillery & Wines
Beverages
Shipping
Logistics
Mobility (EV / Public Transport)
Energy & Utilities
Hospitality
Digital Gaming Platforms
SportsTech with AI
Public Safety - Explosives
Public Safety - Firefighting
Public Safety - Surveillance
Public Safety - Others
Media Platforms
City Operations
Airlines & Aviation
Defense Warfare & Drones
Robotics Engineering
Drones Manufacturing
AI Labs for Colleges
AI MSP / Quantum / AGI Institutes
Retail Apparel and Fashion

Proceed Next