Vite has a `server.fs.deny` bypassed for `inline` and `raw` with `?import` query
Affects Vite dev servers exposed to the network with --host or server.host, in versions before 4.5.11 and in 5.0.0 to 6.2.x ranges below their fixes. Fixed in 4.5.11, 5.4.16, 6.0.13, 6.1.3 and 6.2.4.
- Published
- Last modified
- Where the record stands: published, rejected by its publisher, or superseded by another id.What do these mean? →
- published
- Whether CISA lists it in its Known Exploited Vulnerabilities catalog: proof that attackers are using it.What do these mean? →
- Listed in CISA KEV
- How many real-world setups can hit the bug, from the vendor's advisory and CISA data. It does not know your setup.What do these mean? →
- Actively exploited
- Fix
- Fixed in 6.2.4, 6.1.3, 6.0.13, 5.4.16, 4.5.11
- Whether working attack code is public (Exploit-DB, Metasploit, Nuclei or GitHub). Public code makes attacks easier.What do these mean? →
- None on Exploit-DB, Metasploit or GitHub
Summary
Vite, a frontend build tool for JavaScript, is affected when its development server is exposed to the network (for example via the --host or server.host setting). The flaw lets remote users read the contents of files that the server is configured to block, such as those listed in server.fs.deny.
Summarized by anthropic/claude-haiku-5.5. Verify details against the original sources.
Read the original 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.
Timeline
- CVE published
- Added to CISA KEV
CISA has evidence of exploitation in the wild
- Record last updated
- CISA remediation deadline
Due date for US federal agencies to patch
- EPSS reached 10%
FIRST estimates at least a 10% chance of exploitation in the next 30 days
Affected versions
- vitejs vite
From 6.2.0 · fixed in 6.2.4; From 6.1.0 · fixed in 6.1.3; From 6.0.0 · fixed in 6.0.13; From 5.0.0 · fixed in 5.4.16; fixed in 4.5.11
- vitenpm
From 6.2.0 · fixed in 6.2.4
- vitenpm
From 6.1.0 · fixed in 6.1.3
- vitenpm
From 6.0.0 · fixed in 6.0.13
- vitenpm
From 5.0.0 · fixed in 5.4.16
- vitenpm
fixed in 4.5.11
References 2
GitHub · vitejs/vite
Questions about CVE-2025-31125
What does this mean?
The bypass lets an attacker read arbitrary files from the server and have their contents returned to the browser. The flaw is in how Vite's server.fs.deny rule handles the inline and raw query forms with ?import.Source: github.com
Am I affected, and how do I check?
Affected versions are Vite before 4.5.11, 5.0.0 up to 5.4.16, 6.0.0 up to 6.0.13, 6.1.0 up to 6.1.3, and 6.2.0 up to 6.2.4. The issue only applies when the dev server is exposed to the network using --host or the server.host config option. To check, run the Vite version command in the project and look for --host or server.host in the Vite config.Source: github.com
What should I do about it?
Upgrade to the fixed release for your branch: 4.5.11, 5.4.16, 6.0.13, 6.1.3 or 6.2.4. Upgrading within the same major version is the fix the advisory names.Source: github.com
Is it being exploited?
Yes. CISA added it to its Known Exploited Vulnerabilities catalog on 2026-01-22, which means it has evidence of attacks. No public exploit code is tracked.Source: cisa.gov, cve.now feed data