Miggo Logo

CVE-2025-24963:
Vitest browser mode serves arbitrary files

5.9

CVSS Score

Basic Information

EPSS Score
-
Published
2/4/2025
Updated
2/4/2025
KEV Status
No
Technology
TechnologyJavaScript

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N
Package NameEcosystemVulnerable VersionsFirst Patched Version
@vitest/browsernpm>= 2.0.4, < 2.1.92.1.9
@vitest/browsernpm>= 3.0.0, < 3.0.43.0.4

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot 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.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

### Summ*ry `__s*r**ns*ot-*rror` **n*l*r on t** *rows*r mo** *TTP s*rv*r t**t r*spon*s *ny *il* on t** *il* syst*m. *sp**i*lly i* t** s*rv*r is *xpos** on t** n*twork *y [`*rows*r.*pi.*ost: tru*`](*ttps://vit*st.**v/*ui**/*rows*r/*on*i*.*tml#*rows*r-

Reasoning

T** vuln*r**ility st*ms *rom t** __s*r**ns*ot-*rror **n*l*r ***** in *ommit *******. T** *un*tion:- *. T*k*s * '*il*' qu*ry p*r*m*t*r *ir**tly *rom us*r input- *. Us*s lst*tSyn*/*il*R***Syn* wit*out v*li**tin* ***inst *llow** p*t*s- *. S*rv*s *il* *o