Intentionally vulnerable Next.js application demonstrating CVE-2025-55182 RCE via unsafe deserialization in React Server Components. Includes exploit scripts and scanner integration for security research and education.
⚠️ WARNING: This application is intentionally vulnerable for educational and security research purposes only. DO NOT deploy to production or expose to the internet.
This is a vulnerable Next.js application that demonstrates CVE-2025-55182, a critical Remote Code Execution vulnerability in React Server Components. The application is designed to look like a professional cloud hosting dashboard while being intentionally vulnerable for security testing and educational purposes.
CVE Details:
curl_id.sh for testing the vulnerabilitynpm install --legacy-peer-deps
npm run dev
The application will be available at http://localhost:3000
The repository includes curl_id.sh, a command-line tool based on the Nuclei template for exploiting CVE-2025-55182.
Usage:
# Execute id command (default)
./curl_id.sh -d localhost:3000 -c id
# Execute custom commands
./curl_id.sh -d localhost:3000 -c "whoami"
./curl_id.sh -d localhost:3000 -c "uname -a"
./curl_id.sh -d localhost:3000 -c "ls -la /tmp"
# Test remote domains (if vulnerable)
./curl_id.sh -d vulnapp.com -c id
Options:
-d, --domain: Target domain/URL (default: http://localhost:3000)-c, --command: Command to execute (default: id)git clone https://github.com/assetnote/react2shell-scanner.git
cd react2shell-scanner
pip install -r requirements.txt
python3 scanner.py -u http://localhost:3000
python3 scanner.py -u http://localhost:3000 --safe-check
The vulnerability can be exploited by sending a crafted multipart POST request to the server with:
Next-Action: x headerX-Nextjs-Request-Id headerX-Nextjs-Html-Request-Id headerSee the react2shell-scanner repository for the exact payload structure.
The vulnerability exists in React Server Components' deserialization mechanism. When Next.js processes server actions, it deserializes the request payload. The vulnerable versions of React (19.0.0-19.2.0) do not properly validate or sanitize the deserialized data, allowing attackers to:
process.mainModule.require('child_process').execSync()X-Action-Redirect response headerThe exploit uses a prototype pollution attack in the JSON deserialization process. The payload structure includes:
then property that pollutes the prototype chain_response object with a _prefix field containing JavaScript codeexecSync() and redirects output to the response headerTo fix this vulnerability:
npm install react@latest react-dom@latest
npm install next@latest
npm audit fix
vuln-app-CVE-2025-55182/
├── app/
│ ├── actions.ts # Vulnerable server action
│ ├── layout.tsx # Root layout
│ └── page.tsx # Main dashboard page
├── node_modules/ # Dependencies
├── curl_id.sh # Exploit script for testing
├── package.json # Project dependencies (vulnerable versions)
├── tsconfig.json # TypeScript configuration
├── next.config.js # Next.js configuration
├── .gitignore # Git ignore rules
└── README.md # This file
This application is created solely for security research and educational purposes.
The authors and contributors are not responsible for any misuse of this code. Unauthorized access to computer systems is illegal and may result in criminal prosecution.
This is an educational repository. Contributions that improve documentation, add better examples, or enhance the educational value are welcome.
This project is provided for educational purposes. Use at your own risk.
Remember: This is a vulnerable application. Use responsibly and only in controlled environments for security research and education.