How to Fix CVE-2025–55182 in React and Next.js: The Patching Gu
A prototype pollution flaw in React Server Components' Flight protocol deserialisation allowed unauthenticated attackers to execute arbitrary code on the server via a crafted HTTP request. This could lead to full server takeover, including access to environment variables and internal networks.
Published on medium.com
The JavaScript ecosystem is currently facing one of its most significant security challenges to date. Disclosed in early December 2025, CVE-2025–55182,frequently referred to by security researchers as “React2Shell”, is a critical remote code execution (RCE) vulnerability affecting React and Next.js.
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 Flight protocol deserialiser did not properly guard against prototype pollution when handling keys like __proto__ or constructor, allowing modification of Object.prototype.
Impact
An unauthenticated attacker could execute arbitrary code, leading to full server takeover, access to secrets, and pivoting into internal networks; the text notes that a WAF rule and Node.js permission model can help mitigate but the primary fix is patching.
What the attacker needed
Application uses vulnerable React Server Components; No authentication required; Attacker can send HTTP requests to the server
The fix
The vulnerability was fixed in React 19.2.3 and Next.js 15.5.7/16.0.7; users should update to these versions and apply dependency overrides if needed.
How it was found
- Send a POST request to a Next.js endpoint (Server Action or page route) with a serialized Flight stream containing a dictionary that targets __proto__.
- Pollute the prototype with a custom then function to hijack promise resolution.
- Use Node.js child_process to execute arbitrary commands, often resulting in a reverse shell.
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 a description of a web page to the browser. The code that reads this description had a mistake: it let an attacker sneak in a special property that changes how all JavaScript objects behave. By doing this, the attacker could make the server run their own commands, giving them control of the machine.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.