Vite middleware may serve files starting with the same name with the public directory
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.
- Published
- Sep 8, 2025
- Updated
- Jun 17, 2026
- EPSS
- 1.2% · 68th percentile
- CWE
- CWE-22
Sign in to follow · You’ll be notified if a followed record enters KEV, gets an exploit or is updated.
Report tools
Action score
9
Monitor
Low priority for now.
- CVSS
- 9 / 40 · 2.3 / 10
- CISA KEV
- 0 / 30 · Not listed
- EPSS
- 0 / 30 · 1.2%
CISA SSVC decision
- Exploitation
- proof of concept
- Automatable
- no
- Technical impact
- partial
Vulnrichment: CISA's decision-tree inputs.
CNA vs NVD score
- NVD
- —
- CNA · GitHub_M
- 2.3
- NVD has not scored this yet; the score shown is the CNA’s.
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
The score given by the assigning authority versus NVD’s independent score. A gap means the severity is contested.
Noroxi analysis
No Noroxi analysis for this record yet
We don't hand-write analysis for the hundreds of thousands of vulnerabilities in the database; that wouldn't be honest. For notable, high-impact vulnerabilities our team writes the mechanism, detection and remediation steps.
We use this product, ask for helpAffected systems
| Vendor | Product | CPE |
|---|---|---|
| vitejs | vite | cpe:2.3:a:vitejs:vite |
Affected versions
NVD version ranges (for catalog products). Add the product to your stack with a version and matching uses these.
- vitejs vitebefore 5.4.20
- vitejs vite6.0.0 and later · before 6.3.6
- vitejs vite7.0.0 and later · before 7.0.7
- vitejs vite7.1.0 and later · before 7.1.5
Versions reported by the vendor
Affected version ranges reported by the assigning authority (GitHub_M). Independent of NVD's CPE analysis and usually ahead of it.
vitejs vite
- < 5.4.20, >= 6.0.0, < 6.3.6, >= 7.0.0, < 7.0.7, >= 7.1.0, < 7.1.5affected
Package-level exposure
OSV and GitHub Advisory data: ecosystem, package and range. SBOM matching uses this table.
| Ecosystem | Package | Affected range | Fix |
|---|---|---|---|
| npm | vite | from 6.0.0 · before 6.3.6 | 6.3.6 |
| npm | vite | from 7.0.0 · before 7.0.7 | 7.0.7 |
| npm | vite | from 7.1.0 · before 7.1.5 | 7.1.5 |
| npm | vite | before 5.4.20 | 5.4.20 |
Same product
vitejs: all recordsOther highest-scoring records for the same primary product.
- CVE-2025-31125Vite has a `server.fs.deny` bypassed for `inline` and `raw` with `?import` queryKEV80Now
- CVE-2025-30208Vite bypasses server.fs.deny when using `?raw??`52Plan
- CVE-2026-39363Vite Affected by Arbitrary File Read via Vite Dev Server WebSocket33Monitor
- CVE-2025-31486Vite allows server.fs.deny to be bypassed with .svg or relative paths33Monitor
- CVE-2026-53571Vite: `server.fs.deny` bypass on Windows alternate paths32Monitor
- CVE-2026-39364Vite has a `server.fs.deny` bypass with queries32Monitor
Remediation
Which version to upgrade to
Fix versions compiled from the vendor, package registries and Microsoft. Verify the vendor's note before upgrading.
| Product / package | Fixed version | Source |
|---|---|---|
| npm:vite | 5.4.20 | Package registry (OSV) |
| npm:vite | 6.3.6 | Package registry (OSV) |
| npm:vite | 7.0.7 | Package registry (OSV) |
| npm:vite | 7.1.5 | Package registry (OSV) |
Exploit status
Proof of concept available
A public proof of concept or detection signature exists. Exploit knowledge is out there; don't delay patching.
Evidence
- Nuclei detection template ×1
Noroxi does not host or link to exploit code. Metasploit module names and Nuclei template ids are shown (names, not code); Exploit-DB entries and PoC repositories are given as counts only.
| Source | Kind | Date |
|---|---|---|
| Nuclei detection template | Nuclei template CVE-2025-58751 | — |
Research context
For pentesters and researchers: attack profile, score disagreement, timeline, patch commits, credits, variant and chain candidates, bug bounty scope. All derived from existing data; no exploit code.
Timeline
From publication to today: proof of concept, Metasploit module, CISA KEV and fix record. Dates are as reported by the sources.
No dated events beyond publication.
FIRST EPSS daily score; only changes of 0.01 or more are recorded (step chart).
Patch and commit links
Commit, PR and diff links among the references. A starting point for patch-diffing and variant hunting; fixes, not exploits.
Credits
All researchersFinders, reporters and analysts named in the CNA record. Click a name for that researcher’s other records.
No credits in the CNA record.
Variant candidates
Same product, same weakness class, within 18 months. If the patch missed the root cause, the sibling bug is here.
- CVE-2026-53571287 days apartVite: `server.fs.deny` bypass on Windows alternate paths32Monitor
- CVE-2026-39365211 days apartVite has a Path Traversal in Optimized Deps `.map` Handling25Monitor
- CVE-2025-6252242 days apartvite allows server.fs.deny bypass via backslash on Windows24Monitor
- CVE-2025-46565130 days apartVite's server.fs.deny bypassed with /. for files under project root24Monitor
Chain candidates
An authentication bypass and a privilege-requiring bug in the same product, published close together: combined they may become an unauthenticated path.
—
Bug bounty scope
No known public program.
Source: bounty-targets-data (public HackerOne, Bugcrowd, Intigriti, YesWeHack listings).
Technical details
Attack conditions
- Anyone who can reach it over the internet can trigger it.
- No account or password is required.
- No special conditions are required; it is repeatable.
If successful
- Confidentiality
- Integrity
- Availability
- Attack vector
- Network
- Attack complexity
- Low
- Privileges required
- None
- User interaction
- P
- Scope
- X
Weakness class (CWE)
CWE-22 · Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')CVSS vector
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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
nvd-secondary
Root cause
A user-supplied file name is joined with the allowed directory, but the result is never checked to confirm it is still inside that directory.
The bug in code
The whole CWE-22 classA representative example of this vulnerability class. Not the vendor's source code; it shows the faulty pattern and its fix.
Vulnerable
const file = path.join(ROOT, req.query.name);res.sendFile(file);Fixed
const file = path.resolve(ROOT, req.query.name);if (!file.startsWith(ROOT + path.sep)) { return res.sendStatus(400);}res.sendFile(file);Attack context
MITRE CAPEC attack patterns and ATT&CK techniques for this weakness class (CWE). A starting point for detection rules and threat hunting.
Attack patterns (CAPEC)
- Path TraversalCAPEC-126likelihood: High · Very High
- Using Slashes and URL Encoding Combined to Bypass Validation LogicCAPEC-64likelihood: High · High
- Manipulating Web Input to File System CallsCAPEC-76likelihood: High · Very High
- Using Escaped Slashes in Alternate EncodingCAPEC-78likelihood: High · High
- Using Slashes in Alternate EncodingCAPEC-79likelihood: High · High
ATT&CK techniques
—
Change log
- Fix✗ → ✓
For records you follow, these changes also arrive as notifications. →
References
- github.com/lukeed/sirv/commit/f0113f3f8266328d804ee808f763a3c11f8997eb
- github.com/vitejs/vite/commit/09f2b52e8d5907f26602653caf41b3a56692600d
- github.com/vitejs/vite/commit/4f1c35bcbb5830290c694aa14b6789e07450f069
- github.com/vitejs/vite/commit/63e2a5d232218f3f8d852056751e609a5367aaec
- github.com/vitejs/vite/commit/e11d24008b97d4ca731ecc1a3b95260a6d12e7e0
Vendor advisories and official records. Exploit/PoC links are deliberately left out.