CVE-2025-24963 Browser mode serves arbitrary files in vitest
Attackers can read arbitrary files from the server if the Vitest browser mode is explicitly exposed to the network.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2025-24963?
CVE-2025-24963 is a medium-severity path traversal vulnerability in vitest-dev vitest, published on 4 Feb 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.
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.
Weakness: CWE-22
Which versions are affected by CVE-2025-24963?
4 open source packages ship an affected version, including @vitest/browser. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
@vitest/browser npm | From 2.0.4 | 2.1.9 |
@vitest/browser npm | From 2.0.4 | 2.1.9 |
@vitest/browser npm | From 3.0.0 | 3.0.4 |
@vitest/browser npm | From 3.0.0 | 3.0.4 |
Products include Vitest.dev Vitest.
How do I fix CVE-2025-24963?
Upgrade @vitest/browser to a fixed version for your release line: 2.1.9 or 3.0.4.
Upgrade, and resolve every user-supplied path against an allowed base folder before opening it. More about Path traversal.
Is CVE-2025-24963 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-24963 exists.
Public exploit code: 1 Nuclei template and 1 proofs of concept on GitHub.
Other vulnerabilities in vitest-dev vitest
Sources
Also known as GHSA-8gvc-j273-4wm5.