Skip to content
NewA calmer, faster ZeroHour
VulnerabilityKEVPoC ×23 · 1 read

CVE-2025-31125

Vite Dev Server Improper Access Control Exposes Protected Files (Actively Exploited)

CISA: Vite Vitejs Improper Access Control Vulnerability

CVSS 3.1
7.5 high
EPSS
75%p100
Published
·
Added to KEV
Analyze CVE-2025-31125 with Vani AIImpact, affected versions, exploitation status, mitigations and detection

CVE-2025-31125 is an improper access control flaw (CWE-284/CWE-200) in the Vite JavaScript frontend tooling's dev server, where HTTP requests using the '?inline&import' or '?raw?import' query parameters can read the contents of files the dev server should not serve, bypassing its file-access restrictions (server.fs.deny). An unauthenticated remote attacker (CVSS:3.1 AV:N/AC:L/PR:N/UI:N) triggers it by sending crafted requests with these query parameters to a running Vite dev server. The attacker gains read access to arbitrary files on the machine running the dev server, such as source code and .env files containing secrets, with high confidentiality impact and no integrity or availability impact. Only applications that explicitly expose the Vite dev server to the network via the --host flag or the server.host option are affected; production builds are not impacted. The flaw is being actively exploited: CISA added it to the Known Exploited Vulnerabilities catalog on 2026-01-22 (ransomware association unknown), and EPSS assigns a 58.5% probability of exploitation within 30 days (99th percentile).

What to do: Upgrade Vite to 6.2.4, 6.1.3, 6.0.13, 5.4.16, or 4.5.11 depending on your release line. Until patched, do not expose the dev server to untrusted networks (remove --host/server.host or bind to localhost behind an access-controlled proxy), and review access logs for requests using ?inline&import or ?raw?import that retrieved sensitive files such as .env. As a KEV entry added 2026-01-22, U.S. federal agencies must apply vendor mitigations per BOD 22-01 or discontinue use if mitigations are unavailable.

ProductAffected
vitejs viteReleases before the fixed version in each line: 4.x < 4.5.11, 5.x < 5.4.16, 6.0.x < 6.0.13, 6.1.x < 6.1.3, 6.2.x < 6.2.4 (only when the dev server is exposed to
Estimated exposure
largeplausibly tens of thousands to ~100,000 network-exposed Vite dev servers, out of millions of total Vite users — Vite is a mainstream frontend build tool with developer adoption in the millions (on the order of tens of millions of weekly npm downloads), but the flaw only applies to dev servers deliberately bound to non-localhost interfaces via --host…

Order-of-magnitude estimate by the model from install counts, market share and public scan data it knows; verify before quoting.

Description · NVD

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.

KEVCISA Known Exploited Vulnerability
Affected
Vite Vitejs
Required action
Apply mitigations per vendor instructions, follow applicable BOD 22-01 guidance for cloud services, or discontinue use of the product if mitigations are unavailable.
Due date
Ransomware use
Unknown
Vendors
vitejs
Products
vite
Weakness
CWE-200, CWE-284
Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N

In the news

6 stories