Remote Code Execution in Spring FrameworkGHSA-36p3-wjmg-h94x
CRITICALFix: spring-projects/spring-framework@002546bGHSA-36p3-wjmg-h94x is a critical-severity (CVSS 9.8) Code Injection vulnerability in org.springframework:spring-beans. It is in CISA's Known Exploited Vulnerabilities catalog (added 2022-04-04) — treat it as actively exploited and patch now. A fix is available for org.springframework:spring-beans — see the affected versions and patch details below.
Exploitation Status
Actively exploited in the wild
- Confirmed by CISA's Known Exploited Vulnerabilities catalog on 2022-04-04. Federal agencies were required to remediate by 2022-04-25.
- CISA assesses this as automatable — exploitation doesn’t require manual, per-target effort, which raises the odds of mass scanning and opportunistic attacks.
- A successful exploit gives an attacker total control of the affected component, not partial access.
Exploitation and automatability from CISA (KEV catalog and SSVC triage) for GHSA-36p3-wjmg-h94x.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
GHSA-36p3-wjmg-h94x by exploitation likelihood (EPSS) against impact (CVSS). In the shaded patch-first corner (EPSS 50%+, CVSS 7.0+).
Where this sits among everything scored
Of 394,803 CVEs with a current EPSS score, this one falls in the ≥ 90% band (highlighted). Counts from FIRST.org, log-scaled.
Real-World Exposure
org.springframework:spring-beans☕org.springframework:spring-beans☕org.springframework:spring-webmvc☕org.springframework:spring-webmvc☕org.springframework.boot:spring-boot-starter-web☕org.springframework.boot:spring-boot-starter-web☕org.springframework:spring-webflux☕org.springframework:spring-webflux+2 moreReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects Maven packages — download data is not available via public APIs for these ecosystems.
Description
Spring Framework prior to versions 5.2.20 and 5.3.18 contains a remote code execution vulnerability known as Spring4Shell.
Impact
A 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.
These are the prerequisites for the exploit:
- JDK 9 or higher
- Apache Tomcat as the Servlet container
- Packaged as WAR
spring-webmvcorspring-webfluxdependency
Patches
Workarounds
For 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.
To 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).
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| ☕Maven | org.springframework:spring-beans | all versions | 5.2.20.RELEASEorg.springframework:spring-beans:5.2.20.RELEASE |
| ☕Maven | org.springframework:spring-beans | ≥ 5.3.0&&< 5.3.18 | 5.3.18org.springframework:spring-beans:5.3.18 |
| ☕Maven | org.springframework:spring-webmvc | all versions | 5.2.20.RELEASEorg.springframework:spring-webmvc:5.2.20.RELEASE |
| ☕Maven | org.springframework:spring-webmvc | ≥ 5.3.0&&< 5.3.18 | 5.3.18org.springframework:spring-webmvc:5.3.18 |
| ☕Maven | org.springframework.boot:spring-boot-starter-web | all versions | 2.5.12org.springframework.boot:spring-boot-starter-web:2.5.12 |
| ☕Maven | org.springframework.boot:spring-boot-starter-web | ≥ 2.6.0&&< 2.6.6 | 2.6.6org.springframework.boot:spring-boot-starter-web:2.6.6 |
Affected Products
cx cloud agentciscocommerce platformoraclecommunications cloud native core automated test suiteoraclecommunications cloud native core binding support functionoraclecommunications cloud native core consoleoraclecommunications cloud native core network exposure functionoracleResearch use only. For defensive security, authorized penetration testing, and academic research only. Never execute exploit code against systems without explicit written authorization.
A Spring MVC or Spring WebFlux application running on JDK 9+ may be vuln…
A Spring MVC or Spring WebFlux application running on JDK 9+ may be vuln…
A Spring MVC or Spring WebFlux application running on JDK 9+ may be vuln…
A Spring MVC or Spring WebFlux application running on JDK 9+ may be vuln…
A Spring MVC or Spring WebFlux application running on JDK 9+ may be vuln…
A Spring MVC or Spring WebFlux application running on JDK 9+ may be vuln…
A Spring MVC or Spring WebFlux application running on JDK 9+ may be vuln…
A Spring MVC or Spring WebFlux application running on JDK 9+ may be vuln…
A Spring MVC or Spring WebFlux application running on JDK 9+ may be vuln…
A Spring MVC or Spring WebFlux application running on JDK 9+ may be vuln…
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for org.springframework:spring-beans, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update org.springframework:spring-beans to 5.2.20.RELEASE or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-36p3-wjmg-h94x is resolved across your whole dependency graph.
Workarounds
Stop passing untrusted input into the interpreter or shell: call the affected binary with an argument array rather than a composed command string, reject anything outside a strict allowlist of expected values, and run the component under an account that cannot reach beyond the work it legitimately does.
How to detect GHSA-36p3-wjmg-h94x
A community-maintained Nuclei template exists for this CVE. You can scan for it directly:
nuclei -id ghsa-36p3-wjmg-h94x -u https://target- Template
- Spring - Remote Code Execution
- Severity
- critical
- Impact
- Successful exploitation of this vulnerability could allow an attacker to execute arbitrary code on the affected system.
- Remediation
- If the application is deployed as a Spring Boot executable jar, i.e. the default, it is not vulnerable to this exploit.
Template by ProjectDiscovery nuclei-templates (justmumu, arall, dhiyaneshDK), MIT licensed. View the full template. Scan only systems you are authorised to test.
Fixing This On Your OS
If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.
The reporter of this flaw provided a proof-of-concept that relied on Apache Tomcat; it accessed the classloader and changed logging properties to place a web shell in Tomcat's root directory, and was able to call various commands subsequently. There are several conditions required to achieve this exploit: -Java 9 or…
For those who are not able to upgrade affected Spring classes to the fixed versions, there is a workaround customers can implement for their applications, via setting disallowed fields on the data binder, and denying various iterations of the string "class.*" For full implementation details, see Spring's early announcement post in the "suggested workarounds" section: https://spring.io/blog/2022/03/31/spring-framework-rce-early-announcement#suggested-workaroundsSource: Red Hat security advisory for GHSA-36p3-wjmg-h94x (CC BY 4.0)
| Product | Fixed in | Advisory |
|---|---|---|
| CEQ 2.2.1-1 (CVE-2022-22965) | see advisory | RHSA-2022:1306 |
| Red Hat AMQ 7.8.6 | see advisory | RHSA-2022:1626 |
| Red Hat AMQ 7.9.4 | spring-webmvc | RHSA-2022:1627 |
| Red Hat Fuse 7.10.2 | spring-webmvc | RHSA-2022:1360 |
| RHDM 7.12.1 async | spring-webmvc | RHSA-2022:1379 |
| RHINT Camel-K 1.6.5 | spring-beans | RHSA-2022:1333 |
| RHPAM 7.12.1 async | spring-webmvc | RHSA-2022:1378 |
Frequently Asked Questions
Is GHSA-36p3-wjmg-h94x in your dependencies?
Find it across Maven, including transitive dependencies.