I Exploited React2Shell and Got Shell Access
Everyone has been talking about CVE-2025-55182 these last couple of days, and rightfully so. It scored a Critical 10.0, enabling RCE on vulnerable React versions.
The vulnerability is present in versions 19.0, 19.1.0, 19.1.1, and 19.2.0 of:
- react-server-dom-webpack
- react-server-dom-parcel
- react-server-dom-turbopack
If you haven't updated yet, you should!!
In this post, I walk through how I got shell access running a vulnerable React version, connecting to my C2 server that I built in my previous blog post, and running commands on the Ubuntu VM. Everything here is performed inside an isolated environment and is strictly for educational purposes.
Lab Setup Overview
- Host machine: MacBook
- Virtual environment: VirtualBox
- Target VM: Ubuntu 24
CVE-2025-55182
CVE-2025-55182, nicknamed "React2Shell," is a critical (CVSS score of 10.0) vulnerability that allows for unauthenticated remote code execution (RCE) in applications utilizing React Server Components (RSC).
Vulnerability Type: Insecure Deserialization, specifically within the React Server Components protocol.
Impact: An unauthenticated remote attacker can send a specially crafted HTTP request to a vulnerable server function endpoint, leading to the execution of arbitrary code on the server. This can result in full server compromise, data exfiltration, and lateral movement.
Severity: Critical (CVSS: 10.0). The flaw is highly reliable and easily exploited.
How the RCE Works
The vulnerability stems from improper deserialization of untrusted data in React's Flight protocol, which is used to communicate between client and server components. When a malicious payload is sent to a server function endpoint, the server deserializes the data without proper validation, allowing arbitrary code execution.
The attack flow:
- Attacker crafts a malicious serialized payload
- Payload is sent to a vulnerable server function endpoint
- React Server Components deserialize the payload without validation
- Arbitrary code executes in the server context
- Attacker gains full control of the server
"Easily exploited" is putting it mildly. Below are the PoC and Burp Suite requests I used:
Getting Shell Access
In my previous blog post I Hacked AI To Build Me a C2 Server and Get Shell Access, I explained how the C2 server is built and the extended functionalities added. I added a command to open the browser and browse to my website as a proof of concept.
Claude generated a Python-based C2 server that I extended with:
- Task queueing
- Operator console commands
The server exposes the following endpoints:
- GET /task — Agent retrieves the next task
- GET /queue — View pending tasks
- POST /report — Agent reports results
- POST /enqueue — Operator adds tasks
Pre-loaded tasks (task_queue.json):
[
{ "task": "SHELL:whoami" },
{ "task": "SHELL:xdg-open https://jordydekoning.com" }
]
Setting Up the Agent
Because of the RCE vulnerability, we can modify the Burp Suite request to download and execute the agent.py silently in the background. The payload injects a command to fetch the agent from our HTTP server and execute it.
Claude also generated a Python agent capable of:
- Connecting to the C2 server
- Polling
/task - Executing shell commands
- Gathering system info
- Uploading files in base64
To deliver the script to the VM, I hosted it using:
python3 -m http.server 8000
Then it's accessible over
http://<host-ip>:8000/agent.py
Running the Agent
When the Burp request is sent to the React server, you can directly see the connection being established between the C2 server and the agent.
The agent fetches the tasks and executes them, logging whoami and opening this blog website. Then I execute a reboot command from the C2 server, and the VM reboots.
Demonstration Video
Watch the full exploitation process in action:
The video shows:
- Setting up the vulnerable React application
- Crafting and sending the malicious payload via Burp Suite
- Agent downloading and establishing C2 connection
- Executing remote commands on the target system
- Full system compromise demonstration
Conclusion
This demonstration shows how critical the React2Shell vulnerability truly is. With minimal effort, an attacker can achieve full remote code execution on vulnerable React applications. The combination of a simple HTTP request and a basic C2 infrastructure can lead to complete system compromise.
Key takeaways:
- Update immediately: If you're running affected React versions (19.0-19.2.0), update to patched versions now
- Monitor for exploitation: Check server logs for suspicious requests to server function endpoints
- Defense in depth: Even with patches, implement additional security layers like WAF rules and network segmentation
- Regular security audits: This vulnerability highlights the importance of keeping dependencies updated
Remember, this demonstration was performed in a controlled lab environment for educational purposes only. Never attempt to exploit vulnerabilities on systems you don't own.