Vulnerabilities in pkg:maven/org.springframework.boot/spring-boot-starter-web
PACKAGECVE-2022-22965 is a CRITICAL (CVSS 9.8) remote code execution vulnerability (CWE-94: Improper Control of Generation of Code ('Code Injection')) affecting Spring Framework libraries in the Maven ecosystem. The issue involves remote code execution in spring framework. Remediation is available by upgrading affected packages to version 5.2.20.RELEASE, 5.3.18, 2.5.12, 2.6.6.
pkg:maven/org.springframework.boot/spring-boot-starter-web
Vulnerability advisories affecting package pkg:maven/org.springframework.boot/spring-boot-starter-web. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-36p3-wjmg-h94x | CVE-2022-22965 | CRITICAL | Remote Code Execution in Spring Framework |
CVE-2022-22965 at a Glance
Security Impact
CVSS: 9.8
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H/E:H).
How to Fix CVE-2022-22965
To remediate this vulnerability, upgrade all affected Spring Framework dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>5.2.20.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>5.3.18</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>5.2.20.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>5.3.18</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>2.5.12</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>2.6.6</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webflux</artifactId>
<version>5.2.20.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webflux</artifactId>
<version>5.3.18</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-webflux</artifactId>
<version>2.5.12</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-webflux</artifactId>
<version>2.6.6</version>
</dependency>
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
mvn dependency:tree -Dincludes=org.springframework
How to Check if You Are Affected
To determine whether your Java application is affected by CVE-2022-22965, inspect your build dependencies using the Maven Dependency Plugin:
mvn dependency:tree -Dincludes=org.springframework
Analyze the terminal output to locate any version of Spring Framework in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.2.20.RELEASE), your application is affected.
Note: The mvn dependency:tree -Dincludes=org.springframework command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-94: Improper Control of Generation of Code ('Code Injection'), where the product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment. In Spring Framework, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2022-22965 Affected Spring Framework Versions
10 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
org.springframework:spring-beans
|
Maven |
< 5.2.20.RELEASE
|
5.2.20.RELEASE
|
|
org.springframework:spring-beans
|
Maven |
≥ 5.3.0
< 5.3.18
|
5.3.18
|
|
org.springframework:spring-webmvc
|
Maven |
< 5.2.20.RELEASE
|
5.2.20.RELEASE
|
|
org.springframework:spring-webmvc
|
Maven |
≥ 5.3.0
< 5.3.18
|
5.3.18
|
|
org.springframework.boot:spring-boot-starter-web
|
Maven |
< 2.5.12
|
2.5.12
|
|
org.springframework.boot:spring-boot-starter-web
|
Maven |
≥ 2.6.0
< 2.6.6
|
2.6.6
|
|
org.springframework:spring-webflux
|
Maven |
< 5.2.20.RELEASE
|
5.2.20.RELEASE
|
|
org.springframework:spring-webflux
|
Maven |
≥ 5.3.0
< 5.3.18
|
5.3.18
|
|
org.springframework.boot:spring-boot-starter-webflux
|
Maven |
< 2.5.12
|
2.5.12
|
|
org.springframework.boot:spring-boot-starter-webflux
|
Maven |
≥ 2.6.0
< 2.6.6
|
2.6.6
|
References
Frequently Asked Questions
What is CVE-2022-22965?
Which Spring Framework versions are affected?
What version fixes CVE-2022-22965?
Is spring-beans affected?
Is spring-webmvc affected?
What is the CVSS score of CVE-2022-22965?
What CWE is associated with CVE-2022-22965?
How can I check Maven dependencies for CVE-2022-22965?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-36p3-wjmg-h94x",
"modified" : "2025-10-22T19:18:34Z",
"published" : "2022-03-31T18:30:50Z",
"aliases" : [ "CVE-2022-22965" ],
"summary" : "Remote Code Execution in Spring Framework",
"details" : "Spring Framework prior to versions 5.2.20 and 5.3.18 contains a remote code execution vulnerability known as `Spring4Shell`. \n\n## Impact\n\nA Spring MVC or Spring WebFlux application running on JDK 9+ may be vulnerable to remote code execution (RCE) via data binding. The specific exploit requires the application to run on Tomcat as a WAR deployment. If the application is deployed as a Spring Boot executable jar, i.e. the default, it is not vulnerable to the exploit. However, the nature of the vulnerability is more general, and there may be other ways to exploit it.\n\nThese are the prerequisites for the exploit:\n- JDK 9 or higher\n- Apache Tomcat as the Servlet container\n- Packaged as WAR\n- `spring-webmvc` or `spring-webflux` dependency\n\n## Patches\n\n- Spring Framework [5.3.18](https://github.com/spring-projects/spring-framework/releases/tag/v5.3.18) and [5.2.20](https://github.com/spring-projects/spring-framework/releases/tag/v5.2.20.RELEASE)\n- Spring Boot [2.6.6](https://github.com/spring-projects/spring-boot/releases/tag/v2.6.6) and [2.5.12](https://github.com/spring-projects/spring-boot/releases/tag/v2.5.12)\n\n## Workarounds\n\nFor those who are unable to upgrade, leaked reports recommend setting `disallowedFields` on `WebDataBinder` through an `@ControllerAdvice`. This works generally, but as a centrally applied workaround fix, may leave some loopholes, in particular if a controller sets `disallowedFields` locally through its own `@InitBinder` method, which overrides the global setting.\n\nTo apply the workaround in a more fail-safe way, applications could extend `RequestMappingHandlerAdapter` to update the `WebDataBinder` at the end after all other initialization. In order to do that, a Spring Boot application can declare a `WebMvcRegistrations` bean (Spring MVC) or a `WebFluxRegistrations` bean (Spring WebFlux).",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H/E:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Maven",
"name" : "org.springframework:spring-beans"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "5.2.20.RELEASE"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.springframework:spring-beans"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "5.3.0"
}, {
"fixed" : "5.3.18"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.springframework:spring-webmvc"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "5.2.20.RELEASE"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.springframework:spring-webmvc"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "5.3.0"
}, {
"fixed" : "5.3.18"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.springframework.boot:spring-boot-starter-web"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.5.12"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.springframework.boot:spring-boot-starter-web"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.6.0"
}, {
"fixed" : "2.6.6"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.springframework:spring-webflux"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "5.2.20.RELEASE"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.springframework:spring-webflux"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "5.3.0"
}, {
"fixed" : "5.3.18"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.springframework.boot:spring-boot-starter-webflux"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.5.12"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.springframework.boot:spring-boot-starter-webflux"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.6.0"
}, {
"fixed" : "2.6.6"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-22965"
}, {
"type" : "WEB",
"url" : "https://github.com/spring-projects/spring-framework/commit/002546b3e4b8d791ea6acccb81eb3168f51abb15"
}, {
"type" : "WEB",
"url" : "https://cert-portal.siemens.com/productcert/pdf/ssa-254054.pdf"
}, {
"type" : "WEB",
"url" : "https://github.com/spring-projects/spring-boot/releases/tag/v2.5.12"
}, {
"type" : "WEB",
"url" : "https://github.com/spring-projects/spring-boot/releases/tag/v2.6.6"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/spring-projects/spring-framework"
}, {
"type" : "WEB",
"url" : "https://github.com/spring-projects/spring-framework/releases/tag/v5.2.20.RELEASE"
}, {
"type" : "WEB",
"url" : "https://github.com/spring-projects/spring-framework/releases/tag/v5.3.18"
}, {
"type" : "WEB",
"url" : "https://psirt.global.sonicwall.com/vuln-detail/SNWLID-2022-0005"
}, {
"type" : "WEB",
"url" : "https://spring.io/blog/2022/03/31/spring-framework-rce-early-announcement"
}, {
"type" : "WEB",
"url" : "https://tanzu.vmware.com/security/cve-2022-22965"
}, {
"type" : "WEB",
"url" : "https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-java-spring-rce-Zx9GUc67"
}, {
"type" : "WEB",
"url" : "https://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2022-22965"
}, {
"type" : "WEB",
"url" : "https://www.kb.cert.org/vuls/id/970766"
}, {
"type" : "WEB",
"url" : "https://www.oracle.com/security-alerts/cpuapr2022.html"
}, {
"type" : "WEB",
"url" : "https://www.oracle.com/security-alerts/cpujul2022.html"
}, {
"type" : "WEB",
"url" : "http://packetstormsecurity.com/files/166713/Spring4Shell-Code-Execution.html"
}, {
"type" : "WEB",
"url" : "http://packetstormsecurity.com/files/167011/Spring4Shell-Spring-Framework-Class-Property-Remote-Code-Execution.html"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-74", "CWE-94" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2022-03-31T18:30:50Z",
"nvd_published_at" : "2022-04-01T23:15:00Z"
}
}