Remote Code Execution in React Server Components: Anatomy of the Flaw and Next.js PatchesLongread · digest for October 22
Conceptual product photography of a prism on a graphite desk splitting a Server Actions beam and highlighting the Prototype Pollution vulnerability in RSC.
Longread5 sections≈ 5 min

Remote Code Execution in React Server Components: Anatomy of the Flaw and Next.js Patches

React Server Components (RSC) and Server Actions completely reshaped fullstack React development. We've gotten used to writing async server functions right alongside our UI components: slap a 'use server' directive at the top, wire it to a form handler, and the framework quietly handles the network requests, data serialization, and component tree updates for you.

It gave us a huge boost in developer ergonomics and velocity. Under the hood, though, it also introduced a complex network serialization dialect—the RSC Payload Protocol—acting as an invisible bridge between the browser and the server.

In October 2026, a catastrophic crack opened up in that bridge: a critical unauthenticated remote code execution vulnerability (Unauthenticated RCE) tracked as GHSA-xqc2-xf4c-x3h3. It affects all Next.js App Router and Waku projects that use Server Actions.

Let's calmly walk through how this flaw actually worked, why it was exploitable, and how to lock down your production servers.

How Do Server Actions Work Under the Hood?

To understand the bug, it helps to refresh how Server Actions operate behind the scenes.

When the compiler sees 'use server', it strips the function body out of the client bundle and assigns it a unique cryptographic identifier (an Action ID, like $ACTION_ID_481516). All the browser gets is a lightweight stub.

When that action is invoked, the client fires a standard POST request to the server with a special header: Next-Action: $ACTION_ID_481516, carrying serialized arguments in the request body.

Of course, JavaScript function arguments aren't just flat JSON strings and numbers. Server Components support passing dates, binary arrays, error structures, and even unresolved Promises. To pull that off, the React team built a custom string dialect on top of JSON using special prefixes:

  • $@: a reference to another object in the graph (circular references);
  • $Q: a Promise;
  • $F: a reference to a server function.

And right inside the parser for those special prefixes sat a fatal trap.

The Attack Vector: Prototype Pollution and Dispatch Poisoning

The RSC deserialization parser took the incoming string and recursively reconstructed object structures in the Node.js runtime's memory.

Architectural cross-section of RSC deserialization: a malicious Prototype Pollution payload injects into proto and hijacks the child_process system call.

An attacker could send a crafted POST request to any public URL on the site with a maliciously structured JSON tree:

  1. Prototype Pollution: The payload included properties named __proto__ and constructor.prototype. The internal parser didn't validate key safety before merging objects.
  2. Overwriting the Dispatch Table: Once the base Object prototype inside the Node.js process was polluted, the attacker could override internal fields in the action ID mapping table (serverActionsManifest).
  3. System Code Execution: By swapping a handler function reference for a call to Node's built-in child_process.execSync, an attacker could execute arbitrary shell commands as whatever user was running the Next.js container.

The scariest part? No authentication required. Server Actions are network-reachable endpoints by default. Even if the form button in your UI is hidden behind a login wall, the underlying action endpoint is still wide open to direct HTTP requests unless you explicitly enforce an auth check inside the action itself.

We previously touched on how build architecture shapes app behavior and safety in our look at rolling out React Compiler in Next.js production.

Who Is Affected?

The vulnerability impacts the following setups:

  • Next.js versions 14.0.0 through 14.2.14;
  • Next.js versions 15.0.0-canary through 15.0.1;
  • Any custom RSC implementation using a vulnerable version of react-server-dom-webpack.

If your app still runs the classic Pages Router (pages/) and doesn't enable experimental Server Actions, you're in the clear. If you're on the App Router (app/), treat this as an emergency upgrade.

What Did the Security Patches Fix?

The React and Vercel teams shipped fixes quickly:

  1. Strict Object Isolation: The deserializer now constructs objects with Object.create(null)—no prototype, which makes Prototype Pollution physically impossible.
  2. Blocking Internal Prefixes from External Clients: Client requests can no longer pass reserved markers like $F and $@ directly inside action input arguments.
  3. Tighter Origin and CSRF Checks: The server verifies the incoming request's Origin header against the app's list of trusted domains.

Emergency Audit Checklist for Teams

  1. Upgrade your dependencies immediately: On Next.js 14, update to 14.2.15 or newer. On Next.js 15, update to 15.0.2 or newer. If you use react-server-dom-webpack directly without a framework, pull the patched version listed in React's security advisory.
  2. Verify authorization inside every Server Action: Remember the golden rule: 'use server' turns a function into a public HTTP API endpoint. Never assume that "only logged-in admins can see this button on the frontend." Any request can be replayed with curl or Postman. Always check the user's session and permissions on the very first line of your action.
  3. Lock down container privileges in Kubernetes and Docker: Run your web server container as a non-privileged user (USER node), mount the root filesystem with readOnlyRootFilesystem: true, and block outbound traffic from frontend pods to internal datacenter networks using NetworkPolicy. Even if an exploit lands, the attacker is trapped in a locked-down container with nowhere to write or pivot.
  4. Audit network logs for suspicious payloads: Configure your WAF or Ingress controller to flag incoming POST requests containing __proto__ keys or anomalous serialization markers.

Securing complex distributed frameworks is an ongoing race, and fast patching paired with defense in depth remains every responsible engineer's baseline duty.

Want a deep diveVotes help us choose what to break down in detail. This material has 0 votes.
Sources · 3