# 浏览器模式在vitest中提供任意文件
## 漏洞概述
Vitest 的浏览器模式 HTTP 服务器中的 `__screenshot-error` 处理程序可以响应文件系统的任意文件。如果该服务器通过 `browser.api.host: true` 暴露在网络中,攻击者可以通过发送请求来访问任意文件内容。
## 影响版本
- 低于 2.1.9 的 2.x 版本
- 低于 3.0.4 的 3.x 版本
## 漏洞细节
`__screenshot-error` 处理程序在浏览器模式 HTTP 服务器中回应文件系统上的任意文件。该代码由提交 `2d62051` 引入。如果用户通过设置 `browser.api.host: true` 显式地将浏览器模式服务器暴露在网络中,则可能导致任意文件被访问。
## 影响
受影响的用户应升级到 2.1.9 或 3.0.4 及以上版本。目前没有已知的解决方法。
# | POC 描述 | 源链接 | 神龙链接 |
---|---|---|---|
1 | Vitest is a testing framework powered by Vite. The `__screenshot-error` handler on the browser mode HTTP server that responds any file on the file system. Especially if the server is exposed on the network by `browser.api.host- true`, an attacker can send a request to that handler from remote to get the content of arbitrary files.This `__screenshot-error` handler on the browser mode HTTP server responds any file on the file system. This code was added by commit `2d62051`. Users explicitly exposing the browser mode server to the network by `browser.api.host- true` may get any files exposed. This issue has been addressed in versions 2.1.9 and 3.0.4. Users are advised to upgrade. There are no known workarounds for this vulnerability. | https://github.com/projectdiscovery/nuclei-templates/blob/main/http/cves/2025/CVE-2025-24963.yaml | POC详情 |
2 | None | https://github.com/0xdeviner/CVE-2025-24963 | POC详情 |
标题: Browser Config Reference | Vitest -- 🔗来源链接
标签: x_refsource_MISC
标题: Browser mode serves arbitrary files · Advisory · vitest-dev/vitest · GitHub -- 🔗来源链接
标签: x_refsource_CONFIRM
标题: feat(browser): allow preview and open in the editor screenshot error … · vitest-dev/vitest@2d62051 · GitHub -- 🔗来源链接
标签: x_refsource_MISC
标题: vitest/packages/browser/src/node/plugin.ts at f17918a79969d27a415f70431e08a9445b051e45 · vitest-dev/vitest · GitHub -- 🔗来源链接
标签: x_refsource_MISC
暂无评论