CVE-2025-24963:
Vitest browser mode serves arbitrary files
5.9
CVSS ScoreBasic Information
CVE ID
GHSA ID
EPSS Score
-
CWE
Published
2/4/2025
Updated
2/4/2025
KEV Status
No
Technology
JavaScript
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
@vitest/browser | npm | >= 2.0.4, < 2.1.9 | 2.1.9 |
@vitest/browser | npm | >= 3.0.0, < 3.0.4 | 3.0.4 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from the __screenshot-error handler added in commit 2d62051. The function:- 1. Takes a 'file' query parameter directly from user input- 2. Uses lstatSync/fileReadSync without validating against allowed paths- 3. Serves file contents with image MIME types regardless of actual file type- 4. Exposes any file when combined with browser.api.host=true configuration.The patch in commit ed9aeba212df04b83ed01810780663ff2cdd0adf fixes this by replacing 'file' parameter with 'id' that references internal test metadata rather than direct path access, confirming this was the vulnerable code path.