vite
Affected
- introduced
6.3.0, fixed6.3.4(semver)
Fixed versions
6.3.4
Fix
- Fixed version
6.3.4npm install [email protected]
Advisory
Also known as: CVE-2025-46565
Vite's server.fs.deny bypassed with /. for files under project root
Summary
The contents of files in the project `root` that are denied by a file matching pattern 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.
Only files that are under project `root` and are denied by a file matching pattern can be bypassed.
.env, .env.*, *.{crt,pem}, **/.env**/.git/**, .git/**, .git/**/*Details
`server.fs.deny` can contain patterns matching against files (by default it includes .env, .env.*, *.{crt,pem} as such patterns).
These patterns were able to bypass for files under root by using a combination of slash and dot (/.).
PoC
npm create vite@latest
cd vite-project/
cat "secret" > .env
npm install
npm run dev
curl --request-target /.env/. http://localhost:5173
Medium Basis: The source's own band: MODERATE
6.3.0, fixed 6.3.4 (semver)6.3.4
6.3.4npm install [email protected]6.2.0, fixed 6.2.7 (semver)6.2.7
6.2.7npm install [email protected]6.0.0, fixed 6.1.6 (semver)6.1.6
6.1.6npm install [email protected]5.0.0, fixed 5.4.19 (semver)5.4.19
5.4.19npm install [email protected]0, fixed 4.5.14 (semver)4.5.14
4.5.14npm 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