vite@8.2.2

Native-ESM powered web dev build tool

  • latest version

    8.3.8

  • latest non vulnerable version

  • first published

    6 years ago

  • latest version published

    3 days ago

  • licenses detected

  • Direct Vulnerabilities

    Known vulnerabilities in the vite package. This does not include vulnerabilities belonging to this package’s dependencies.

    Fix vulnerabilities automatically

    Snyk's AI Trust Platform automatically finds the best upgrade path and integrates with your development workflows. Secure your code at zero cost.

    Fix for free
    VulnerabilityVulnerable Version
    • L
    Cross-site Scripting (XSS)

    vite is a Native-ESM powered web dev build tool

    Affected versions of this package are vulnerable to Cross-site Scripting (XSS) via the getHtmlFilename function in packages/vite/src/node/server/middlewares/indexHtml.ts, where query strings are not stripped from the URL before the filename is constructed and passed to transformIndexHtml. An attacker who can influence the URL of an HTML request can supply a URL containing query parameters or a protocol-relative path (starting with //), causing the filename passed to transform hooks to be incorrect and potentially allowing unintended resource resolution or URL manipulation in generated script and link tags.

    How to fix Cross-site Scripting (XSS)?

    Upgrade vite to version 8.3.3, 8.2.4, 8.1.6, 7.3.7, 6.4.4 or higher.

    >=8.3.0 <8.3.3>=8.2.0 <8.2.4>=8.0.0 <8.1.6>=7.0.0 <7.3.7<6.4.4
    • M
    Directory Traversal

    vite is a Native-ESM powered web dev build tool

    Affected versions of this package are vulnerable to Directory Traversal via the isServerAccessDeniedForTransform function in packages/vite/src/node/server/middlewares/transform.ts, which fails to check the ?vite-wasm-instance query parameter against the fs.serve allowlist. An attacker can append ?vite-wasm-instance to a request URL to bypass filesystem access controls and read files outside the configured allowed directories, including sensitive files such as .env.

    How to fix Directory Traversal?

    Upgrade vite to version 8.3.3, 8.2.4 or higher.

    >=8.3.0 <8.3.3>=8.2.0 <8.2.4
    • M
    Directory Traversal

    vite is a Native-ESM powered web dev build tool

    Affected versions of this package are vulnerable to Directory Traversal via the importAnalysisPlugin in packages/vite/src/node/plugins/importAnalysis.ts, where resolved module IDs are registered into safeModulePaths using the URL form (via fsPathFromUrl(stripBase(url, base))) rather than the cleaned filesystem path. A Vite plugin can return a resolveId result whose path, when processed through URL-to-path conversion, maps to a file outside the intended safe module set, causing that file to be incorrectly marked as safe and subsequently served via the @fs endpoint to any network requester. This allows an attacker to read files that should be blocked by the filesystem access restrictions.

    How to fix Directory Traversal?

    Upgrade vite to version 8.3.3, 8.2.4, 8.1.6, 7.3.7, 6.4.4 or higher.

    >=8.3.0 <8.3.3>=8.2.0 <8.2.4>=8.0.0 <8.1.6>=7.0.0 <7.3.7<6.4.4
    • M
    Command Injection

    vite is a Native-ESM powered web dev build tool

    Affected versions of this package are vulnerable to Command Injection via constructWindowsLaunchCommand in packages/launch-editor/construct-windows-launch-command.js, where file path arguments containing % characters are passed unsanitized to childProcess.exec on Windows. CMD expands percent-delimited expressions such as %VAR:old=new% before consuming caret escapes, allowing an attacker who controls the file path argument to inject arbitrary OS commands through environment variable expansion. Arguments containing line breaks are similarly not rejected, as CMD treats line breaks as command separators.

    Note: This is only exploitable on Windows platforms.

    How to fix Command Injection?

    Upgrade vite to version 6.4.4, 7.3.7, 8.1.6, 8.2.4, 8.3.3 or higher.

    <6.4.4>=7.0.0 <7.3.7>=8.0.0 <8.1.6>=8.2.0 <8.2.4>=8.3.0 <8.3.3
    • H
    Arbitrary Command Injection

    vite is a Native-ESM powered web dev build tool

    Affected versions of this package are vulnerable to Arbitrary Command Injection via the parseFile function in packages/launch-editor/index.js, which previously resolved file paths only after stripping position suffixes without calling path.resolve before security checks. An attacker who can influence the file argument passed to launchEditor can supply a path that bypasses the UNC path check on Windows (which compared the raw, unresolved string against \\\\) and cause the editor to open an arbitrary file on the host system, achieving unauthorized read and write access to sensitive files.

    How to fix Arbitrary Command Injection?

    Upgrade vite to version 6.4.4, 7.3.7, 8.1.6, 8.2.4, 8.3.3 or higher.

    <6.4.4>=7.0.0 <7.3.7>=8.0.0 <8.1.6>=8.2.0 <8.2.4>=8.3.0 <8.3.3
    • M
    Arbitrary Argument Injection

    vite is a Native-ESM powered web dev build tool

    Affected versions of this package are vulnerable to Arbitrary Argument Injection via the getArgumentsForFile function in packages/launch-editor/get-args.js, where a filename is passed directly to an editor process without being resolved to an absolute path first. An attacker who can control the filename argument can supply a value beginning with a hyphen or flag-like prefix, causing it to be interpreted as a command-line flag by the spawned editor process rather than as a file path.

    Note: This is only exploitable on WSL (Windows Subsystem for Linux) environments where Vite 2.0.0+ is used with launch-editor-middleware v2.2.0+, and the impact on Notepad++ is limited to configurations using a plugin that exposes dangerous operations via plugin messages.

    How to fix Arbitrary Argument Injection?

    Upgrade vite to version 6.4.4, 7.3.7, 8.1.6, 8.2.4, 8.3.3 or higher.

    <6.4.4>=7.0.0 <7.3.7>=8.0.0 <8.1.6>=8.2.0 <8.2.4>=8.3.0 <8.3.3