GitHub Advisoryadvisory · npm

GHSA-4w7w-66w2-5vf9 Vite Vulnerable to Path Traversal in Optimized Deps `.map` Handling

MEDIUM Published 2026-04-06 Modified 2026-04-07 Official page ↗
Aliases
CVE-2026-39365
Ecosystem
npm
Packages
vite
Severity
Moderate
CVSS vector
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
Weaknesses
CWE-200, CWE-22
Reviewed
2026-04-06

Affected packages

• npm vite: >= 8.0.0, < 8.0.5 → fixed in 8.0.5 • npm vite: >= 7.0.0, < 7.3.2 → fixed in 7.3.2 • npm vite: < 6.4.2 → fixed in 6.4.2

Description

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 ```bash cat > /tmp/poc.map 4. Inject `../` segments under the optimized deps `.map` URL prefix to reach `/tmp/poc.map`

Related

Alias · CVE (1)

  • CVE-2026-39365 Vite is a frontend tooling framework for JavaScript. vulnerability

Weakness · CWE (2)

  • CWE-200 Exposure of Sensitive Information to an Unauthorized Actor weakness
  • CWE-22 Improper Limitation of a Pathname to a Restricted Directory weakness

References