CVE-2025-58751 Vite middleware may serve files starting with the same name with the public directory
Attackers can read sensitive files bypassing security settings if the Vite dev server is exposed to the network with specific symlink configurations.
- 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-58751?
CVE-2025-58751 is a low-severity path traversal vulnerability in vitejs vite, published on 8 Sep 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 7.1.5, 7.0.7, 6.3.6, and 5.4.20, files starting with the same name with the public directory were served bypassing the `server.fs` settings. Only apps that explicitly expose the Vite dev server to the network (using --host or `server.host` config option), use the public directory feature (enabled by default), and have a symlink in the public directory are affected. Versions 7.1.5, 7.0.7, 6.3.6, and 5.4.20 fix the issue.
Which versions are affected by CVE-2025-58751?
8 open source packages ship an affected version, including vite. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
vite npm | All versions | 5.4.20 |
vite npm | All versions | 5.4.20 |
vite npm | From 6.0.0 | 6.3.6 |
vite npm | From 6.0.0 | 6.3.6 |
vite npm | From 7.0.0 | 7.0.7 |
vite npm | From 7.0.0 | 7.0.7 |
2 more packages
vite npm | From 7.1.0 | 7.1.5 |
vite npm | From 7.1.0 | 7.1.5 |
Products include Vitejs Vite.
How do I fix CVE-2025-58751?
Upgrade vite to a fixed version for your release line: 5.4.20, 6.3.6, 7.0.7 or 7.1.5.
Upgrade, and resolve every user-supplied path against an allowed base folder before opening it. More about Path traversal.
Is CVE-2025-58751 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-58751 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 GHSA-g4jq-h2w9-997c, MINI-7q3h-rxjg-mhqw, MINI-8c4r-xw62-v98q, MINI-jxgx-8qr2-q92w, ROOT-APP-NPM-CVE-2025-58751.