CVE-2025-46565 Vite's server.fs.deny bypassed with /. for files under project root
Attackers can bypass file access restrictions to read sensitive files like .env from the project root if the Vite dev server is exposed to the network.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- A user has to click or open something
- Fix
- Available
What is CVE-2025-46565?
CVE-2025-46565 is a medium-severity path traversal vulnerability in vitejs vite, published on 1 May 2025. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
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.
Weakness: CWE-22
Which versions are affected by CVE-2025-46565?
10 open source packages ship an affected version, including vite. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
vite npm | All versions | 4.5.14 |
vite npm | All versions | 4.5.14 |
vite npm | From 5.0.0 | 5.4.19 |
vite npm | From 5.0.0 | 5.4.19 |
vite npm | From 6.0.0 | 6.1.6 |
vite npm | From 6.0.0 | 6.1.6 |
4 more packages
vite npm | From 6.2.0 | 6.2.7 |
vite npm | From 6.2.0 | 6.2.7 |
vite npm | From 6.3.0 | 6.3.4 |
vite npm | From 6.3.0 | 6.3.4 |
Products include Vitejs Vite.
How do I fix CVE-2025-46565?
Upgrade vite to a fixed version for your release line: 4.5.14, 5.4.19, 6.1.6 or 6.2.7.
Upgrade, and resolve every user-supplied path against an allowed base folder before opening it. More about Path traversal.
Is CVE-2025-46565 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-46565 exists.
Public exploit code: 1 Nuclei template.
Other vulnerabilities in vitejs vite
- CVE-2025-31125 Vite Vitejs Improper Access Control
- CVE-2026-53571 Vite: `server.fs.deny` bypass on Windows alternate paths
- CVE-2026-39363 Vite Affected by Arbitrary File Read via Vite Dev Server WebSocket
- CVE-2026-39364 Vite has a `server.fs.deny` bypass with queries
- CVE-2024-23331 Vite dev server option `server.fs.deny` can be bypassed when hosted on case-insensitive filesystem
Sources
Also known as CLSA-2026-1792764572, GHSA-859w-5945-r5v3, MINI-29w9-27rf-fchp.