Skip to content

← Public intelligence

npm package

vite

Open actionable advisories and recorded vendor fixes. This public package view has no inventory attached and cannot establish whether your deployment is affected. A vendor fix never resolves your finding; verify your installed version and the source guidance.

Open advisories

29 actionable advisories, newest first. Withdrawn advisories and news are excluded. Coverage is partial.

  1. High, CVSS 7.5npmAmendedPublished

    Vite dev server option server.fs.deny can be bypassed when hosted on case-insensitive filesystem

    CVE-2024-23331 · GHSA-c24v-8rfc-w8vw

    Affected
    • npm vite >= 2.7.0, <= 2.9.16; >= 3.0.0, <= 3.2.7; >= 4.0.0, <= 4.5.1; >= 5.0.0, <= 5.0.11
    Fixed in
    4.5.22.9.175.0.123.2.8· Vendor fix available
    Issue
    Vite dev server option server.fs.deny can 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 Details Since picomatch defaults to case-sensitive glob matching, but the file server doesn't discriminate; a blacklist bypass is possible. See picomatch usage, where nocase is defaulted to false: https://github.com/vitejs/vite/blob/v5.1.0-beta.1/packages/vite/src/node/server/index.ts#L632 By requesting raw filesystem paths using augmented casing, the matcher derived from config.server.fs.deny fails to block access to sensitive files. PoC Setup 1. Created vanilla Vite project using npm create vite@latest on a Standard Azure hosted Windows 10 instance. - npm run dev -- --host 0.0.0.0 -…

    Recommended action: Upgrade to 5.0.12, 4.5.2, 3.2.8 or 2.9.17 by release line, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →
  2. Medium, CVSS 6.1npmAmendedPublished

    Vite XSS vulnerability in server.transformIndexHtml via URL payload

    CVE-2023-49293 · GHSA-92r3-m2mg-pj97

    Affected
    • npm vite >= 4.4.0, < 4.4.12; >= 4.5.0, <= 4.5.0; >= 5.0.0, < 5.0.5
    Fixed in
    4.5.15.0.54.4.12· Vendor fix available
    Issue
    When Vite's HTML transformation is invoked manually via server.transformIndexHtml, the original request URL is passed in unmodified, and the html being 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 to server.transformIndexHtml. Impact Only apps using appType: 'custom' and using the default Vite HTML middleware are affected. The HTML entry must also contain an inline script. The attack requires a user to click on a malicious URL while running the dev server. Restricted files aren't exposed to the attacker. Patches Fixed in vite@5.0.5, vite@4.5.1, vite@4.4.12 Details Suppose index.html contains an inline module script: This script is transformed into a proxy script like due to Vite's HTML plugin: https://github.com/vitejs/vite/blob/7fd7c6cebfcad34ae7021ebee28f97b1f28ef3f3/packages/vite/src/node/plugins/html.ts#L429-L465 When appType:…

    Recommended action: Upgrade to 5.0.5, 4.5.1 or 4.4.12 by release line, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →
  3. High, CVSS 7.5npmAmendedPublished

    Vite Server Options (server.fs.deny) can be bypassed using double forward-slash (//)

    CVE-2023-34092 · GHSA-353f-5xf4-qw67

    Affected
    • npm vite < 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
    Fixed in
    4.3.94.1.53.2.72.9.164.2.34.0.5· Vendor fix available
    Issue
    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. Steps to Fix. Update Vite: Ensure that you are using the latest version of Vite. Security issues like this are often fixed in newer releases.\n2. Secure the server configuration: In your vite.config.js file, review and update the server configuration options to restrict access to unauthorized requests or directories. Impact Only users explicitly exposing the Vite dev server to the network (using --host or the server.host config option) are affected and only files in the immediate Vite project root folder could be exposed.\n\n Patches\nFixed in vite@4.3.9, vite@4.2.3, vite@4.1.5, vite@4.0.5 and in the latest minors of the previous two majors, vite@3.2.7 and vite@2.9.16. Details Vite serves the application with under the root-path…

    Recommended action: Upgrade to 4.3.9, 4.2.3, 4.1.5 or 3 more by release line, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →
  4. High, CVSS 8.7npmAmendedPublished

    Vite before v2.9.13 vulnerable to directory traversal via crafted URL to victim's service

    CVE-2022-35204 · GHSA-mv48-hcvh-8jj8

    Affected
    • npm vite < 2.9.13; >= 3.0.0-alpha.0, < 3.0.0-beta.4
    Fixed in
    3.0.0-beta.42.9.13· Vendor fix available
    Issue
    Vite before v2.9.13 was discovered to allow attackers to perform a directory traversal via a crafted URL to the victim's service.

    Recommended action: Upgrade to 3.0.0-beta.4 (pre-release) or 2.9.13 by release line, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →