Summary
A path traversal issue in Vite's Windows development server allows access to files that should be blocked by server.fs.deny, including environment and certificate files.
By abusing NTFS alternate data streams and 8.3 short names, an attacker can bypass path normalization on Windows and retrieve sensitive file contents during development.
Affected context
This vulnerability appears in Vite-based projects when the dev server runs on Windows and relies on server.fs.deny to protect sensitive files.
It is most relevant in local or shared development environments where .env, certificate files, or other secrets are present in the project directory.
The risk increases when the dev server is reachable from untrusted networks or when developers load real credentials or private keys in .env and related files.
Exploit preconditions
- Attack surface: Vite dev server HTTP interface exposed on Windows hosts.
- Required access: Ability to send crafted HTTP requests to the dev server (e.g., via browser, network access, or SSR tooling).
- Trigger point: Requests targeting paths that use NTFS alternate data streams (e.g.,
::$DATA) or 8.3 short filenames to reference denied files. - Why exploitation is possible: The deny logic checks paths before normalizing Windows-specific forms, so NTFS ADS syntax and short names bypass the intended filters and are resolved by Windows to the underlying sensitive files.
Why this happens
The root cause is a mismatch between Vite's path filtering logic and Windows filesystem semantics.
The dev server implements access controls based on literal path patterns (server.fs.deny) but does not normalize or canonicalize NTFS alternate data stream paths and 8.3 short names before applying these checks.
This aligns with CWE-22: Improper Limitation of a Path to a Restricted Directory and CWE-200: Exposure of Sensitive Information to an Unauthorized Actor, where controls assume a simpler path model than the operating system actually provides.
Potential impact
- Access to
.envfiles that may contain API keys, database credentials, and other secrets. - Disclosure of TLS certificate and private key material in files like
*.crtand*.pem. - Leakage of configuration files that reveal internal service endpoints or debugging flags.
- Facilitation of further attacks (account takeover, lateral movement, or environment cloning) using exposed secrets.
General mitigation guidance
Effective mitigation focuses on ensuring that path-based access controls operate on canonical, fully normalized paths and do not rely on user-supplied path strings directly.
Common defensive patterns include:
- Normalizing and resolving all requested paths to absolute, canonical filesystem paths before applying deny/allow checks, including platform-specific forms such as NTFS ADS and 8.3 names.
- Implementing allowlists rooted in a fixed content directory rather than relying solely on denylists for sensitive filenames.
- Avoiding storage of real secrets in project directories used by dev servers; use environment-level secret management instead of
.envfiles where feasible. - Treating development servers as untrusted boundaries, running them on loopback interfaces by default and restricting external visibility.
- Applying the principle of least privilege to filesystem access logic, ensuring the server cannot read beyond explicitly permitted directories.
How teams detect issues like this
Detection often involves a mix of code-level and operational checks:
- Static analysis or manual code review of filesystem access modules to confirm that path normalization precedes any deny/allow filtering and that platform-specific path variants are handled.
- Security testing and fuzzing of dev server endpoints using crafted paths (ADS syntax, 8.3 names, relative traversals) to verify that sensitive files are consistently blocked.
- Policy-based checks in CI/CD that disallow reading
.envand certificate files through development tooling, or flag patterns where dev servers can access secret-bearing directories. - Use of automated review tools that highlight reliance on denylist-based filename filters, prompting a shift toward canonical path comparison and directory-based allowlists.

