React2Shell Deep Dive: Unpacking the Remote Code Execution Flaw i
The React Server Components deserialiser failed to validate that properties belonged directly to the object, allowing prototype pollution via a crafted Flight payload. An attacker could then hijack a promise's then method to run arbitrary commands on the server without authentication.
Published on medium.com
If you’re using React Server Components (RSC), your application is at risk because of a severe vulnerability called React2Shell (CVE-2025–55182). This flaw chains Insecure Deserialization and Prototype Pollution to achieve Unauthenticated Remote Code Execution (RCE).
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
The deserialiser did not check that properties being set were the object's own properties, so a __proto__ key could modify the global object prototype.
Impact
An unauthenticated attacker could execute arbitrary commands on the server with the Node.js process's privileges.
What the attacker needed
Application uses React Server Components; unpatched React version; no authentication needed
The fix
The React community released patches for the insecure deserialisation logic, and users of React Server Components should update immediately.
How it was found
- Send a crafted Flight payload containing a __proto__ key to a Server Action endpoint.
- The vulnerable deserialiser processes the key and pollutes the global object prototype.
- The polluted prototype sets a malicious value for the then method on an internal object such as Chunk.
- When the server resolves a promise or processes the next chunk, the runtime calls the polluted then method.
- The method executes a Node.js command such as child_process.execSync with the server process's privileges.
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.
When a React app uses Server Components, the browser sends data to the server that the server rebuilds into objects. The code doing that rebuilding trusted special property names it should have ignored, so an attacker could change the shared template that all objects on the server are based on. That let them swap a normal function for a command, and the server ran it.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.