vite
Affected
- introduced
6.2.0, fixed6.2.4(semver)
Fixed versions
6.2.4
Fix
- Fixed version
6.2.4npm install [email protected]
Advisory
Also known as: CVE-2025-31125
Vite has a server.fs.deny bypassed for inline and raw with ?import query
Summary
The contents of arbitrary files can be returned to the browser.
Impact
Only apps explicitly exposing the Vite dev server to the network (using --host or `server.host` config option) are affected.
Details
?inline&import (originally reported as ?import&?inline=1.wasm?init)?raw?import/@fs/ isn't needed to reproduce the issue for files inside the project root.
PoC
Original report (check details above for simplified cases):
The ?import&?inline=1.wasm?init ending allows attackers to read arbitrary files and returns the file content if it exists. Base64 decoding needs to be performed twice
$ npm create vite@latest
$ cd vite-project/
$ npm install
$ npm run dev
Example full URL http://localhost:5173/@fs/C:/windows/win.ini?import&?inline=1.wasm?init
Medium Basis: The source's own band: MODERATE
6.2.0, fixed 6.2.4 (semver)6.2.4
6.2.4npm install [email protected]6.1.0, fixed 6.1.3 (semver)6.1.3
6.1.3npm install [email protected]6.0.0, fixed 6.0.13 (semver)6.0.13
6.0.13npm install [email protected]5.0.0, fixed 5.4.16 (semver)5.4.16
5.4.16npm install [email protected]0, fixed 4.5.11 (semver)4.5.11
4.5.11npm install [email protected]Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.
Check your own computer: guard packages check
Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0