← Blog
November 22, 20269 min readVulnerability ResearchAppSecRCE

Inside React2Shell, the CVSS 10.0 flaw in React Server Components

React2Shell (CVE-2025-55182) let an unauthenticated attacker run code on any server rendering React Server Components, and China-nexus groups were exploiting it within hours of the 3 December 2025 disclosure. A teardown of the one missing check behind the 10.0: a Flight reference path walked straight through the prototype chain to the Function constructor.

By The Xalgorix Team

On 3 December 2025 the React team published a fix for a bug they rated CVSS 10.0: an unauthenticated attacker could run arbitrary code on any server that renders React Server Components. The industry named it React2Shell, tracked as CVE-2025-55182 for the React packages and CVE-2025-66478 for Next.js. By the next morning Amazon's threat teams were watching China-nexus groups exploit it against live targets, and within days it was on CISA's Known Exploited Vulnerabilities list with a federal patch deadline.

The interesting part is not that a 10.0 happened. It is where it happened: not in application code, not in a Server Function anyone wrote, but inside the framework's own code for reading data off the wire. This teardown follows the request from the browser to the shell, explains the one missing check that caused it, and pulls out the lesson for anyone who writes code that rebuilds objects from untrusted input — which, these days, is almost everyone.

How React Server Components read data from the browser

React Server Components (RSC) let a component run on the server and stream its output to the browser. The feature that matters here is the companion one: Server Functions (also called server actions), where the browser can call a function that runs on the server. To make that work, React ships a wire format called the Flight protocol, and a decoder that turns an incoming HTTP request body back into the JavaScript arguments the server function expects.

That decoder is the attack surface. When a request arrives with a Next-Action or rsc-action-id header, the framework hands the request body to decodeReply, which parses a JSON-ish structure and rebuilds the argument objects. Flight is richer than JSON: it supports references between parts of the payload, promises, streams and binary blobs. A value that starts with $ is a reference — a pointer to another chunk of the same payload, optionally followed by a colon-separated path of property names to dig into. The decoder resolves those references for you. That convenience is the bug.

POST with action header
attacker-controlled body
decodeReply()
parse Flight payload
resolve $ references
walk property paths
server function args
rebuilt objects
Every box runs before any application code does. The decoder rebuilds attacker-controlled objects before the server function is ever called.

The root cause: a reference path walked straight through the prototype chain

When the decoder meets a reference such as $1:a:b, it splits on the colon, looks up chunk 1, and then walks the remaining segments as property accesses. In the vulnerable releases, that walk was a bare loop. Here is the relevant function from react-server-dom-webpack 19.2.0 (the code is the same across the webpack, parcel and turbopack builds):

// react-server-dom-webpack 19.2.0 (vulnerable)
function getOutlinedModel(response, reference, parentObject, key, map) {
  reference = reference.split(":");       // "1:__proto__:then" -> ["1","__proto__","then"]
  var id = parseInt(reference[0], 16);
  id = getChunk(response, id);
  // ...resolve the chunk...
  case "fulfilled":
    parentObject = id.value;
    for (key = 1; key < reference.length; key++)
      parentObject = parentObject[reference[key]];   // <-- no own-property check
    return map(response, parentObject);
}

The loop does value = value[segment] with no guard. Because JavaScript property access climbs the prototype chain, an attacker who controls the reference string can make the walk step into __proto__, constructor or then — properties that are not on the object itself but are reachable through its prototype. Reaching constructor on a function gets you Function, the constructor that turns a string into runnable code.

One gadget alone is not enough; the exploit chains several of Flight's own features. A crafted chunk can set then so the decoder treats the object as a promise and “resolves” it, route a value through the blob-reference path ($B), which does a lookup against the request's form data, and arrange for the result of that lookup to be the Function constructor applied to an attacker string. The net effect, reached entirely inside the decoder before any application code runs, is server-side code execution from a single unauthenticated POST. The published analyses from OX Security and Smashing Magazine walk the full chunk-by-chunk chain; the single defect under all of it is the unguarded path walk above.

The vulnerability is a deserialization flaw, not a React-specific quirk. The decoder trusted the shape of attacker input to tell it which properties to read, and property access in JavaScript silently follows the prototype chain. Any parser that walks an input-controlled path of property names has the same latent bug.

Why apps with no Server Functions were still exposed

