React2Shell (CVE-2025-55182): How It Works, Detection, Fixes
React2Shell is an unauthenticated RCE in React Server Components and Next.js. The Flight decoder flaw explained step by step, how to detect it and what to do.
Zyberum Security Team · Published · 14 min read
React2Shell is a remote code execution vulnerability in the part of React that turns an incoming HTTP request back into a server-side function call. One unauthenticated request to a default Next.js App Router application was enough to run code on the server. It was disclosed on 3 December 2025 with a CVSS 3.1 score of 10.0, public exploits followed within a day, and mass exploitation within two.
This guide explains the flaw at code level, shows how to find out whether you are exposed, and lists what to do, in that order. It is the first part of our series on the 2Shell vulnerabilities.
The facts in one table
| Identifier | CVE-2025-55182 (React), tracked downstream as CVE-2025-66478 (Next.js) |
| Class | CWE-502, deserialization of untrusted data |
| Score | CVSS 3.1: 10.0, vector AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H |
| Affected packages | react-server-dom-webpack, react-server-dom-parcel, react-server-dom-turbopack 19.0.0, 19.1.0, 19.1.1, 19.2.0 |
| Fixed (RCE) | 19.0.1, 19.1.2, 19.2.1 |
| Fully patched incl. follow-ups | 19.0.4, 19.1.5, 19.2.4 |
| Affected frameworks | Next.js 15.x and 16.x with App Router, 14.3 canaries from canary.77; also react-router, waku, @parcel/rsc, @vitejs/plugin-rsc, rwsdk in RSC mode |
| Not affected | Next.js 13.x, stable 14.x, Pages Router, Edge Runtime, React apps without a server |
| Authentication | None needed, default configuration |
| Exploited in the wild | Yes, from 5 December 2025; listed in the CISA KEV catalogue |
Next.js fixed the RCE in 15.0.5, 15.1.9, 15.2.6, 15.3.6, 15.4.8, 15.5.7 and 16.0.7. Later releases in each line also carry the follow-up fixes, so the target today is the latest patch release of your line, not the first fixed one.
How does React2Shell work?
The server trusted the structure of the request it was decoding. React Server Functions let browser code call a function on the server. The browser serialises the call in a format called Flight, and the server decodes it in ReactFlightReplyServer.js. That decoder followed references inside the request without checking where they led.
- Step 1/6The attacker sends a single
POSTto any route of the app. ANext-Actionheader marks it as a Server Function call. The body is ordinarymultipart/form-data. - Step 2/6The App Router hands the body to React. Field
0holds the argument list, the other numbered fields hold chunks that field0may refer to. - Step 3/6The decoder revives the model. Strings that start with
$are references:$1:a:bmeans "take chunk 1, then follow propertya, thenb". - Step 4/6The walk was a plain
value = value[name]loop. Nothing stopped it from leaving the data and stepping onto inherited properties such as__proto__andconstructor. - Step 5/6From the constructor chain the request reaches a function that evaluates code. The decoder calls it while it is still building the arguments. The code runs as the web server user.
- Step 6/6What was observed next in real attacks: the Node.js process starts
curlorwgetand fetches a second stage.
The Flight reply format
A reply is a set of numbered rows. Each row is JSON, with one extension: strings that begin with $ are instructions to the decoder.
| Token | Meaning |
|---|---|
$<id> | Reference to another row |
$<id>:<a>:<b> | Reference to a row, then a property path inside it |
$@<id> | Reference to a row as a promise (thenable) |
$F<id> | Bound server reference: a function plus pre-filled arguments |
The functions involved are parseModelString, reviveModel, getOutlinedModel, fulfillReference, getChunk and loadServerReference. The sink is the path walk in getOutlinedModel and fulfillReference.
The missing check
The walk split the reference on : and descended one property per element. In JavaScript, obj[name] also returns inherited properties. Every plain object inherits constructor, and from a constructor the Function constructor is one more step away. A request could therefore name a path that starts in harmless data and ends at a function that compiles and runs a string.
- Step 1/5A reference names a chunk the attacker also supplies. Nothing wrong so far: that is how arguments are passed.
- Step 2/5The path continues with a property that the chunk does not own. JavaScript answers from the prototype chain anyway.
- Step 3/5One more step reaches the constructor of constructors:
Function. It turns a string into executable code. - Step 4/5The decoder invokes what it found. This is the remote code execution.
- Step 5/5The fix checks
hasOwnPropertyat every step. An inherited property now ends the walk, and the request fails with an ordinary error.
We describe the structure here, not a working request. Working exploits are public, many of the “proof of concept” repositories are fake, and some carry malware aimed at the people who run them. Google’s threat intelligence team warns about this explicitly.
What the patch changed
The fix (React pull request 35277) brought the request decoder in line with the hardening that the response decoder already had:
- Own properties only.
fulfillReferenceandgetOutlinedModeldescend only iftypeof value === 'object' && hasOwnProperty.call(value, name). __proto__handled explicitly inreviveModel, which closes the prototype pollution path through assignment.- Type checks on what a reference may be. Form entries, stream entries and server reference ids must be strings;
then()only accepts functions as callbacks. - Module lookup hardened.
requireModulereturns an export only if the module owns it. - Multipart errors destroy the stream instead of throwing, which prepared the ground for the later denial of service fixes.
How to identify React2Shell
Check three things: the versions in your builds, the behaviour of the running application, and the traces of an earlier attack. A version check alone misses bundled copies and stale deployments.
1. Versions in every build
# Direct and transitive copies of the vulnerable packages
npm ls react-server-dom-webpack react-server-dom-parcel react-server-dom-turbopack
pnpm why react-server-dom-webpack
yarn why react-server-dom-webpack
# Framework version
npm ls next react react-dom
# Next.js: check and bump deterministically
npx fix-react2shell-next
Vulnerable are 19.0.0, 19.1.0, 19.1.1 and 19.2.0 of the react-server-dom-* packages. Next.js bundles its own copy of React for the App Router, so the next version decides, not the react version in your package.json.
Then confirm what actually runs. A patched lockfile with an old container image still running in production is the classic gap:
# Inside the running container or on the host
node -p "require('next/package.json').version"
grep -R '"version"' node_modules/react-server-dom-*/package.json
# Kubernetes: which image digests are live
kubectl get pods -A -o jsonpath='{range .items[*]}{.metadata.namespace}{"\t"}{.metadata.name}{"\t"}{range .spec.containers[*]}{.image}{" "}{end}{"\n"}{end}'
2. Behaviour of the running application
A vulnerable server can be recognised without executing anything on it. The method published by Searchlight Cyber sends a reference to a property that does not exist on an empty object. A vulnerable decoder walks into undefined and throws; a patched one does not.
| Signal | Vulnerable build |
|---|---|
| Status | 500 Internal Server Error |
| Headers | Content-Type: text/x-component, Vary: rsc |
| Body | A row of the form <id>:E{"digest":"…"} |
Two cautions from the authors: a digest error without this specific probe proves nothing, and the probe also fires on some builds outside the affected range. Pair it with the version. Use a scanner only on systems you are authorised to test.
Vulnerability scanners and software composition tools carry the finding too, for example as XRAY-900398 and XRAY-900476 in JFrog Xray, and under the GHSA id in npm audit, Trivy and Grype.
3. Traces of an attack
In web and proxy logs, look for POST requests with a Next-Action or rsc-action-id header from unknown sources, especially to /, combined with 500 responses of type text/x-component. GreyNoise observed automated clients: Go-http-client/1.1, a Chrome 60 string ending in Assetnote/1.0.0, aiohttp and python-requests. Early probes ran short arithmetic to prove execution.
On the host, the reliable signal is a Node.js web process that starts a shell or a download tool:
# Children of node processes that should not exist
ps -eo pid,ppid,user,etimes,cmd --forest | grep -A3 -E 'node|next-server'
# Persistence and artefacts reported by Google's threat intelligence team
ls -la ~/.systemd-utils /etc/sshd 2>/dev/null
systemctl list-units --type=service | grep -i -E 'system-update-service'
crontab -l; ls -la /etc/cron.d /var/spool/cron 2>/dev/null
grep -n -E 'curl|wget|base64' ~/.bashrc ~/.profile 2>/dev/null
ls -la /tmp/vim 2>/dev/null
| What was observed | Indicator |
|---|---|
| Tunneler MINOCAT | Directory $HOME/.systemd-utils, terminated ntpclient, new cron job and systemd service |
| Downloader SNOWLIGHT (VSHELL) | HTTP GET for staged payloads disguised as legitimate files |
| Backdoor COMPOOD | Binary named vim in /tmp |
| Backdoor ANGRYREBEL.LINUX | A file named sshd under /etc/, cleared shell history, changed timestamps |
| Miner XMRig | Service system-update-service, script sex.sh |
| Windows targets | Encoded PowerShell, second stage over port 652/tcp, Event ID 4104 with AMSI bypass strings |
The clusters behind these tools include China-nexus espionage groups and financially motivated actors. The full indicator list with hashes and YARA rules is in the Google report linked in the sources.
What to do
Update first, then assume the worst for the time the application was exposed. In this order:
- Update the framework and React. Move to the latest patch release of your Next.js line and to React 19.0.4, 19.1.5 or 19.2.4. For other RSC frameworks, update the framework and the
react-server-dom-*package together. - Rebuild and redeploy every image. Then verify the running version as shown above. Do not forget preview deployments, staging systems and internal tools: they are reachable more often than their owners think.
- Rotate secrets if the application was online and unpatched after 4 December 2025: database credentials, API keys, signing keys, session secrets, cloud credentials of the instance or pod. Rotate after the redeploy, most critical first. Code execution means everything the process could read is known to the attacker.
- Hunt for compromise on every host that ran the vulnerable build, using the indicators above. A patched application on a backdoored host is still compromised.
- Keep the WAF rule, but do not count on it. Akamai rule 3000976 and the Google Cloud Armor rules
google-mrs-v202512-id000001-rceandid000002-rceblock the known shapes. The vendors themselves call this temporary.
Hardening that limits the next one
React2Shell will not be the last flaw in a request decoder. These measures decide how far an attacker gets after the first request:
- Egress filtering. A web server that cannot open arbitrary outbound connections cannot fetch a second stage. Allow only the destinations the application needs.
- Least privilege for the process. Non-root user, read-only root filesystem, no shell and no
curlin the image, dropped capabilities, a seccomp profile. - No long-lived cloud credentials in reach. Use short-lived workload identities and block the instance metadata service for pods that do not need it.
- Alert on child processes of the web server. A
nodeprocess that spawnsshis an incident until proven otherwise. - An inventory you can query. The teams that were done on day one were the ones that could list every
nextversion in production with one command.
Follow-up vulnerabilities in the same decoder
The decoder received more attention after the disclosure, and four more issues were fixed:
| CVE | Type | Score | Fixed in |
|---|---|---|---|
| CVE-2025-55183 | Source code of Server Functions exposed | 5.3 | 19.0.2, 19.1.3, 19.2.2 |
| CVE-2025-55184 | Denial of service, endless loop while decoding | 7.5 | First fix incomplete |
| CVE-2025-67779 | Denial of service, completes the fix above | 7.5 | 19.0.3, 19.1.4, 19.2.3 |
| CVE-2026-23864 | Denial of service: crash, memory exhaustion | 7.5 | 19.0.4, 19.1.5, 19.2.4 |
This is the usual pattern after a prominent finding, and the reason why “we patched in December” is not a final answer.
What it means for a penetration test
A test that only confirms the version is a scan. In a web application penetration test we use findings like this one to check what an attacker gets after the first step: which secrets the process can read, where it can connect to, whether the container boundary holds, whether anyone notices. Those answers are what decide the damage, and they stay relevant when the next decoder flaw is published.
FAQ
Frequently asked questions
Is my Next.js app affected by React2Shell?
It is affected if it runs Next.js 15.x or 16.x (or a 14.3 canary from canary.77 on) with the App Router and has not been updated to a fixed release. Next.js 13, stable 14, Pages Router apps and the Edge Runtime are not affected, according to the Next.js advisory. An app does not need to define its own Server Functions to be exposed: supporting React Server Components is enough.
Does a WAF protect against React2Shell?
Only as a stopgap. Akamai, Google Cloud Armor and other providers shipped rules within a day, and all of them say the rules are temporary. Bypasses were demonstrated. The fix is the update of the react-server-dom packages and the framework.
We patched in December 2025. Is that enough?
Not necessarily. Four follow-up CVEs in the same decoder were fixed afterwards, the last one in January 2026. The fully patched React lines are 19.0.4, 19.1.5 and 19.2.4. If the app was reachable and unpatched after 4 December 2025, treat it as possibly compromised: rotate secrets and hunt for the known artefacts.
Can you check our applications for it?
Yes, with written authorisation. We check versions and the running build, use the non-executing probe to confirm exposure and look for signs of earlier compromise. We do not run code on your servers to prove the point.