⚠️ 警告:此应用程序故意存在漏洞,仅供教育和安全研究目的使用。请勿部署到生产环境或暴露到互联网。
这是一个存在漏洞的 Next.js 应用程序,用于演示 CVE-2025-55182,这是 React Server Components 中的一个严重远程代码执行漏洞。该应用程序被设计为看起来像一个专业的云托管仪表盘,同时故意保留漏洞以用于安全测试和教育目的。
CVE 详情:
curl_id.shnpm install --legacy-peer-deps
npm run dev
应用程序将在 http://localhost:3000 可用
该仓库包含 curl_id.sh,这是一个基于 Nuclei 模板 的命令行工具,用于利用 CVE-2025-55182。
用法:
# Execute id command (default)
./curl_id.sh -d localhost:3000 -c id
# Execute custom commands
./curl_id.sh -d localhost:3000 -c "whoami"
./curl_id.sh -d localhost:3000 -c "uname -a"
./curl_id.sh -d localhost:3000 -c "ls -la /tmp"
# Test remote domains (if vulnerable)
./curl_id.sh -d vulnapp.com -c id
选项:
-d, --domain:目标域名/URL(默认:http://localhost:3000)-c, --command:要执行的命令(默认:id)git clone https://github.com/assetnote/react2shell-scanner.git
cd react2shell-scanner
pip install -r requirements.txt
python3 scanner.py -u http://localhost:3000
python3 scanner.py -u http://localhost:3000 --safe-check
该漏洞可以通过向服务器发送精心构造的 multipart POST 请求来利用,请求需要包含:
Next-Action: x 标头X-Nextjs-Request-Id 标头X-Nextjs-Html-Request-Id 标头有关确切的负载结构,请参阅 react2shell-scanner 仓库。
该漏洞存在于 React Server Components 的反序列化机制中。当 Next.js 处理服务器操作时,它会对请求负载进行反序列化。存在漏洞的 React 版本(19.0.0-19.2.0)未能正确验证或净化反序列化的数据,使得攻击者能够:
process.mainModule.require('child_process').execSync() 在服务器上执行任意代码X-Action-Redirect 响应标头中获取命令输出该利用在 JSON 反序列化过程中使用了原型污染攻击。负载结构包括:
then 属性_prefix 字段的 _response 对象,该字段包含 JavaScript 代码execSync() 执行,并将输出重定向到响应标头要修复此漏洞:
npm install react@latest react-dom@latest
npm install next@latest
npm audit fix
vuln-app-CVE-2025-55182/
├── app/
│ ├── actions.ts # Vulnerable server action
│ ├── layout.tsx # Root layout
│ └── page.tsx # Main dashboard page
├── node_modules/ # Dependencies
├── curl_id.sh # Exploit script for testing
├── package.json # Project dependencies (vulnerable versions)
├── tsconfig.json # TypeScript configuration
├── next.config.js # Next.js configuration
├── .gitignore # Git ignore rules
└── README.md # This file
此应用程序的创建仅用于安全研究和教育目的。
作者和贡献者对此代码的任何滥用不承担责任。未经授权访问计算机系统是违法的,可能导致刑事起诉。
这是一个教育性仓库。欢迎改进文档、添加更好的示例或提升教育价值的贡献。
本项目仅供教育目的提供。使用风险自负。
请记住: 这是一个存在漏洞的应用程序。请负责任地使用,仅在受控环境中用于安全研究和教育。