CVE-2025-30208 Vite bypasses server.fs.deny when using `?raw??`

Medium 5.3 Published Updated

Attackers can read arbitrary files by bypassing server.fs.deny restrictions in Vite dev servers 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-30208?

CVE-2025-30208 is a medium-severity path traversal vulnerability in vitejs vite, published on 24 Mar 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, a provider of frontend development tooling, has a vulnerability in versions prior to 6.2.3, 6.1.2, 6.0.12, 5.4.15, and 4.5.10. `@fs` denies access to files outside of Vite serving allow list. Adding `?raw??` or `?import&raw??` to the URL bypasses this limitation and returns the file content if it exists. This bypass exists because trailing separators such as `?` are removed in several places, but are not accounted for in query string regexes. The contents of arbitrary files 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. Versions 6.2.3, 6.1.2, 6.0.12, 5.4.15, and 4.5.10 fix the issue.

Weakness: CWE-284, CWE-200

Which versions are affected by CVE-2025-30208?

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

PackageAffectedFixed in
vite npmAll versions4.5.10
vite npmAll versions4.5.10
vite npmFrom 5.0.05.4.15
vite npmFrom 5.0.05.4.15
vite npmFrom 6.0.06.0.12
vite npmFrom 6.0.06.0.12
4 more packages
vite npmFrom 6.1.06.1.2
vite npmFrom 6.1.06.1.2
vite npmFrom 6.2.06.2.3
vite npmFrom 6.2.06.2.3

Products include Vitejs Vite.

How do I fix CVE-2025-30208?

Upgrade vite to a fixed version for your release line: 4.5.10, 5.4.15, 6.0.12 or 6.1.2.

Upgrade, and resolve every user-supplied path against an allowed base folder before opening it. More about Path traversal.

Is CVE-2025-30208 being exploited?

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

Public exploit code: 1 Exploit-DB entry, 1 Nuclei template and 25 proofs of concept on GitHub.

Sources

Also known as GHSA-x574-m823-4x7w, MINI-8g8g-g9xj-8mm9, ROOT-APP-NPM-CVE-2025-30208.

Is CVE-2025-30208 in your software?

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

Check your SBOMs for free