React2Shell: Technical Deep-Dive & In-the-Wild Exploitation of CVE-2025-55182
A critical deserialisation flaw in React Server Components allows attackers to execute arbitrary code on the server by sending a crafted payload. Attackers exploited this in the wild to gain shells, steal credentials, mine cryptocurrency, and install backdoors.
Published on wiz.io
The disclosure of CVE-2025-55182, a critical Remote Code Execution (RCE) vulnerability in React, has sent shockwaves through the industry. Dubbed "React2Shell," this vulnerability allows attackers to bypass security boundaries and execute arbitrary code on the server by exploiting improper input deserialization within…
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the deserialiser failed to validate the types of objects referenced in the payload, allowing attacker-controlled properties to reach the Function constructor.
Impact
Attackers could execute arbitrary code on the server, leading to credential theft, cryptomining, and persistent backdoors; the exploit works on any Next.js application by default and also affects other RSC frameworks like Waku and Vite with minor adjustments.
What the attacker needed
Internet-facing Next.js app; no authentication needed; send next-action header
How it was found
- Send a request with the next-action header to any Next.js application, even without defined Server Actions.
- Craft a payload with self-referencing chunks that replace legitimate objects with gadgets.
- Point a formData.get property to an array's constructor chain to reach the Function constructor.
- Set a prefix property to the JavaScript code to execute.
- Trigger the promise chain so the Function constructor is called with the attacker's code.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
React Server Components let a server send special data to the browser. The server code that reads this data did not check what kind of objects were inside, so an attacker could sneak in a reference to JavaScript's built-in Function constructor, which works like eval and runs any text as code. This meant an attacker could run their own commands on the server just by sending a crafted request.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.