Patchfirst
CVE-2025-24963 Public exploit Medium · 5.9 EPSS 2.4%

Browser mode serves arbitrary files in vitest

Fix:upgrade browser to 3.0.4 or later Details ↓

vitest-dev · vitest

Summary

The flaw is a path traversal issue in the __screenshot-error handler of the browser mode HTTP server in Vitest, the Vite-based testing framework from vitest-dev. The handler responds with the contents of any file on the file system, and the exposure is greatest when the server is made reachable over the network via browser.api.host: true, where an attacker with network access and no authentication or user interaction can request arbitrary files and read their contents, with high confidentiality impact and no integrity or availability impact.

Official description · CVE.org

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.

Breakdown
66.0 / 100
Exploited
Yes, in VulnCheck KEV
Reports
0
Tactics
0/15

Disclosed on 4 Feb 2025. No public exploit code or confirmed exploitation is recorded.

See the family tree

9 related vulnerabilities in the same code over 17 months. The latest fix listed for @vitest/browser is 5.0.0-beta.6.

Same bug familyLinked by evidence that a fix failed or the same code was patched again. Oldest first.

  1. This CVECVE-2025-24963Browser mode serves arbitrary files in vitest4 Feb 2025
  2. relatedMedium

    Why these are linked:

    CVE-2026-47429Vitest: Arbitrary file can be read and executed when Vitest UI…14 Jul 2026

7 more CVEs are in this family. See the family tree

Fixes in @vitest/browsernpm package, by fixed version. Earlier and later fixes in the same package, not necessarily the same bug.

  1. 3.0.4CVE-2025-249634 Feb 2025
  2. 5.0.0-beta.3CVE-2026-4742814 Jul 2026
  3. 5.0.0-beta.4CVE-2026-5363314 Jul 2026
  4. 5.0.0-beta.6CVE-2026-7365313 Aug 2026Latest listed

Affected versions and fixes

as published in the CVE record

vitest-dev vitest

Affected: >= 2.0.4, < 2.1.9 · >= 3.0.0, < 3.0.4

Am I affected? What do I upgrade to?

From GitHub Security Advisories and OSV

1 package in 1 ecosystem. Main package: @vitest/browser.

npm@vitest/browserGHSA-8gvc-j273-4wm5

Upgrade to 3.0.4 or later

npmnpm install @vitest/browser@3.0.4

The first fix for CVE-2025-24963. No other CVE tracked by Patchfirst affects this package.

Affected versions, by release line

If you runUpgrade to
3.0.0 up to 3.0.43.0.4
2.0.4 up to 2.1.92.1.9

“Up to” means the second version is the fix and is not affected.

Check your lockfile against all CVEs

References

4 links, grouped by NVD tag
↑ ↓ chooseEnter openEsc close