Our React2Shell Vulnerability Nightmare
A critical unauthenticated remote code execution vulnerability exists in React Server Components due to unsafe deserialization of Flight payloads, allowing attackers to execute arbitrary JavaScript on the server. This affects default configurations of React 19 and frameworks like Next.js, and exploitation was attempted against the author's AWS servers.
medium.com
Published on medium.com
The modern JavaScript ecosystem was shaken last month as Meta, Vercel, Google Cloud, AWS, and leading security researchers revealed the vulnerabilities that affect React 19 and all major frameworks embedding the RSC (React Server Components) implementation, most notably Next.js 15.x and 16.x.
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 server does not sufficiently validate the structure or type of data in incoming Flight payloads, leading to unsafe deserialization and prototype pollution.
Impact
An attacker could execute arbitrary JavaScript on the server, potentially leading to full remote code execution, and exploitation attempts were observed in the wild.
What the attacker needed
Server running vulnerable React 19 or Next.js; No authentication required; Network access to the server
The fix
The vulnerability was fixed by upgrading React to patched versions (19.0.1, 19.1.2, or 19.2.1) and updating frameworks like Next.js to their fixed releases.
How it was found
- Receive a serialized Flight payload from the client.
- Fail to validate the structure or type of data within the payload.
- Attempt to reconstruct component instances and their dependencies.
- Treat attacker-controlled data as part of internal rendering or execution steps.
- Execute code paths that were never intended to be externally triggered.
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 is a feature that lets a server send parts of a web page to the browser. The vulnerability is like a parcel service that doesn't check what's inside the box, so someone can send a box that makes the server run their code. This means an attacker could take control of the server without needing a password.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.