# CVE-2025-31125: Vite has a \`server.fs.deny\` bypassed for \`inline\` and \`raw\` with \`?import\` query

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** MEDIUM 5.3
- **CVSS:** 5.3 (v3.1, CNA) `CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:N/A:N`
- **CVSS metrics:** Attack vector: Network; Attack complexity: High; Privileges required: None; User interaction: Required; Scope: Unchanged; Confidentiality impact: High; Integrity impact: None; Availability impact: None
- **Exploited in the wild:** Yes: in CISA KEV since 2026-01-22; federal due date 2026-02-12
- **Public exploit / PoC:** None known
- **Remote exploitation:** Remote, no login needed
- **EPSS:** 14.85% (percentile 97, 2026-11-28)
- **CWE:** CWE-200, CWE-284
- **Aliases:** GHSA-4r4m-qw57-chr8
- **Published:** 2025-03-31T17:06:30.704Z
- **Modified:** 2026-09-10T03:50:56.858Z

## Who should check

- Projects that depend on npm package vite (\>= 6.2.0, \< 6.2.4)
- Anyone running vitejs vite \>= 6.2.0, \< 6.2.4; \>= 6.1.0, \< 6.1.3; \>= 6.0.0, \< 6.0.13; \>= 5.0.0, \< 5.4.16; \< 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.

## Affected and fixed versions

- npm `vite`: affected \>= 6.2.0, \< 6.2.4; fixed 6.2.4, 6.1.3, 6.0.13, 5.4.16, 4.5.11 (osv)
- vitejs vite: \>= 6.2.0, \< 6.2.4; \>= 6.1.0, \< 6.1.3; \>= 6.0.0, \< 6.0.13; \>= 5.0.0, \< 5.4.16; \< 4.5.11 (cvelist)

## Mitigation

- Upgrade vite to one of 6.2.4, 6.1.3, 6.0.13, 5.4.16, 4.5.11 (or later in the same release line).

## Timeline

- 2025-03-31: Published
- 2026-01-22: Added to CISA KEV (exploited in the wild)
- 2026-02-12: CISA remediation due date for US federal agencies
- 2026-09-10: Last modified

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2025-31125. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2025-31125.md
Affected: vite >= 6.2.0, < 6.2.4
Fixed in: 6.2.4, 6.1.3, 6.0.13, 5.4.16, 4.5.11

Steps:
1. Search this machine and project for vite (npm), vitejs vite: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2025-31125 being exploited?

Yes. CISA lists CVE-2025-31125 in its Known Exploited Vulnerabilities catalog since 2026-01-22, which means attacks have been seen. No public exploit code is known. EPSS estimates a 14.85% chance of exploitation in the next 30 days (as of 2026-11-28).

### How serious is CVE-2025-31125?

Medium: CVSS 5.3 (v3.1, scored by CNA). Remote, no login needed. A user has to take an action, such as opening a link, for the attack to work. The attack needs conditions outside the attacker's control, which makes it harder.

### Which versions are affected by CVE-2025-31125?

vite \>= 6.2.0, \< 6.2.4.

### Is there a fix for CVE-2025-31125?

Yes. Fixed in 6.2.4, 6.1.3, 6.0.13, 5.4.16, 4.5.11. Upgrade vite to one of 6.2.4, 6.1.3, 6.0.13, 5.4.16, 4.5.11 (or later in the same release line).

### How do I check if I'm affected by CVE-2025-31125?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- vendor: <https://github.com/vitejs/vite/security/advisories/GHSA-4r4m-qw57-chr8>
- vendor: <https://nvd.nist.gov/vuln/detail/CVE-2025-31125>
- patch: <https://github.com/vitejs/vite/commit/59673137c45ac2bcfad1170d954347c1a17ab949>
- other: <https://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2025-31125>
- other: <https://github.com/vitejs/vite>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2025-31125>
- OSV: CC-BY 4.0 <https://osv.dev/vulnerability/GHSA-4r4m-qw57-chr8> (license: <https://creativecommons.org/licenses/by/4.0/>)
- CISA KEV: CISA Known Exploited Vulnerabilities Catalog <https://www.cisa.gov/known-exploited-vulnerabilities-catalog>

HTML: <https://flawdb.com/CVE-2025-31125> · JSON: <https://flawdb.com/api/v1/entries/CVE-2025-31125>
