# CVE-2025-58751: Vite middleware may serve files starting with the same name with the public directory

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

- **Severity:** LOW 2.3
- **CVSS:** 2.3 (v4.0, CNA) `CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N`
- **CVSS metrics:** Attack vector: Network; Attack complexity: Low; Attack requirements: Present; Privileges required: None; User interaction: Passive; Confidentiality impact: Low; Integrity impact: None; Availability impact: None; Confidentiality impact on other systems: None; Integrity impact on other systems: None; Availability impact on other systems: None
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Remote, no login needed
- **EPSS:** 1.40% (percentile 73, 2026-11-26)
- **CWE:** CWE-22, CWE-200, CWE-284
- **Aliases:** GHSA-g4jq-h2w9-997c
- **Published:** 2025-09-08T22:52:45.667Z
- **Modified:** 2026-09-10T03:50:28.405Z

## Who should check

- Projects that depend on npm package vite (\>= 7.1.0, \< 7.1.5)
- Anyone running vitejs vite \< 5.4.20; \>= 6.0.0, \< 6.3.6; \>= 7.0.0, \< 7.0.7; \>= 7.1.0, \< 7.1.5

## Description

Vite is a frontend tooling framework for JavaScript. Prior to versions 7.1.5, 7.0.7, 6.3.6, and 5.4.20, files starting with the same name with the public directory were served bypassing the \`server.fs\` settings. Only apps that explicitly expose the Vite dev server to the network (using --host or \`server.host\` config option), use the public directory feature (enabled by default), and have a symlink in the public directory are affected. Versions 7.1.5, 7.0.7, 6.3.6, and 5.4.20 fix the issue.

## Affected and fixed versions

- npm `vite`: affected \>= 7.1.0, \< 7.1.5; fixed 7.1.5, 7.0.7, 6.3.6, 5.4.20 (osv)
- vitejs vite: \< 5.4.20; \>= 6.0.0, \< 6.3.6; \>= 7.0.0, \< 7.0.7; \>= 7.1.0, \< 7.1.5 (cvelist)

## Mitigation

- Upgrade vite to one of 7.1.5, 7.0.7, 6.3.6, 5.4.20 (or later in the same release line).

## Check your systems with an agent

Paste this into a coding agent:

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

Details: https://flawdb.com/CVE-2025-58751.md
Affected: vite >= 7.1.0, < 7.1.5
Fixed in: 7.1.5, 7.0.7, 6.3.6, 5.4.20

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-58751 being exploited?

There is no confirmed exploitation: CVE-2025-58751 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 1.40% chance of exploitation in the next 30 days (as of 2026-11-26).

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

Low: CVSS 2.3 (v4.0, scored by CNA). Remote, no login needed. A user has to take an action, such as opening a link, for the attack to work.

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

vite \>= 7.1.0, \< 7.1.5.

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

Yes. Fixed in 7.1.5, 7.0.7, 6.3.6, 5.4.20. Upgrade vite to one of 7.1.5, 7.0.7, 6.3.6, 5.4.20 (or later in the same release line).

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

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-g4jq-h2w9-997c>
- vendor: <https://nvd.nist.gov/vuln/detail/CVE-2025-58751>
- patch: <https://github.com/lukeed/sirv/commit/f0113f3f8266328d804ee808f763a3c11f8997eb>
- patch: <https://github.com/vitejs/vite/commit/09f2b52e8d5907f26602653caf41b3a56692600d>
- patch: <https://github.com/vitejs/vite/commit/4f1c35bcbb5830290c694aa14b6789e07450f069>
- patch: <https://github.com/vitejs/vite/commit/63e2a5d232218f3f8d852056751e609a5367aaec>
- patch: <https://github.com/vitejs/vite/commit/e11d24008b97d4ca731ecc1a3b95260a6d12e7e0>
- 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-58751>
- OSV: CC-BY 4.0 <https://osv.dev/vulnerability/GHSA-g4jq-h2w9-997c> (license: <https://creativecommons.org/licenses/by/4.0/>)

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