# CVE-2025-24963: Vitest browser mode arbitrary file read via screenshot-error handler

Source: https://junglewise.ai/threats/cve-2025-24963-vitest-browser-mode-arbitrary-file-read-via-screenshot-error  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2025-02-04. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

CVE-2025-24963 · Severity: low · CVSS 3.1 · Published 2025-02-04

Vitest is a JavaScript testing framework with a browser mode that provides local HTTP server capabilities for running tests in browsers. An attacker can read arbitrary files from the server's filesystem by exploiting an unprotected HTTP handler, if the server is exposed to the network via the browser.api.host configuration option.

Technologies: [@vitest/browser (npm)](https://junglewise.ai/threats/technologies/vitest-browser). Vendors: [npm](https://junglewise.ai/threats/vendors/npm).

## Quick answers

**Is CVE-2025-24963 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2025-24963 being exploited in the wild.

**How severe is CVE-2025-24963?** Low severity, with a CVSS score of 3.1, published 4 February 2025.

**Which products and versions are affected?** @vitest/browser (npm) SEMVER:introduced=2.0.4,fixed=2.1.9.

**Is there a fix for CVE-2025-24963?** Yes. @vitest/browser (npm): upgrade to 2.1.9 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2025-24963 attacked?** It is attacked over the network.

**Am I affected by CVE-2025-24963?** Check whether you run @vitest/browser (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- @vitest/browser (npm): upgrade to 2.1.9 or later

  ```sh
  npm install @vitest/browser@2.1.9
  ```


## Technical details

The vulnerability is a path traversal / arbitrary file read flaw in the __screenshot-error HTTP handler of Vitest's browser mode. The handler accepts a 'file' query parameter and reads any file on the filesystem without validation or sanitization, returning its contents to the attacker. The attack requires network access to the Vitest browser server, which is only exposed remotely if browser.api.host is explicitly set to true. The vulnerability was introduced in version 2.0.4 and fixed in versions 2.1.9 and 3.0.4. No authentication or user interaction is required to exploit this vulnerability from a remote network attacker.

## Affected products

- Vitest Vitest >=2.0.4, <2.1.9; >=3.0.0, <3.0.4
- Vitest @vitest/browser >=2.0.4, <2.1.9; >=3.0.0, <3.0.4

## Identifiers

- CVE-2025-24963
- GHSA-8gvc-j273-4wm5

## Timeline

- 2025-02-04: disclosed: Vulnerability disclosed via GHSA-8gvc-j273-4wm5
- 2025-02-04: patched: Fixed in Vitest 2.1.9 and 3.0.4

## References

- [https://github.com/vitest-dev/vitest/security/advisories/GHSA-8gvc-j273-4wm5](https://github.com/vitest-dev/vitest/security/advisories/GHSA-8gvc-j273-4wm5)

## Related threats

- [Vitest filesystem deny misapplication in dev servers](https://junglewise.ai/threats/cve-2026-112948-vitest-is-a-testing-framework-powered-by-vite-from-5-0-0-beta-6)
- [Vitest Browser Mode permission gate bypass](https://junglewise.ai/threats/cve-2026-73653-vitest-browser-mode-permission-gate-bypass)
- [Vitest remote code execution in Browser Mode cdp API](https://junglewise.ai/threats/cve-2026-53633-vitest-remote-code-execution-in-browser-mode-cdp-api)
- [Vitest XSS in Browser Mode via otelCarrier parameter](https://junglewise.ai/threats/cve-2026-47428-vitest-xss-in-browser-mode-via-otelcarrier-parameter)
