CVE-2025-58751
JavaScript vulnerability analysis and mitigation

Overview

CVE-2025-58751 affects Vite, a frontend tooling framework for JavaScript. The vulnerability was discovered on September 8, 2025, and affects versions prior to 7.1.5, 7.0.7, 6.3.6, and 5.4.20. The issue allows files starting with the same name as the public directory to be served bypassing the server.fs settings (GitHub Advisory, NVD).

Technical details

The vulnerability stems from a path traversal issue in Vite's static file serving logic. When the public directory feature is enabled and contains a symlink, the servePublicMiddleware function may incorrectly handle path normalization, allowing access to files outside the intended directory. The issue occurs because sirv (the underlying library) trims trailing slashes from the public directory path, which can cause the startsWith function to return true for paths that should be restricted. The vulnerability has a CVSS v4.0 Base Score of 2.3 (Low) with vector string 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 (GitHub Advisory).

Impact

The vulnerability can lead to unauthorized access to files outside the intended public directory. This could potentially expose sensitive information if an attacker crafts specific paths with '../' sequences to traverse the directory structure. However, the impact is limited as it requires specific conditions to be exploitable: the Vite dev server must be exposed to the network, the public directory feature must be enabled, and a symlink must exist in the public directory (Red Hat).

Mitigation and workarounds

The vulnerability has been fixed in Vite versions 7.1.5, 7.0.7, 6.3.6, and 5.4.20. Users should upgrade to these or later versions. For those unable to upgrade immediately, recommended mitigations include: 1) Avoid exposing the Vite dev server (--host / server.host) to untrusted networks, and 2) Do not allow symlinks inside the public directory that reference files outside of it (GitHub Advisory).

Additional resources


SourceThis report was generated using AI

Related JavaScript vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2025-69264HIGH8.8
  • JavaScriptJavaScript
  • pnpm
NoYesJan 07, 2026
CVE-2025-69262HIGH7.5
  • JavaScriptJavaScript
  • pnpm
NoYesJan 07, 2026
CVE-2025-69263HIGH7.5
  • JavaScriptJavaScript
  • pnpm
NoYesJan 07, 2026
CVE-2026-22028HIGH7.2
  • JavaScriptJavaScript
  • preact
NoYesJan 07, 2026
CVE-2025-9611HIGH7.2
  • JavaScriptJavaScript
  • @playwright/mcp
NoYesJan 07, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management