CVE-2025-31125 Vite Vitejs Improper Access Control

Exploited in the wild Medium 5.3 Published Updated

Attackers can bypass file access restrictions to read sensitive files if the Vite dev server is exposed to the network.

Exploited in the wild
Since 22 Jan 2026
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-31125?

CVE-2025-31125 is a medium-severity path traversal vulnerability in vitejs vite, published on 31 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 is a frontend tooling framework for javascript. Vite exposes content of non-allowed files using ?inline&import or ?raw?import. Only apps explicitly exposing the Vite dev server to the network (using --host or server.host config option) are affected. This vulnerability is fixed in 6.2.4, 6.1.3, 6.0.13, 5.4.16, and 4.5.11.

Weakness: CWE-284, CWE-200

Which versions are affected by CVE-2025-31125?

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

PackageAffectedFixed in
vite npmAll versions4.5.11
vite npmAll versions4.5.11
vite npmFrom 5.0.05.4.16
vite npmFrom 5.0.05.4.16
vite npmFrom 6.0.06.0.13
vite npmFrom 6.0.06.0.13
4 more packages
vite npmFrom 6.1.06.1.3
vite npmFrom 6.1.06.1.3
vite npmFrom 6.2.06.2.4
vite npmFrom 6.2.06.2.4

Products include Vitejs Vite.

How do I fix CVE-2025-31125?

Upgrade vite to a fixed version for your release line: 4.5.11, 5.4.16, 6.0.13 or 6.1.3. US federal agencies must fix it by 12 Feb 2026.

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

Is CVE-2025-31125 being exploited?

Yes. Attackers have exploited CVE-2025-31125 in the wild since at least 22 Jan 2026.

Public exploit code: 1 Nuclei template and 4 proofs of concept on GitHub.

Sources

Also known as GHSA-4r4m-qw57-chr8, MINI-qj5j-42h3-7rfg.

Is CVE-2025-31125 in your software?

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

Check your SBOMs for free