检测 CVE-2025-55182 / CVE-2025-66478 – React Server Components / Next.js
本仓库包含一个用 Lua 编写的 Nmap 脚本引擎(NSE)脚本,旨在安全地检测名为 React2Shell 的关键漏洞,该漏洞影响 React Server Components(RSC)和 React Server Actions(RSA)实现——包括许多 Next.js 部署。
检测方法利用基于服务器端在处理格式错误的 React Flight 负载时的错误行为而采用的非侵入式侧信道技术。 不进行任何利用、代码执行或不安全的操作。
React2Shell(CVE-2025-55182 / CVE-2025-66478)是 React Server Components 管道中的一个关键设计缺陷,可能允许:
当 React 尝试解析特制的 React Flight 引用时,漏洞就会被触发,例如:
["$1:aa:aa"]
在易受攻击的服务器上,这会产生一个包含特征模式的 500 错误:
E{"digest":"..."}
该脚本检测该模式,而不会尝试任何有害操作。
✔ 安全且被动的检测(无利用、无 RCE 尝试)
✔ 检测高保真的 React Flight 崩溃特征
✔ 支持 HTTP 和 HTTPS
✔ 用户可配置路径和超时
✔ 自动避免来自 Vercel/Netlify 缓解措施导致的误报
✔ 输出兼容自动化流水线和 SIEM 导入
✔ 轻量级,适用于红队、漏洞赏金、应急响应和 CI/CD 扫描
git clone https://github.com/MoisesTapia/http-react2shell.git
cd http-react2shell
将文件放入你的 Nmap 脚本目录:
sudo cp http-react2shell.nse /usr/share/nmap/scripts/
更新脚本索引:
sudo nmap --script-updatedb
nmap -p80 --script http-react2shell <host>
nmap -p443 --script http-react2shell \
--script-args 'react2shell.path=/'
<host>
nmap -p443 --script http-react2shell \
--script-args 'react2shell.path=/api/action'
<host>
nmap -p443 --script http-react2shell \
--script-args 'react2shell.path=/,react2shell.timeout=20000'
<host>
nmap -iL targets.txt -p80,443 \
--script http-react2shell
nmap -sV -p80,443 \
--script "http-react2shell,http-headers,http-server-header,http-security-headers" \
<host>
PORT STATE SERVICE
443/tcp open https
| http-react2shell:
| Path: /login
| Scheme: auto (http/https decided by Nmap http library)
| No characteristic crash pattern observed.
| This suggests the tested endpoint is not vulnerable or is patched,
|_ but this is not a guarantee (other RSC/Server Actions paths may exist).
PORT STATE SERVICE
443/tcp open https
| http-react2shell:
| Path: /login
| Scheme: auto (http/https decided by Nmap http library)
| VULNERABLE: possible React2Shell (CVE-2025-55182 / CVE-2025-66478)
| Evidence: HTTP 500 + digest-like pattern found in response
|_ Notes: high-fidelity side-channel; verify manually and patch immediately.
PORT STATE SERVICE
443/tcp open https
| http-react2shell:
| Path: /login
| Scheme: auto (http/https decided by Nmap http library)
|_ ERROR: HTTP request failed (connection reset by peer)
有关 React Flight 内部机制的技术分析文章与研究论文
本项目仅用于教育、研究和防御性安全目的。 请勿扫描你不拥有或未经明确许可进行测试的系统。 维护者不对滥用行为或由此造成的任何损害负责。
欢迎提交 Pull Request、改进以及额外的检测启发式方法。 你可以贡献:
多路径扫描支持
WAF 绕过模式
额外的指纹识别
与 Nmap 内置漏洞框架的集成
如果这个工具对你的红队、漏洞赏金或防御性安全工作有帮助, 请考虑在 GitHub 上给该仓库点个星标 ⭐!