Vulnerability · Published Feb 4, 2025 · Assigned by GitHub_M
CVE-2025-24963Browser mode serves arbitrary files in vitest
Medium 5.9
In plain English
A medium-severity path traversal in vitest from vitest-dev. Proof-of-concept exploit code is public. The chance it is exploited in the next 30 days is estimated at 2.4% (higher than 84% of all known vulnerabilities). Ready-made attack tooling exists: Nuclei, public proof-of-concept code. Fixed versions are available - upgrade the affected package.
Official description
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.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| npm | @vitest/browser | 2.1.9 | GHSA-8gvc-j273-4wm5 |
| npm | @vitest/browser | 3.0.4 | GHSA-8gvc-j273-4wm5 |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| vitest-dev | vitest | >= 2.0.4, < 2.1.9>= 3.0.0, < 3.0.4 |
Weakness: CWE-22 · Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N
References
- https://github.com/vitest-dev/vitest/security/advisories/GHSA-8gvc-j273-4wm5 x_refsource_CONFIRM
- https://github.com/vitest-dev/vitest/commit/2d62051f13b4b0939b2f7e94e88006d830dc4d1f x_refsource_MISC
- https://github.com/vitest-dev/vitest/blob/f17918a79969d27a415f70431e08a9445b051e45/packages/browser/src/node/plugin.ts#L88-L130 x_refsource_MISC
- https://vitest.dev/guide/browser/config.html#browser-api x_refsource_MISC