Understanding React2Shell: A Critical Vulnerability in React Server Components (CVE-2025–55182)
A deserialisation flaw in React Server Components' Flight protocol allowed crafted payloads to pollute object prototypes and build gadget chains, leading to remote code execution. An attacker could run arbitrary code on affected servers, with exploitation observed in the wild.
osintteam.blog
Published on osintteam.blog
In the rapidly evolving landscape of web development, React has established itself as a cornerstone framework for building dynamic user interfaces. However, with its advancements, such as React Server Components (RSC), come potential security risks.
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 Flight deserialiser lacked type checking and sanitisation, so attacker-controlled keys could pollute prototypes and reach the Function constructor.
Impact
An attacker could achieve remote code execution, potentially escalating to shell access or data exfiltration; the text says exploitation was seen in the wild.
What the attacker needed
Server runs a vulnerable RSC version; attacker can send an HTTP request; RSC endpoint reachable
The fix
It should be fixed by upgrading to the patched React and Next.js releases and by not passing untrusted data to RSC deserialisers.
How it was found
- Build a self-referential payload whose chunks point to native objects such as arrays.
- Add a fake response object with a formData getter aimed at the Function constructor and a prefix holding the command.
- Send the payload so the server resolves the references and triggers a promise chain.
- The Function constructor runs the prefix, giving code execution.
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 turn data sent by a browser back into React components. The server trusted that data too much, so a malicious request could make it run the attacker's code. This is called remote code execution, meaning someone else can run commands on your machine.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.