CVE-2025-58751 Vite middleware may serve files starting with the same name with the public directory

Low 2.3 Published Updated

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.

Weakness: CWE-284, CWE-22, CWE-200

Which versions are affected by CVE-2025-58751?

8 open source packages ship an affected version, including vite. It affects 1 product.

PackageAffectedFixed in
vite npmAll versions5.4.20
vite npmAll versions5.4.20
vite npmFrom 6.0.06.3.6
vite npmFrom 6.0.06.3.6
vite npmFrom 7.0.07.0.7
vite npmFrom 7.0.07.0.7
2 more packages
vite npmFrom 7.1.07.1.5
vite npmFrom 7.1.07.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.

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.

Is CVE-2025-58751 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free