The natural assumption — “we don't use server actions, so we're fine” — was wrong, and this is the detail that widened the blast radius. React's advisory is explicit: even an app that implements no Server Function endpoints can be vulnerable if it supports React Server Components at all, because the reply-decoding endpoint exists wherever the RSC runtime is wired up. The rule React gives is simpler than the feature matrix: if your React code runs on a server and you use a framework, bundler or plugin that supports RSC — Next.js (App Router), React Router, Waku, Parcel's RSC plugin, the Vite RSC plugin, RedwoodSDK — you were in scope. A purely client-rendered SPA with no server was not.

The patch: own-property checks and a __proto__ guard

The fix shipped in React 19.0.1, 19.1.2 and 19.2.1. Diffing 19.2.0 against 19.2.1, the path walk gains exactly the check it was missing:

// react-server-dom-webpack 19.2.1 (fixed)
var name = path[i];
"object" === typeof value &&
  hasOwnProperty.call(value, name) &&     // only follow OWN properties
  (value = value[name]);

Now a segment is only followed when it names a property that actually lives on the object, so __proto__ and constructor no longer resolve through the prototype chain. The same release adds a matching guard elsewhere (the module-export lookup gained a hasOwnProperty check before returning a named export, and the cleanup pass special-cases __proto__ so a literal __proto__ key is assigned rather than used to poison the prototype). The shape of the fix tells you the shape of the bug: wherever the old code let attacker strings choose which property to read or write, the new code demands the property be the object's own.

Exploited within hours of disclosure

The timeline is a case study in how little runway a patch window gives you now. Lachlan Davidson reported the flaw through Meta's bug bounty on 29 November 2025; React confirmed it, built a fix with hosting providers, and disclosed on 3 December. According to Amazon's security team, exploitation attempts began within hours of that public disclosure. AWS attributed activity to China-nexus clusters it tracks as Earth Lamia and Jackpot Panda, plus untracked groups, and described one actor sending over a hundred requests in under an hour — running whoami and id, reading /etc/passwd, writing a marker file to /tmp — which AWS read as attackers debugging their exploit against live servers. In early December CISA added CVE-2025-55182 to its Known Exploited Vulnerabilities catalog under BOD 22-01, with a federal remediation deadline of 26 December 2025.

What to patch, and how to tell if you were hit

Patching is the only real fix; mitigations buy time, not safety.

  • Upgrade React. Move the react-server-dom-webpack, react-server-dom-parcel and react-server-dom-turbopack packages to 19.0.1, 19.1.2 or 19.2.1 (match your 19.x line). These transitive packages are what carry the fix; check your lockfile, not just your top-level react version.
  • Upgrade Next.js to a patched release for your branch and read the current Next.js security update, which supersedes the first-day version list and also covers the follow-up denial-of-service and source-exposure issues (CVE-2025-55183, CVE-2025-55184, CVE-2025-67779).
  • Do not rely on a WAF. Vercel, AWS and the React team each shipped temporary edge mitigations and each said, in plain terms, not to depend on them. Pattern-based rules for a deserialization gadget are a speed bump, not a boundary.
  • Hunt for the attack. AWS's published indicators are a reasonable starting query: HTTP POSTs carrying a next-action or rsc-action-id header with request bodies containing $@ or "status":"resolved_model", and on the host, a Node.js or React process spawning a shell, reading /etc/passwd, or writing to /tmp.

The lesson beyond React

React2Shell is the latest entry in a long line of remote code execution bugs that start the same way: a deserializer that lets the input decide which properties to touch. Java had its gadget chains, Ruby and PHP their object-injection bugs, Python its pickle; JavaScript's version is prototype pollution, and here it was promoted all the way to RCE because the same decoder that read attacker paths could also reach the Function constructor. If you build anything that reconstructs objects from untrusted bytes, the defensive pattern is the one the React patch used: never follow a property name you did not put there yourself. Gate every attacker-influenced lookup with an own-property check, block __proto__ and constructor explicitly, and treat reaching a callable constructor from deserialized data as a design error, not an edge case.

It is also a reminder of where automated testing helps and where it does not. A dependency scanner would have flagged a vulnerable react-server-dom-* version the moment the advisory landed — that is exactly the job of software composition analysis, and it is why keeping an accurate inventory of transitive packages matters. What a scanner cannot tell you is whether the reachable code path is actually exploitable in your deployment, or whether an edge rule you added truly blocks the gadget. That takes exercising the behaviour. At Xalgorix we lean on exactly that separation: let inventory tooling find the vulnerable versions fast, and reserve exploitation testing for confirming impact and checking that a mitigation holds. For a flaw that was being weaponised within hours of disclosure, both halves earn their place.

Ready to see it prove a bug?

Start scanning on Cloud →