
A proof-of-concept tool for demonstrating the critical React2Shell vulnerability
A proof-of-concept tool for demonstrating the critical React2Shell vulnerability (CVE-2025-55182 / CVE-2025-66478) on authorized, local testing environments only.
CVE-2025-55182 (React2Shell) is a critical, pre-authentication Remote Code Execution (RCE) vulnerability in the React Server Components (RSC) "Flight" protocol. A separate identifier, CVE-2025-66478, was assigned for Next.js but has since been rejected as a duplicate of CVE-2025-55182, as both share the same root cause.
chmod +x pwn-nextjs.sh
./pwn-nextjs.sh [TARGET_URL] [COMMAND]
# Target specific URL
./pwn-nextjs.sh https://vulnerable-app.example.com "whoami"
root
The vulnerability originates in specific React packages, affecting any framework that bundles them.
Not Affected: Next.js 13.x, Next.js 14.x stable releases, Pages Router applications, and the Edge Runtime are not affected.
The RSC Flight protocol serializes data for client-server communication. The vulnerability lies in the deserialization logic on the server, which unsafely expands object properties from the incoming payload without adequate validation. This allows an attacker to inject malicious keys (like __proto__ or constructor) into the request, leading to prototype pollution.
Once the prototype chain is polluted, the server follows attacker-influenced execution paths. This can be chained to execute arbitrary JavaScript code with server privileges, leading to full Remote Code Execution (RCE).
Security researchers have observed successful exploits leading to:
.aws/credentials).Patching is mandatory and the only way to fully eliminate the vulnerability. There is no configuration setting to disable the vulnerable code path.
# For Next.js users, upgrade to the latest patched version in your release line.
# Example: If you are on Next.js 15.5.x:
npm install [email protected]
# Also ensure React dependencies are updated:
npm install react@latest react-dom@latest
Verify that your package-lock.json or yarn.lock files reflect the patched react-server-dom-* package versions (19.0.1, 19.1.2, or 19.2.1).
While patching, deploy Web Application Firewall (WAF) rules to block exploit attempts:
AWSManagedRulesKnownBadInputsRuleSet (v1.24+) includes rules for this CVE.cve-canary rule is available.Note: WAF rules are a temporary, incomplete mitigation. They do not replace the need to patch.
Review logs for these signs of exploitation attempts:
next-action or rsc-action-id headers. Request bodies containing patterns like $@ or "status":"resolved_model".whoami, id, uname), reads of /etc/passwd, or file writes to /tmp/ (e.g., pwned.txt) by Node.js processes.This tool demonstrates a vulnerability with a CVSS score of 10.0 (Maximum Severity) that is under active, state-sponsored exploitation.
Remember: This tool demonstrates why patching is urgent. Use this knowledge to improve security and defend systems, not to compromise them. Ensure all your dependencies are updated to the patched versions listed above.
TAHA MOUNIR
| Component | Affected Versions | Patched Versions | Notes |
|---|
| React Packages ( react-server-dom-webpack, -parcel, -turbopack) | 19.0.0, 19.1.0, 19.1.1, 19.2.0 | 19.0.1, 19.1.2, 19.2.1 | Source of the upstream flaw. |
| Next.js (App Router) | 15.x, 16.x, 14.3.0-canary.77 and later | 15.0.5, 15.1.9, 15.2.6, 15.3.6, 15.4.8, 15.5.7, 16.0.7 | Primary affected framework. |
| Other Frameworks | React Router, Waku, RedwoodJS, Parcel (@parcel/rsc), Vite RSC Plugin | Update to versions using patched React packages (>19.0.1, 19.1.2, 19.2.1). | Vulnerable if using the affected React packages. |