CVE-2025-58752 Vite's `server.fs` settings were not applied to HTML files

Low 2.3 Published Updated

Attackers can read arbitrary HTML files from the local machine via the Vite dev or preview server if 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-58752?

CVE-2025-58752 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, any HTML files on the machine were served regardless of the `server.fs` settings. Only apps that explicitly expose the Vite dev server to the network (using --host or server.host config option) and use `appType: 'spa'` (default) or `appType: 'mpa'` are affected. This vulnerability also affects the preview server. The preview server allowed HTML files not under the output directory to be served. Versions 7.1.5, 7.0.7, 6.3.6, and 5.4.20 fix the issue.

Weakness: CWE-284, CWE-23, CWE-200

Which versions are affected by CVE-2025-58752?

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-58752?

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-58752 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-58752 exists.

Sources

Also known as GHSA-jqfw-vq24-v9c3, MINI-59c9-2qv7-hgc3, MINI-7fwg-fxrc-v3qh, MINI-cw62-rmhf-xrgj, ROOT-APP-NPM-CVE-2025-58752.

Is CVE-2025-58752 in your software?

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

Check your SBOMs for free