Packages / vite / Security

ModerateVulnerabilityGHSA-4w7w-66w2-5vf9CVE-2026-39365Published 6 Apr 2026

Vite Vulnerable to Path Traversal in Optimized Deps `.map` Handling

Affected releases · vite

  • 8.x8.0.0 – 8.0.4Fixed in 8.0.5
  • 7.x7.0.0 – 7.3.1Fixed in 7.3.2
  • 6.x6.0.0 – 6.4.1Fixed in 6.4.2
  • 5.x and older0.1.0 – 5.4.21No fix, no longer updated

On 8.x, the newest line:

npm install vite@8.0.5
8.x
  1. Affected

    8.0.0 – 8.0.4

    5 releases

  2. Fixed

    8.0.5 – 8.3.5

    29 releases, latest

7.x
  1. Affected

    7.0.0 – 7.3.1

    31 releases

  2. Fixed

    7.3.2 – 7.3.7

    5 releases

6.x
  1. Affected

    6.0.0 – 6.4.1

    41 releases

  2. Fixed

    6.4.2 – 6.4.5

    4 releases

5.x
  1. Affected

    5.0.0 – 5.4.21

    67 releases

4.x
  1. Affected

    4.0.0 – 4.5.14

    53 releases

3.x
  1. Affected

    3.0.0 – 3.2.11

    30 releases

2.x
  1. Affected

    2.0.0 – 2.9.18

    97 releases

0.x
  1. Affected

    0.1.0 – 0.20.10

    78 releases

440 stable releases of vite, oldest to newest, one row per major.

Is your project affected?

Paste your package.json, or type the range you declare for vite. It is read in your browser and sent nowhere.

What happens

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)

  • 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 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

    cat > /tmp/poc.map <<'EOF'
    {"version":3,"file":"x.js","sources":[],"names":[],"mappings":""}
    EOF
  2. Start the Vite dev server (example)

    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)

  4. Inject ../ segments under the optimized deps .map URL prefix to reach /tmp/poc.map