🛡️ CVE-2025-24963 — vitest

🟡 CVSS 5.9 — Medium ✅ No Known Exploit CWE-22 NVD
5.9
CVSS Score
0 Low4 Medium7 High9 Critical10

Description

Vitest browser mode serves arbitrary files

Summary

__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](https://vitest.dev/guide/browser/config.html#browser-api), an attacker can send a request to that handler from remote to get the content of arbitrary files.

Details

This __screenshot-error handler on the browser mode HTTP server responds any file on the file system.

https://github.com/vitest-dev/vitest/blob/f17918a79969d27a415f70431e08a9445b051e45/packages/browser/src/node/plugin.ts#L88-L130

This code was added by https://github.com/vitest-dev/vitest/commit/2d62051f13b4b0939b2f7e94e88006d830dc4d1f.

PoC

1. Create a directory and change the current directory to that directory

1. Run npx vitest init browser

1. Run npm run test:browser

2. Run curl http://localhost:63315/__screenshot-error?file=/path/to/any/file

Impact

Users explicitly exposing the browser mode server to the network by [browser.api.host: true](https://vitest.dev/guide/browser/config.html#browser-api) may get any files exposed.

How this vulnerability can be exploited

This issue can be reached over the network, attack complexity is high, an attacker needs no privileges on the target. No user interaction is required. The scope is unchanged, so the impact stays within the vulnerable component. Rated impact: confidentiality high, integrity none, availability none.

Weakness class

CVE-2025-24963 is classified as CWE-22: Path Traversal. A file path built from user input is not confined to the intended directory, letting an attacker reach files elsewhere on the filesystem.

Affected software

CVE-2025-24963 is recorded against 2 packages.

  • @vitest/browser
  • vitest (from 3.0.0 up to 3.0.4)

Timeline and source

Published on 4 February 2025. No public exploit is currently recorded for this entry. A vendor advisory or fix has been published. Record sourced from NVD.

References

github.com (Web)
nvd.nist.gov (Advisory)
github.com (Web)
github.com (Web)
github.com (Package)
github.com (Web)
vitest.dev (Web)

Details

Severity Medium
CVSS Score 5.9
CVSS Vector CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N
CWE CWE-22
Public Exploit ✅ No
Source NVD
Published 2025-02-04
Updated 2026-08-12
Modified 2025-02-04

Affected Packages

Software From version Fixed in
@vitest/browser
vitest 3.0.0 3.0.4

Similar Threats

Vulnerability Monitoring

Track new vulnerabilities in vitest

CVE-2025-24963 is rated CVSS 5.9 Medium. BotEraser monitors your WordPress installation and notifies you when software you use appears in our vulnerability database.

Set Up Free Alerts →

No credit card required  ·  Results in minutes

ⓘ Data Notice: The information presented above has been compiled from publicly available internet sources. Boteraser aggregates this data solely for informational purposes and does not independently classify, evaluate, or endorse any findings about the vulnerabilities listed. The accuracy and completeness of this information is the sole responsibility of the original publishers. Boteraser and its operators accept no liability for any decisions made based on this data.