Vulnerability · Published May 1, 2025 · Assigned by GitHub_M
CVE-2025-46565Vite's server.fs.deny bypassed with /. for files under project root
Medium 6.0
In plain English
A medium-severity path traversal in vite from vitejs. Proof-of-concept exploit code is public. The chance it is exploited in the next 30 days is estimated at 1.2% (higher than 69% of all known vulnerabilities). Ready-made attack tooling exists: Nuclei. Fixed versions are available - upgrade the affected package.
Official description
Vite is a frontend tooling framework for javascript. Prior to versions 6.3.4, 6.2.7, 6.1.6, 5.4.19, and 4.5.14, the contents of files in the project root that are denied by a file matching pattern can be returned to the browser. 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. `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 (/.). This issue has been patched in versions 6.3.4, 6.2.7, 6.1.6, 5.4.19, and 4.5.14.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| npm | vite | 6.3.4 | GHSA-859w-5945-r5v3 |
| npm | vite | 6.2.7 | GHSA-859w-5945-r5v3 |
| npm | vite | 6.1.6 | GHSA-859w-5945-r5v3 |
| npm | vite | 5.4.19 | GHSA-859w-5945-r5v3 |
| npm | vite | 4.5.14 | GHSA-859w-5945-r5v3 |
Affected products (as reported)
Weakness: CWE-22 · 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
References
- https://github.com/vitejs/vite/security/advisories/GHSA-859w-5945-r5v3 x_refsource_CONFIRM
- https://github.com/vitejs/vite/commit/c22c43de612eebb6c182dd67850c24e4fab8cacb x_refsource_MISC