# Vite 中间件可能泄露公共目录文件
## 概述
Vite 是一个用于 JavaScript 的前端开发框架。在特定版本之前存在一个安全问题,导致访问 `public` 目录中的文件时绕过 `server.fs` 的配置限制。
## 影响版本
受影响版本包括:
- Vite < 7.1.5
- Vite < 7.0.7
- Vite < 6.3.6
- Vite < 5.4.20
修复版本:
- Vite >= 7.1.5
- Vite >= 7.0.7
- Vite >= 6.3.6
- Vite >= 5.4.20
## 细节
当以下条件同时满足时,漏洞会被触发:
1. 应用使用了 `public` 目录功能(默认启用);
2. 在 `public` 目录中存在符号链接(symlink);
3. Vite 开发服务器被显式地暴露到网络上(通过使用 `--host` 命令行参数 或设置 `server.host` 配置项)。
在此情况下,攻击者可能通过构造特定请求绕过 `server.fs` 的安全限制,访问不应该被公开的文件。
## 影响
该漏洞可能导致敏感文件被非法访问,从而暴露不应对外公开的内部资源或配置信息。
| # | POC 描述 | 源链接 | 神龙链接 |
|---|---|---|---|
| 1 | Vite is a frontend tooling framework for JavaScript. Prior to versions 7.1.5, 7.0.7, 6.3.6, and 5.4.20, files starting with the same name with the public directory were served bypassing the `server.fs` settings. Only apps that explicitly expose the Vite dev server to the network (using --host or `server.host` config option), use the public directory feature (enabled by default), and have a symlink in the public directory are affected. Versions 7.1.5, 7.0.7, 6.3.6, and 5.4.20 fix the issue. | https://github.com/projectdiscovery/nuclei-templates/blob/main/http/cves/2025/CVE-2025-58751.yaml | POC详情 |
标题: Files starting with the same name with the public directory were served · Advisory · vitejs/vite · GitHub -- 🔗来源链接
标签: x_refsource_CONFIRM
神龙速读标题: fix: do not serve file with dirname prefix · lukeed/sirv@f0113f3 · GitHub -- 🔗来源链接
标签: x_refsource_MISC
神龙速读标题: fix: upgrade sirv to 3.0.2 (#20735) · vitejs/vite@09f2b52 · GitHub -- 🔗来源链接
标签: x_refsource_MISC
神龙速读标题: fix: port sirv@3.0.2 changes to sirv@2.0.4 (#20737) · vitejs/vite@4f1c35b · GitHub -- 🔗来源链接
标签: x_refsource_MISC
神龙速读标题: fix: upgrade sirv to 3.0.2 (#20735) · vitejs/vite@63e2a5d · GitHub -- 🔗来源链接
标签: x_refsource_MISC
神龙速读标题: fix: upgrade sirv to 3.0.2 (#20735) · vitejs/vite@e11d240 · GitHub -- 🔗来源链接
标签: x_refsource_MISC
神龙速读暂无评论