{"id":"CVE-2025-58751","published":"2025-09-08T22:52:45Z","modified":"2025-09-09T13:29:36Z","title":"Vite middleware may serve files starting with the same name with the public directory","vendor":"vitejs","product":"vite","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":2.3,"severity":"LOW","version":"4.0","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","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.01263,"percentile":0.70404,"provenance":"source"},"cwes":[{"id":"CWE-22","name":"Improper Limitation of a Pathname to a Restricted Directory"},{"id":"CWE-200","name":"Exposure of Sensitive Information to an Unauthorized Actor"},{"id":"CWE-284","name":"Improper Access Control"}],"references":[{"url":"https://github.com/vitejs/vite/security/advisories/GHSA-g4jq-h2w9-997c","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/lukeed/sirv/commit/f0113f3f8266328d804ee808f763a3c11f8997eb","tags":["x_refsource_MISC"]},{"url":"https://github.com/vitejs/vite/commit/09f2b52e8d5907f26602653caf41b3a56692600d","tags":["x_refsource_MISC"]},{"url":"https://github.com/vitejs/vite/commit/4f1c35bcbb5830290c694aa14b6789e07450f069","tags":["x_refsource_MISC"]},{"url":"https://github.com/vitejs/vite/commit/63e2a5d232218f3f8d852056751e609a5367aaec","tags":["x_refsource_MISC"]},{"url":"https://github.com/vitejs/vite/commit/e11d24008b97d4ca731ecc1a3b95260a6d12e7e0","tags":["x_refsource_MISC"]}],"priority":{"score":20.7,"factors":[{"name":"EPSS percentile","points":14.08},{"name":"Public exploit code","points":5.0},{"name":"CVSS severity","points":1.61}]},"exploitSources":{"nuclei":[{"id":"CVE-2025-58751","name":"Vite Dev Server - Path Traversal","severity":"low","path":"http/cves/2025/CVE-2025-58751.yaml","url":"https://github.com/projectdiscovery/nuclei-templates/blob/main/http/cves/2025/CVE-2025-58751.yaml"}],"provenance":"source"},"vendorSlug":"vitejs","affectedVersions":[{"vendor":"vitejs","product":"vite","versions":["< 5.4.20",">= 6.0.0, < 6.3.6",">= 7.0.0, < 7.0.7",">= 7.1.0, < 7.1.5"]}],"ssvc":{"exploitation":"poc","automatable":"no","technicalImpact":"partial","timestamp":"2025-09-09T13:14:11.634879Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"npm","package":"vite","vulnerableRanges":[">=7.1.0, <7.1.5",">=7.0.0, <7.0.7",">=6.0.0, <6.3.6","<5.4.20"],"patched":["7.1.5","7.0.7","6.3.6","5.4.20"],"from":["GHSA-g4jq-h2w9-997c"],"provenance":"source"}],"summary":{"text":"A path-handling flaw in Vite's dev server middleware lets files whose names begin with the same name as an entry in the public directory be served while bypassing the server.fs restrictions. The attack requires the dev server to be exposed to the network (via --host or server.host), the public directory feature (on by default), and a symlink present in the public directory, and it also needs user interaction, since the attacker must get a victim to load the affected resource.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T21:37:42Z"},"euvd":{"id":"EUVD-2025-27181","exploited":false,"provenance":"source"},"lineage":{"packageHistory":[{"cve":"CVE-2025-32395","published":"2025-04-10","fixed":"6.2.6","kev":false},{"cve":"CVE-2025-46565","published":"2025-05-01","fixed":"6.3.4","kev":false,"link":{"from":"CVE-2025-46565","to":"CVE-2025-58751","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"npm:vite","fromFixed":"6.3.4","toFixed":"6.3.6","daysApart":130},{"kind":"version-step","provenance":"source","package":"npm:vite","fromFixed":"5.4.19","toFixed":"5.4.20","daysApart":130}]}},{"cve":"CVE-2026-118662","published":"2026-10-28","fixed":"6.4.5","kev":false},{"cve":"CVE-2025-58751","published":"2025-09-08","fixed":"7.1.5","kev":false},{"cve":"CVE-2025-58752","published":"2025-09-08","fixed":"7.1.5","kev":false},{"cve":"CVE-2025-62522","published":"2025-10-20","fixed":"7.1.11","kev":false},{"cve":"CVE-2026-39363","published":"2026-04-07","fixed":"8.0.5","kev":false}],"package":"npm:vite"}}