Security changelog
Vite has 28 published advisories, 7 high or critical.
When a framework publishes a security advisory, this page tracks the details teams need for patch triage: affected ranges, fixed versions, CVEs, workarounds, severity, and the original advisory. Feature releases and routine changelog noise stay out.
-
Cross origin script execution through Vite custom middleware
Summary
When accessing a malicious site while a dev server using Vite is running, that site was able to load scripts in a page served by the dev server.
Impact
Only apps that match the following conditions are affected:
- the dev server passes an unchanged browser request URL to
server.transformIndexHtml: this is normally used forserver.middlewareMode: trueorappType: 'custom'. The internal call forappType: 'spa'andappType: 'mpa'does not match this.
- >= 8.3.0, <= 8.3.2
- >= 8.2.0, <= 8.2.3
- >= 8.0.0, <= 8.1.5
- >= 7.0.0, <= 7.3.6
- <= 6.4.3
Low Fixed in 6.4.4, 7.3.7, 8.1.6, 8.2.4, 8.3.3
- the dev server passes an unchanged browser request URL to
-
Files outside
server.fs.allowcould be served when project paths match system paths on non-Windows machineSummary
The content of files outside
server.fssetting can be returned to the browser if the project imports a file path concatenated with theroot. For example, if the project references<path-to-project-root>/etc/hosts, the content of/etc/hostswas possible to be returned.The content of files outside the
server.fs.allowoption can be returned to the browser when a project imports a file whose root-relative path matches an absolute path on the host.- >= 8.3.0, <= 8.3.2
- >= 8.2.0, <= 8.2.3
- >= 8.0.0, <= 8.1.5
- >= 7.0.0, <= 7.3.6
- <= 6.4.3
Medium Fixed in 6.4.4, 7.3.7, 8.1.6, 8.2.4, 8.3.3
-
First 4 bytes of files outside of
server.fssetting is exposed by?vite-wasm-instanceSummary
The first 4 bytes of files outside of
server.fssetting can be returned to the browser by a request containing?vite-wasm-instance.Impact
Only apps that match one of the following conditions are affected:
- explicitly expose the Vite dev server to the network using
--hostor theserver.hostoption - there’s a file that has a sensitive information in the first 4 bytes
- >= 8.3.0, <= 8.3.2
- >= 8.2.0, <= 8.2.3
Medium Fixed in 8.2.4, 8.3.3
- explicitly expose the Vite dev server to the network using
-
launch-editor:
fs.existsSync()existence check can be bypassed on WindowsSummary
launch-editorcheckedfs.existsSync(fileName)before passing a supplied path to an editor command. On Windows, an attacker can bypass this check with a crafted path ending in\\..:line:column. This removes the requirement that the attacker be able to place a file with a malicious filename.- >= 8.3.0, <= 8.3.2
- >= 8.2.0, <= 8.2.3
- >= 8.0.0, <= 8.1.5
- >= 7.0.0, <= 7.3.6
- <= 6.4.3
High Fixed in 6.4.4, 7.3.7, 8.1.6, 8.2.4, 8.3.3
-
launch-editor: Editor CLI flag misinterpretation causing arbitrary command execution for some editors
Summary
launch-editorforwarded file paths directly to editors without sanitization. If a path resembles a CLI flag, editors like Vim may interpret it as a command, potentially causing unintended file overwrites or command execution.Impact
Direct
launch-editorusersOnly apps that match all of the following conditions are affected:
- The attacker is able to create a file system entry (e.g. a file or directory) starting with
+or-in the working directory
- >= 8.3.0, <= 8.3.2
- >= 8.2.0, <= 8.2.3
- >= 8.0.0, <= 8.1.5
- >= 7.0.0, <= 7.3.6
- <= 6.4.3
Medium Fixed in 6.4.4, 7.3.7, 8.1.6, 8.2.4, 8.3.3
- The attacker is able to create a file system entry (e.g. a file or directory) starting with
-
launch-editor: escapeCmdArgs() omits % escaping on Windows
Summary
launch-editordid not escape%on Windows when passing an argument tocmd. When an environment variable contained a malicious value, it was possible that that content to be executed.Impact
Only apps that match all of the following conditions are affected:
- The user uses Windows
- An attacker can place a file with the malicious filename containing
&or% - Either of
- An attacker can inject an environment variable with a malicious value
- >= 8.3.0, <= 8.3.2
- >= 8.2.0, <= 8.2.3
- >= 8.0.0, <= 8.1.5
- >= 7.0.0, <= 7.3.6
- <= 6.4.3
Medium Fixed in 6.4.4, 7.3.7, 8.1.6, 8.2.4, 8.3.3
-
launch-editor: NTLMv2 hash disclosure via UNC path handling on Windows
Summary
The
launch-editorNPM package accesses arbitrary paths including Windows UNC paths. When a UNC path is opened, Windows automatically attempts NTLM authentication to the remote host, causing the user’s NTLMv2 password hash to be leaked to an attacker-controlled SMB server. This can result in credential compromise through offline hash cracking.- >= 8.0.0, <= 8.0.15
- >= 7.0.0, <= 7.3.4
- <= 6.4.2
Medium Fixed in 6.4.3, 7.3.5, 8.0.16
-
server.fs.denybypass on Windows alternate pathsSummary
The contents of files that are specified by
server.fs.denycan be returned to the browser on Windows.Impact
Only apps that match the following conditions are affected:
- explicitly exposes the Vite dev server to the network (using
--hostorserver.hostconfig option)
- >= 8.0.0, <= 8.0.15
- >= 7.0.0, <= 7.3.4
- <= 6.4.2
Medium Fixed in 6.4.3, 7.3.5, 8.0.16
- explicitly exposes the Vite dev server to the network (using
-
launch-editor vulnerable to command injection via the crafted request on Windows
Summary
Due to the insufficient sanitization of the
fileargument in thelaunchEditor, an attacker can execute arbitrary commands on Windows by supplying a filename that contains special characters.Impact
If the following conditions are met, an attacker can execute arbitrary commands on the computer that is using the
launch-editor:- An attacker can place a file with the malicious filename
- An attacker can call the
launchEditormethod with thefileargument controlled
- <= 5.4.8
High Fixed in 5.4.9
-
Vite Vulnerable to Arbitrary File Read via Vite Dev Server WebSocket
Summary
server.fscheck was not enforced to thefetchModulemethod that is exposed in Vite dev server’s WebSocket.Impact
Only apps that match the following conditions are affected:
- explicitly exposes the Vite dev server to the network (using
--hostorserver.hostconfig option) - WebSocket is not disabled by
server.ws: false
- >= 8.0.0, <= 8.0.4
- >= 7.0.0, <= 7.3.1
- >= 6.0.0, <= 6.4.1
High Fixed in 6.4.2, 7.3.2, 8.0.5
- explicitly exposes the Vite dev server to the network (using
-
Vite Vulnerable to Path Traversal in Optimized Deps
.mapHandlingSummary
Any files ending with
.mapeven out side the project can be returned to the browser.Impact
Only apps that match the following conditions are affected:
- explicitly exposes the Vite dev server to the network (using
--hostorserver.hostconfig option) - have a sensitive content in files ending with
.mapand the path is predictable
- >= 8.0.0, <= 8.0.4
- >= 7.0.0, <= 7.3.1
- <= 6.4.1
Medium Fixed in 6.4.2, 7.3.2, 8.0.5
- explicitly exposes the Vite dev server to the network (using
-
server.fs.denybypassed with queriesSummary
The contents of files that are specified by
server.fs.denycan be returned to the browser.Impact
Only apps that match the following conditions are affected:
- explicitly exposes the Vite dev server to the network (using
--hostorserver.hostconfig option)
- >= 8.0.0, <= 8.0.4
- >= 7.1.0, <= 7.3.1
High Fixed in 7.3.2, 8.0.5
- explicitly exposes the Vite dev server to the network (using
-
vite allows server.fs.deny bypass via backslash on Windows
Summary
Files denied by
server.fs.denywere sent if the URL ended with\when the dev server is running on Windows.Impact
Only apps that match the following conditions are affected:
- explicitly exposes the Vite dev server to the network (using --host or
server.hostconfig option) - running the dev server on Windows
- >= 7.1.0, <= 7.1.10
- >= 7.0.0, <= 7.0.7
- >= 6.0.0, <= 6.4.0
- >= 2.9.18, < 3.0.0
- >= 3.2.9, < 4.0.0
- >= 4.5.3, < 5.0.0
- >= 5.2.6, <= 5.4.20
Medium Fixed in 5.4.21, 5.4.21, 5.4.21, 5.4.21, 6.4.1, 7.0.8, 7.1.11
- explicitly exposes the Vite dev server to the network (using --host or
-
Vite middleware may serve files starting with the same name with the public directory
Summary
Files starting with the same name with the public directory were served bypassing the
server.fssettings.Impact
Only apps that match the following conditions are affected:
- explicitly exposes the Vite dev server to the network (using --host or
server.hostconfig option) - uses the public directory feature (enabled by default)
- a symlink exists in the public directory
- >= 7.1.0, <= 7.1.4
- >= 7.0.0, <= 7.0.6
- >= 6.0.0, <= 6.3.5
- <= 5.4.19
Low Fixed in 5.4.20, 6.3.6, 7.0.7, 7.1.5
- explicitly exposes the Vite dev server to the network (using --host or
-
Vite’s
server.fssettings were not applied to HTML filesSummary
Any HTML files on the machine were served regardless of the
server.fssettings.Impact
Only apps that match the following conditions are affected:
- explicitly exposes the Vite dev server to the network (using --host or server.host config option)
appType: 'spa'(default) orappType: 'mpa'is used
This vulnerability also affects the preview server.
- >= 7.1.0, <= 7.1.4
- >= 7.0.0, <= 7.0.6
- >= 6.0.0, <= 6.3.5
- <= 5.4.19
Low Fixed in 5.4.20, 6.3.6, 7.0.7, 7.1.5
-
Vite’s server.fs.deny bypassed with /. for files under project root
Summary
The contents of files in the project
rootthat are denied by a file matching pattern can be returned to the browser.Impact
Only apps explicitly exposing the Vite dev server to the network (using --host or server.host config option) are affected.
- >= 6.3.0, <= 6.3.3
- >= 6.2.0, <= 6.2.6
- >= 6.0.0, <= 6.1.5
- >= 5.0.0, <= 5.4.18
- <= 4.5.13
Medium Fixed in 4.5.14, 5.4.19, 6.1.6, 6.2.7, 6.3.4
-
Vite has an
server.fs.denybypass with an invalidrequest-targetSummary
The contents of arbitrary files can be returned to the browser if the dev server is running on Node or Bun.
Impact
Only apps with the following conditions are affected.
- explicitly exposing the Vite dev server to the network (using --host or server.host config option)
- running the Vite dev server on runtimes that are not Deno (e.g. Node, Bun)
- >= 6.2.0, < 6.2.6
- >= 6.1.0, < 6.1.5
- >= 6.0.0, < 6.0.15
- >= 5.0.0, < 5.4.18
- < 4.5.13
Medium Fixed in 4.5.13, 5.4.18, 6.0.15, 6.1.5, 6.2.6
-
Vite allows server.fs.deny to be bypassed with .svg or relative paths
Summary
The contents of arbitrary files can be returned to the browser.
Impact
Only apps explicitly exposing the Vite dev server to the network (using --host or server.host config option) are affected.
Details
.svgRequests ending with
.svgare loaded at this line. https://github.com/vitejs/vite/blob/037f801075ec35bb6e52145d659f71a23813c48f/packages/vite/src/node/plugins/asset.ts#L285-L290- >= 6.2.0, < 6.2.5
- >= 6.1.0, < 6.1.4
- >= 6.0.0, < 6.0.14
- >= 5.0.0, < 5.4.17
- < 4.5.12
Medium Fixed in 4.5.12, 5.4.17, 6.0.14, 6.1.4, 6.2.5
-
Vite has a
server.fs.denybypassed forinlineandrawwith?importquerySummary
The contents of arbitrary files can be returned to the browser.
Impact
Only apps explicitly exposing the Vite dev server to the network (using
--hostorserver.hostconfig option) are affected.Details
- base64 encoded content of non-allowed files is exposed using
?inline&import(originally reported as?import&?inline=1.wasm?init) - content of non-allowed files is exposed using
?raw?import
- >= 6.2.0, < 6.2.4
- >= 6.1.0, < 6.1.3
- >= 6.0.0, < 6.0.13
- >= 5.0.0, < 5.4.16
- < 4.5.11
Medium Fixed in 4.5.11, 5.4.16, 6.0.13, 6.1.3, 6.2.4
- base64 encoded content of non-allowed files is exposed using
-
Vite bypasses server.fs.deny when using ?raw??
Summary
The contents of arbitrary files can be returned to the browser.
Impact
Only apps explicitly exposing the Vite dev server to the network (using
--hostorserver.hostconfig option) are affected.Details
@fsdenies access to files outside of Vite serving allow list. Adding?raw??or?import&raw??to the URL bypasses this limitation and returns the file content if it exists.- >= 6.2.0, < 6.2.3
- >= 6.1.0, < 6.1.2
- >= 6.0.0, < 6.0.12
- >= 5.0.0, < 5.4.15
- < 4.5.10
Medium Fixed in 4.5.10, 5.4.15, 6.0.12, 6.1.2, 6.2.3
-
Websites were able to send any requests to the development server and read the response in vite
Summary
Vite allowed any websites to send any requests to the development server and read the response due to default CORS settings and lack of validation on the Origin header for WebSocket connections.
[!WARNING] This vulnerability even applies to users that only run the Vite dev server on the local machine and does not expose the dev server to the network.
- >= 6.0.0, <= 6.0.8
- >= 5.0.0, <= 5.4.11
- <= 4.5.5
Medium Fixed in 4.5.6, 5.4.12, 6.0.9
-
Vite DOM Clobbering gadget found in vite bundled scripts that leads to XSS
Summary
We discovered a DOM Clobbering vulnerability in Vite when building scripts to
cjs/iife/umdoutput format. The DOM Clobbering gadget in the module can lead to cross-site scripting (XSS) in web pages where scriptless attacker-controlled HTML elements (e.g., an img tag with an unsanitized name attribute) are present.Note that, we have identified similar security issues in Webpack: https://github.com/webpack/webpack/security/advisories/GHSA-4vvj-4cpr-p986
Details
Backgrounds
- >= 4.0.0, < 4.5.4
- >= 5.4.0, < 5.4.6
- >= 5.3.0, < 5.3.6
- >= 5.2.0, < 5.2.14
- < 3.2.11
- >= 5.0.0, < 5.1.8
Medium Fixed in 3.2.11, 4.5.4, 5.1.8, 5.2.14, 5.3.6, 5.4.6
-
Vite’s
server.fs.denyis bypassed when using?import&rawSummary
The contents of arbitrary files can be returned to the browser.
Details
@fsdenies access to files outside of Vite serving allow list. Adding?import&rawto the URL bypasses this limitation and returns the file content if it exists.- >= 5.4.0, <= 5.4.5
- >= 5.3.0, <= 5.3.5
- >= 4.0.0, <= 4.5.3
- <= 3.2.10
- >= 5.2.0, < 5.2.14
- >= 5.0.0, <= 5.1.7
Medium Fixed in 3.2.11, 4.5.4, 5.1.8, 5.2.14, 5.3.6, 5.4.6
-
Vite’s
server.fs.denydid not deny requests for patterns with directories.Summary
Vite dev server option
server.fs.denydid not deny requests for patterns with directories. An example of such a pattern is/foo/**/*.Impact
Only apps setting a custom
server.fs.denythat includes a pattern with directories, and explicitly exposing the Vite dev server to the network (using--hostorserver.hostconfig option) are affected.- >= 2.7.0, <= 2.9.17
- >= 3.0.0, <= 3.2.8
- >= 4.0.0, <= 4.5.2
- >= 5.0.0, <= 5.0.12
- >= 5.1.0, <= 5.1.6
- >= 5.2.0, <= 5.2.5
Medium Fixed in 2.9.18, 3.2.10, 4.5.3, 5.0.13, 5.1.7, 5.2.6
-
Vite dev server option
server.fs.denycan be bypassed when hosted on case-insensitive filesystemSummary
Vite dev server option
server.fs.denycan be bypassed on case-insensitive file systems using case-augmented versions of filenames. Notably this affects servers hosted on Windows.This bypass is similar to https://nvd.nist.gov/vuln/detail/CVE-2023-34092 -- with surface area reduced to hosts having case-insensitive filesystems.
Patches
Fixed in vite@5.0.12, vite@4.5.2, vite@3.2.8, vite@2.9.17
- >= 2.7.0, <= 2.9.16
- >= 3.0.0, <= 3.2.7
- >= 4.0.0, <= 4.5.1
- >= 5.0.0, <= 5.0.11
High Fixed in 2.9.17, 3.2.8, 4.5.2, 5.0.12
-
Vite XSS vulnerability in
server.transformIndexHtmlvia URL payloadSummary
When Vite’s HTML transformation is invoked manually via
server.transformIndexHtml, the original request URL is passed in unmodified, and thehtmlbeing transformed contains inline module scripts (<script type="module">...</script>), it is possible to inject arbitrary HTML into the transformed output by supplying a malicious URL query string toserver.transformIndexHtml.Impact
Only apps using
appType: 'custom'and using the default Vite HTML middleware are affected.- >= 4.4.0, < 4.4.12
- = 4.5.0
- >= 5.0.0, < 5.0.5
Medium Fixed in 4.4.12, 4.5.1, 5.0.5
-
Vite Server Options (server.fs.deny) can be bypassed using double forward-slash (//)
The issue involves a security vulnerability in Vite where the server options can be bypassed using a double forward slash (
//). This vulnerability poses a potential security risk as it can allow unauthorized access to sensitive directories and files.- < 2.9.16
- >= 3.0.2, < 3.2.7
- >= 4.0.0, < 4.0.5
- >= 4.1.0, < 4.1.5
- >= 4.2.0, < 4.2.3
- >= 4.3.0, < 4.3.9
High Fixed in 2.9.16, 3.2.7, 4.0.5, 4.1.5, 4.2.3, 4.3.9
-
Vite before v2.9.13 vulnerable to directory traversal via crafted URL to victim’s service
Vite before v2.9.13 was discovered to allow attackers to perform a directory traversal via a crafted URL to the victim’s service.
- < 2.9.13
- >= 3.0.0-alpha.0, < 3.0.0-beta.4
High Fixed in 2.9.13, 3.0.0-beta.4