Vulnerability record · CVE-2025-31125 · published 31 March 2025
CVE-2025-31125: Vite dev server improper access control exposes arbitrary files
Vitejs · Vite
Vite's dev server fails to restrict file access when a request uses the ?inline&import or ?raw?import query patterns, allowing content of files that should not be served to be read. Only deployments that explicitly expose the dev server to the network via --host or server.host are affected, so the risk is concentrated in development or exposed-dev environments rather than default local-only setups.
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.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
Automated analysis
high priorityThe flaw is remotely reachable without authentication and is in CISA KEV with high EPSS, but impact is limited to information disclosure and only affects dev servers explicitly exposed to the network.
What it is
Vite's dev server fails to restrict file access when a request uses the ?inline&import or ?raw?import query patterns, allowing content of files that should not be served to be read. Only deployments that explicitly expose the dev server to the network via --host or server.host are affected, so the risk is concentrated in development or exposed-dev environments rather than default local-only setups.
Impact
An unauthenticated remote attacker can read files outside the intended allowlist from the exposed dev server, leading to disclosure of source code, configuration and potentially secrets present on the host.
Attack surface
Reached over the network via HTTP requests to the Vite dev server; the CVSS vector shows no privileges or user interaction required, but exploitation depends on the server being bound to a network interface through --host or server.host.
Exploitation
CVE-2025-31125 is listed in CISA KEV with a due date of 2026-02-12, and EPSS shows a 30-day probability of 0.58462 (99th percentile); the vendor advisory is tagged Exploit, indicating public exploit information exists. No ransomware campaign use is documented.
What to do
- Upgrade Vite to a fixed release: 6.2.4, 6.1.3, 6.0.13, 5.4.16 or 4.5.11, matching your major version line.
- Stop exposing the Vite dev server to untrusted networks; remove --host and server.host settings unless strictly required.
- If remote access is required, place the dev server behind authentication and network allowlisting rather than binding it openly.
- Audit exposed dev servers for sensitive files (env files, keys, source) and rotate any credentials that may have been readable.
Detection
- Monitor HTTP requests to Vite dev server endpoints containing ?inline&import or ?raw?import query patterns.
- Alert on Vite dev server processes bound to non-loopback addresses (--host or server.host configured).
- Review network logs for external access to development ports commonly used by Vite (for example 5173) from untrusted sources.
This assessment is produced automatically and is not human-reviewed. Verify against the vendor advisory before acting on it.
Exploitation in the wild
CISA added CVE-2025-31125 to the Known Exploited Vulnerabilities catalog on 22 January 2026 as "Vite Vitejs Improper Access Control Vulnerability". 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. Federal deadline 12 February 2026.
Affected products
1 vulnerable configurations from NVD's CPE data, grouped by vendor and product.
References
| Link | Tags |
|---|---|
| https://github.com/vitejs/vite/commit/59673137c45ac2bcfad1170d954347c1a17ab949 | Patch |
| https://github.com/vitejs/vite/security/advisories/GHSA-4r4m-qw57-chr8 | ExploitVendor Advisory |
| https://github.com/vitejs/vite/security/advisories/GHSA-4r4m-qw57-chr8 | ExploitVendor Advisory |
| https://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2025-31125 | US Government Resource |
Track CVE-2025-31125 inside VULONE
Watch it alongside the ransomware crews, C2 infrastructure and forum chatter that reference it, query it through the API and pull it into your SIEM over TAXII.
Related vulnerabilities
Same products first, then exploited flaws of the same weakness class.
Source: NIST National Vulnerability Database (record CVE-2025-31125), CISA KEV, FIRST EPSS (scores of 2026-09-26). This page is refreshed as NVD updates the record.