CVE-2026-39365: Vite Path Traversal Vulnerability

MODERATE
Advisory Identifier: GHSA-4w7w-66w2-5vf9
CWE-200 CWE-22
Published
Advisory Summary

CVE-2026-39365 is a MODERATE path traversal vulnerability (CWE-200: Exposure of Sensitive Information to an Unauthorized Actor) affecting Vite libraries in the npm ecosystem. The issue involves vite vulnerable to path traversal in optimized deps `.map` handling. Remediation is available by upgrading affected packages to version 8.0.5, 7.3.2, 6.4.2.

CVE-2026-39365 at a Glance

CVE Identifier CVE-2026-39365
GHSA Identifier GHSA-4w7w-66w2-5vf9
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-200: Exposure of Sensitive Information to an Unauthorized Actor
Affected Product Vite
Package Ecosystem npm
Published Date
Last Updated

How to Fix CVE-2026-39365

To remediate this vulnerability, upgrade all affected Vite dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

vite fixed: 8.0.5
npm install vite@8.0.5
vite fixed: 7.3.2
npm install vite@7.3.2
vite fixed: 6.4.2
npm install vite@6.4.2
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls vite

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-39365, inspect your project dependencies using npm:

npm ls vite

Analyze the terminal output to locate any version of Vite in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 8.0.5), your application is affected.

Note: The npm ls vite command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-200: Exposure of Sensitive Information to an Unauthorized Actor, where the product exposes sensitive information to an actor that is not explicitly authorized to have access to that information. In Vite, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary Any files ending with `.map` even 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 `--host` or [`server.host` config option](https://vitejs.dev/config/server-options.html#server-host)) - have a sensitive content in files ending with `.map` and the path is predictable ### Details In Vite v7.3.1, the dev server’s handling of `.map` requests for optimized dependencies resolves file paths and calls `readFile` without restricting `../` segments in the URL. As a result, it is possible to bypass the [`server.fs.strict`](https://vite.dev/config/server-options#server-fs-strict) allow list and retrieve `.map` files located outside the project root, provided they can be parsed as valid source map JSON. ### PoC 1. Create a minimal PoC sourcemap outside the project root ```bash cat > /tmp/poc.map <<'EOF' {"version":3,"file":"x.js","sources":[],"names":[],"mappings":""} EOF ``` 2. Start the Vite dev server (example) ```bash pnpm -C playground/fs-serve dev --host 127.0.0.1 --port 18080 ``` 3. Confirm that direct `/@fs` access is blocked by `strict` (returns 403) <img width="4004" height="1038" alt="image" src="https://github.com/user-attachments/assets/15a859a8-1dc6-4105-8d58-80527c0dd9ab" /> 4. Inject `../` segments under the optimized deps `.map` URL prefix to reach `/tmp/poc.map` <img width="2790" height="846" alt="image" src="https://github.com/user-attachments/assets/5d02957d-2e6a-4c45-9819-3f024e0e81f2" />

CVE-2026-39365 Affected Vite Versions

3 component(s)
Fixed Versions:
8.0.57.3.26.4.2
Product / Package Ecosystem Affected Versions Fixed Version
vite
npm
≥ 8.0.0
< 8.0.5
8.0.5
vite
npm
≥ 7.0.0
< 7.3.2
7.3.2
vite
npm
< 6.4.2
6.4.2

References

Frequently Asked Questions

What is CVE-2026-39365?
CVE-2026-39365 is a security vulnerability in Vite involving Vite Vulnerable to Path Traversal in Optimized Deps `.map` Handling under CWE-200: Exposure of Sensitive Information to an Unauthorized Actor.
Which Vite versions are affected?
Affected versions include releases prior to 8.0.5, 7.3.2, 6.4.2 across affected packages: vite.
What version fixes CVE-2026-39365?
Upgrading to 8.0.5, 7.3.2, 6.4.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is vite affected?
Yes, vite is affected in releases prior to 8.0.5, 7.3.2, 6.4.2. Upgrade your dependency to 8.0.5, 7.3.2, 6.4.2 or later.
What CWE is associated with CVE-2026-39365?
CVE-2026-39365 is classified under CWE-200: Exposure of Sensitive Information to an Unauthorized Actor (The product exposes sensitive information to an actor that is not explicitly authorized to have access to that information.).
How can I check npm dependencies for CVE-2026-39365?
Run the dependency tree command: 'npm ls vite'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-4w7w-66w2-5vf9",
  "modified" : "2026-04-07T22:16:27Z",
  "published" : "2026-04-06T18:03:46Z",
  "aliases" : [ "CVE-2026-39365" ],
  "summary" : "Vite Vulnerable to Path Traversal in Optimized Deps `.map` Handling",
  "details" : "### Summary\n\nAny files ending with `.map` even out side the project can be returned to the browser.\n\n### Impact\n\nOnly apps that match the following conditions are affected:\n\n- explicitly exposes the Vite dev server to the network (using `--host` or [`server.host` config option](https://vitejs.dev/config/server-options.html#server-host))\n- have a sensitive content in files ending with `.map` and the path is predictable\n\n### Details\n\nIn Vite v7.3.1, the dev server’s handling of `.map` requests for optimized dependencies resolves file paths and calls `readFile` without restricting `../` segments in the URL. As a result, it is possible to bypass the [`server.fs.strict`](https://vite.dev/config/server-options#server-fs-strict) allow list and retrieve `.map` files located outside the project root, provided they can be parsed as valid source map JSON.\n\n### PoC\n1. Create a minimal PoC sourcemap outside the project root\n    ```bash\n    cat > /tmp/poc.map <<'EOF'\n    {\"version\":3,\"file\":\"x.js\",\"sources\":[],\"names\":[],\"mappings\":\"\"}\n    EOF\n    ```\n2. Start the Vite dev server (example)\n    ```bash\n    pnpm -C playground/fs-serve dev --host 127.0.0.1 --port 18080\n    ```\n3. Confirm that direct `/@fs` access is blocked by `strict` (returns 403)\n    <img width=\"4004\" height=\"1038\" alt=\"image\" src=\"https://github.com/user-attachments/assets/15a859a8-1dc6-4105-8d58-80527c0dd9ab\" />\n4. Inject `../` segments under the optimized deps `.map` URL prefix to reach `/tmp/poc.map`\n    <img width=\"2790\" height=\"846\" alt=\"image\" src=\"https://github.com/user-attachments/assets/5d02957d-2e6a-4c45-9819-3f024e0e81f2\" />",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "vite"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "8.0.0"
      }, {
        "fixed" : "8.0.5"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 8.0.4"
    }
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "vite"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "7.0.0"
      }, {
        "fixed" : "7.3.2"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 7.3.1"
    }
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "vite"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "6.4.2"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 6.4.1"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/vitejs/vite/security/advisories/GHSA-4w7w-66w2-5vf9"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-39365"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/vitejs/vite/pull/22161"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/vitejs/vite/commit/79f002f2286c03c88c7b74c511c7f9fc6dc46694"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/vitejs/vite"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/vitejs/vite/releases/tag/v6.4.2"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/vitejs/vite/releases/tag/v7.3.2"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/vitejs/vite/releases/tag/v8.0.5"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-200", "CWE-22" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-04-06T18:03:46Z",
    "nvd_published_at" : "2026-04-07T20:16:30Z"
  }
}