A vulnerability in Vite versions 8.2.0 up to but not including 8.3.3 allows an attacker to retrieve the first 4 bytes of files outside the configured server.fs directory by sending a request with the ?vite-wasm-instance query. This occurs because the internal Wasm plugin's load hook reads files without applying server.fs restrictions and exposes the first 4 bytes in error messages when WebAssembly parsing fails. The issue affects setups where the Vite dev server is exposed to the network and is run using Node.js or Deno. A fix is available in version 8.3.3.
A vulnerability in Vite versions from 2.5.1 up to but not including 8.3.3 allows files outside the configured server.fs.allow paths to be served by the development server on non-Windows systems. This occurs when a project imports a file path that matches an absolute path on the host system, potentially exposing sensitive host files to the browser if the dev server is exposed to the network.
CVE-2026-112945 is a low-severity vulnerability in Vite development server versions from 2.5.1 up to but not including 8.3.3. It allows a malicious site to execute cross-origin scripts in a page served by the Vite dev server when certain middleware configurations are used. The issue arises when the dev server passes an unchanged browser request URL to the transformIndexHtml function, enabling an attacker to inject a crafted script URL that the browser executes in the context of the Vite page. This affects setups using middlewareMode: true or appType: 'custom' with inline module scripts that store sensitive data or allow critical actions. The vulnerability is fixed in Vite 8.3.3.
The launch-editor package improperly forwards file paths directly to editors without sanitization, allowing file paths starting with CLI flags like '+' or '-' to be interpreted as commands by editors such as Vim, MacVim, Emacs, and Notepad++ (with certain plugins). This can lead to unintended command execution or file overwrites when an attacker can create such specially named files or directories in the working directory. The vulnerability affects certain versions of Vite (>=2.5.1 <8.3.3) and is mitigated in launch-editor-middleware v2.2.0+ except when used on WSL, where relative paths are still used internally. A fix is available in Vite 8.3.3.
The launch-editor NPM package on Windows allows access to arbitrary paths including UNC paths. When a UNC path is accessed, Windows automatically attempts NTLM authentication to the remote SMB server, causing the user's NTLMv2 password hash to be leaked to an attacker-controlled server. This can lead to credential compromise if the hash is cracked offline. The vulnerability affects versions of vite using launch-editor from 2.5.1 up to but not including 8.0.16. A fix is available in version 8.0.16.
A vulnerability in Vite's development server on Windows allows bypassing the server.fs.deny file access restrictions via Windows alternate data streams and 8.3 short name paths. This can expose sensitive files such as .env and certificate files to browsers when the dev server is exposed to the network and certain conditions about file location and filesystem features are met. The issue is fixed in Vite version 8.0.16.
A vulnerability in Vite dev server allows bypassing the server.fs.deny file access restrictions by appending certain query parameters to requests. This can expose sensitive files such as .env or certificate files to the browser if the server is explicitly exposed to the network and the files reside in allowed directories. The issue affects Vite versions from 7.1.0 up to but not including 8.0.5 and has a high severity CVSS score of 8.2.
Vite versions from 6.0.0 up to but not including 8.0.5 contain a vulnerability in the dev server's WebSocket interface that allows arbitrary file read. This occurs because the server.fs check is not enforced on the fetchModule method accessible via WebSocket, enabling an attacker to retrieve arbitrary files if the dev server is exposed to the network and WebSocket is enabled. The vulnerability is fixed in version 8.0.5.
Vite versions from 3.0.0 up to but not including 7.1.11 have a vulnerability where files denied by the server.fs.deny configuration can be accessed if the URL ends with a backslash (\) on Windows. This affects development servers explicitly exposed to the network and running on Windows. The issue arises because fs.readFile treats a path with a trailing backslash as the file without it, bypassing deny patterns. A fix is available in version 7.1.11.
Vite versions from 2.5.1 up to but not including 7.1.5 have a vulnerability where the server.fs configuration settings are not applied to HTML files. This allows HTML files outside the allowed directories to be served by the development and preview servers if the server is exposed to the network. The issue arises because certain middleware serving HTML files bypass the file system access restrictions. This can lead to unauthorized disclosure of HTML files on the host machine.
Vite middleware serving files from the public directory may incorrectly serve files outside the intended directory when symbolic links exist in the public directory and the server is exposed to the network. This occurs due to a path normalization and prefix check flaw in the middleware, allowing path traversal to access files outside the public directory despite deny rules. The issue affects Vite versions from 2.5.1 up to but not including 7.1.5 and has a low severity rating.
Vite's launch-editor package on Windows is vulnerable to command injection due to insufficient sanitization of the file argument. An attacker who can control the filename and invoke the launchEditor method may execute arbitrary commands. This affects versions from 2.5.1 up to but not including 5.4.9. The issue has been fixed in version 5.4.9.
Vite versions from 2.5.1 up to but not including 8.0.5 have a path traversal vulnerability in the dev server's handling of optimized dependency source map (.map) files. This flaw allows an attacker to retrieve .map files located outside the project root by exploiting insufficient path sanitization, bypassing the server's filesystem strict allow list. The vulnerability only affects applications that expose the Vite dev server to the network and have sensitive .map files with predictable paths. A fix is available in version 8.0.5.
A directory traversal bypass vulnerability in Vite's dev server allows reading files under the project root that should be denied by server.fs.deny patterns. This affects Vite versions from 2.5.1 up to but not including 6.3.4. The issue occurs when the deny patterns are circumvented using a '/.' sequence in the request path. Only applications exposing the Vite dev server to the network are impacted. A fix is available in version 6.3.4.
A vulnerability in Vite versions from 2.5.1 up to but not including 6.2.4 allows an attacker to read arbitrary files on the server by bypassing the server.fs.deny restriction using crafted query parameters (?inline&import or ?raw?import). This issue affects only development servers explicitly exposed to the network via the --host option or server.host configuration. The vulnerability can leak base64-encoded file contents to the browser without requiring the /@fs/ prefix for files inside the project root. A fix is available in version 6.2.4.
The Vite development server option `server.fs.deny` can be bypassed on case-insensitive filesystems, such as Windows, by using case-augmented filenames. This allows an attacker to access files that are intended to be blocked by the deny list. The issue arises because the underlying glob matching is case-sensitive, while the filesystem is not, enabling blacklist bypass. This vulnerability affects Vite versions from 2.7.0 up to but not including 5.0.12 and has been fixed in 5.0.12 and earlier patch releases of prior major versions.
Vite's development server option `server.fs.deny` did not properly deny requests for patterns that include directories, such as `/foo/**/*`. This issue affects applications that customize `server.fs.deny` with directory patterns and expose the Vite dev server to the network. The vulnerability arises from the use of picomatch with the `matchBase: true` option, which only matches basenames and not full paths, allowing unauthorized access to files under denied directories like `.git`. This flaw was fixed in multiple Vite versions starting with 2.9.18, 3.2.10, 4.5.3, 5.0.13, 5.1.7, and 5.2.6.
Vite versions from 2.5.1 up to but not including 5.4.6 contain a vulnerability where the server's file system access restrictions can be bypassed using the '?import&raw' query parameters. This allows an attacker to retrieve the contents of arbitrary files outside the intended serving allow list. The vulnerability has a medium severity with a CVSS score of 5.3.
A DOM Clobbering vulnerability in Vite affects bundled scripts built with output formats cjs, iife, or umd. This flaw allows an attacker to manipulate the document.currentScript property by injecting a scriptless HTML element named 'currentScript', causing the application to load attacker-controlled scripts dynamically. This can lead to cross-site scripting (XSS) in web pages that include vulnerable Vite bundles and allow embedding of such HTML elements. The vulnerability impacts Vite versions from 2.5.1 up to but not including 5.4.6. A fix is available.
Vite development server versions from 2.5.1 up to but not including 6.0.9 have a vulnerability that allows any website to send requests to the dev server and read responses due to permissive default CORS settings and lack of Origin header validation on WebSocket connections. This affects even local-only dev servers. The vulnerability can expose sensitive development files to malicious websites. A fix is available in newer Vite versions. Mitigations include configuring CORS origins, allowed hosts, and using HTTPS or updated browsers. Some mitigations are not possible without upgrading.