Deep Dive Into CVE-2025–66478: Understanding React Server Compo
React Server Components' Flight Protocol deserialization failed to check property ownership, allowing prototype chain traversal to reach the Function constructor. An attacker could craft a malicious payload to execute arbitrary code on the server.
Published on medium.com
Recently a critical Remote Code Execution (RCE) vulnerability was discovered in React Server Components, affecting applications built with Next.js and other frameworks using React’s Server Functions. This vulnerability, tracked as CVE-2025–66478, allowed attackers to execute arbitrary code on the server by exploiting…
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's property resolution did not check whether a property was an object's own property, allowing traversal of the prototype chain to reach the Function constructor.
Impact
An attacker could execute arbitrary code on the server, leading to full compromise.
What the attacker needed
Ability to send crafted Flight Protocol data
The fix
The vulnerability was fixed by adding a hasOwnProperty check to ensure only own properties are accessed during deserialization.
How it was found
- Craft a chunk that references a property path through __proto__ to reach the Function constructor.
- Create a self-referencing chunk with a then property pointing to Chunk.prototype.then and status set to resolved_model.
- Trigger automatic then invocation by awaiting the chunk, causing initializeModelChunk to run with controlled data.
- Use a second deserialization round with a crafted _response context to resolve a $B blob reference.
- Supply a fake _formData and _prefix so that the blob lookup returns a string that becomes the body of a Function constructor call.
- Execute the constructed function to run arbitrary code on the server.
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 browser call server functions. The data format used to send these calls could be tricked into following JavaScript's built-in object links (the prototype chain) to reach a function that runs code. An attacker who can send such data could run their own commands on the server.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.