Patchfirst
CVE-2025-31125 KEVPublic exploit High · 7.5 EPSS 74.9%

Vite Vitejs Improper Access Control Vulnerability

Vite · Vitejs

Summary

Vite, a frontend tooling framework for JavaScript, has an improper access control flaw in its dev server that exposes the contents of files which should not be allowed to be served, via the ?inline&import or ?raw?import query parameters. An attacker can read these files over the network without authentication or user interaction, but only against applications that explicitly expose the Vite dev server to the network through the --host flag or the server.host configuration option.

Official 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.

Breakdown
68.2 / 100
Exploited
Yes, in CISA KEV
Reports
0
Tactics
2/15

How an attack unfolds

Based on mappings. Select a step to see the evidence.
  1. How attackers get in

  2. What they do

First seen exploited 2 months after disclosure. Public exploit code (PoC-in-GitHub) appeared 1 day after disclosure.

  1. Disclosedday 0
  2. Public exploit codePoC-in-GitHub+1 day
  3. First seen exploitedVulnCheck KEV evidence+2 mo
  4. Added to CISA KEVEU database agrees+10 mo

CISA KEV listing is when exploitation was confirmed, not necessarily the first attack.

See the family tree

13 related vulnerabilities in the same code over 19 months. The latest fix listed for vite is 6.3.4.

Same bug familyLinked by evidence that a fix failed or the same code was patched again. Oldest first.

  1. CVE-2024-45811server.fs.deny bypassed when using ?import&raw in vite17 Sep 2024
  2. relatedMedium

    Why these are linked:

    CVE-2025-30208Vite bypasses server.fs.deny when using `?raw??`24 Mar 2025
  3. relatedHigh

    Why these are linked:

    • Fixed one release later6.2.3 → 6.2.4 (vite)
    • Fixed one release later4.5.10 → 4.5.11 (vite)
    • Same code patched: transform.ts, index.html (machine-matched)Functions: transformMiddlewarecommit 315695ecommit 80381c3commit 5967313
    • Similar weakness in the same product (machine-matched)same package + description similarity
    This CVECVE-2025-31125Vite Vitejs Improper Access Control31 Mar 2025KEV
  4. relatedHigh

    Why these are linked:

    • Fixed one release later6.2.4 → 6.2.5 (vite)
    • Fixed one release later4.5.11 → 4.5.12 (vite)
    • Same code patched: transform.ts, index.html (machine-matched)Functions: transformMiddlewarecommit 5967313commit 62d7e81
    CVE-2025-31486Vite allows server.fs.deny to be bypassed with .svg or relative…3 Apr 2025
  5. relatedMedium

    Why these are linked:

    CVE-2026-39364Vite has a `server.fs.deny` bypass with queries7 Apr 2026
  6. relatedMedium

    Why these are linked:

    CVE-2026-39365Vite has a Path Traversal in Optimized Deps `.map` Handling7 Apr 2026

7 more CVEs are in this family. See the family tree

Fixes in vitenpm package, by fixed version. Earlier and later fixes in the same package, not necessarily the same bug.

  1. 5.4.9CVE-2024-520111 Jun 2026
  2. 6.0.9CVE-2025-2401020 Jan 2025
  3. 6.2.3CVE-2025-3020824 Mar 2025
  4. 6.2.4CVE-2025-3112531 Mar 2025KEV
  5. 6.2.5CVE-2025-314863 Apr 2025
  6. 6.2.6CVE-2025-3239510 Apr 2025
  7. 6.3.4CVE-2025-465651 May 2025Latest listed

techniques

2 , grouped by in kill-chain order, 2 cited passages 2

Initial AccessTA0001

Exploit Public-Facing Application T1190 Medium
AI mapping from the description · how it is exploited

Exploited via network-exposed dev server HTTP requests

Only apps explicitly exposing the Vite dev server to the network
From the official description (NVD) Original (opens in a new tab) ↗

CollectionTA0009

Data from Local System T1005 Medium
AI mapping from the description · primary impact

Attacker reads non-allowed local files

Vite exposes content of non-allowed files
From the official description (NVD) Original (opens in a new tab) ↗

Detection

0 rules for this CVE · 163 general rules for its techniques

Rules for this CVE

0 that reference CVE-2025-31125 directly.

CVE-specific rules are not available in this build. Search SigmaHQ ↗

Sigma rules © SigmaHQ, Detection Rule License 1.1; linked, not reproduced.

Am I affected? What do I upgrade to?

From GitHub Security Advisories and OSV

1 package in 1 ecosystem. Main package: vite.

Upgrade to 6.4.2 or later

Fixes this CVE and 2 other known vulnerabilities in this package (CVE-2025-30208, CVE-2026-39365).

npmnpm install vite@6.4.2

First fixed in 6.2.4 for CVE-2025-31125.

Affected versions, by release line

If you runUpgrade to
6.2.0 up to 6.2.46.4.2first fix for this CVE: 6.2.4
6.1.0 up to 6.1.3

Still affected on this line by CVE-2026-39365 (fixed in 6.4.2, a newer line).

6.1.3
6.0.0 up to 6.0.13

Still affected on this line by CVE-2026-39365 (fixed in 6.4.2, a newer line).

6.0.13
5.0.0 up to 5.4.16

Still affected on this line by CVE-2026-39365 (fixed in 6.4.2, a newer line).

5.4.16
All versions before 4.5.11

Still affected on this line by CVE-2026-39365 (fixed in 6.4.2, a newer line).

4.5.11

“Up to” means the second version is the fix and is not affected.

Check your lockfile against all CVEs

What security researchers reported

Not named in any threat report yet

Also mentioned in 50 community threat pulses (AlienVault OTX)

Weaker evidence

Pulses are indicator collections that anyone can publish. A mention is not confirmation of exploitation.

References

3 links, grouped by NVD tag (1 duplicate merged)
↑ ↓ chooseEnter openEsc close