CVE-2026-39364: Vite `server.fs.deny` Bypassed With Queries Vulnerability

HIGH
Advisory Identifier: GHSA-v2wj-q39q-566r
CWE-284 CWE-180
Published
Advisory Summary

CVE-2026-39364 is a HIGH `server.fs.deny` bypassed with queries vulnerability (CWE-284: Improper Access Control) affecting Vite libraries in the npm ecosystem. The issue involves `server.fs.deny` bypassed with queries. Remediation is available by upgrading affected packages to version 8.0.5, 7.3.2.

CVE-2026-39364 at a Glance

CVE Identifier CVE-2026-39364
GHSA Identifier GHSA-v2wj-q39q-566r
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-284: Improper Access Control
Affected Product Vite
Package Ecosystem npm
Published Date
Last Updated

How to Fix CVE-2026-39364

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
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-39364, 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-284: Improper Access Control, where the product does not restrict or incorrectly restricts access to a resource from an unauthorized actor. 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 The contents of files that are specified by [`server.fs.deny`](https://vite.dev/config/server-options#server-fs-deny) 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)) - the sensitive file exists in the allowed directories specified by [`server.fs.allow`](https://vite.dev/config/server-options#server-fs-allow) - the sensitive file is denied with a pattern that matches a file by [`server.fs.deny`](https://vite.dev/config/server-options#server-fs-deny) ### Details On the Vite dev server, files that should be blocked by `server.fs.deny` (e.g., `.env`, `*.crt`) can be retrieved with HTTP 200 responses when query parameters such as `?raw`, `?import&raw`, or `?import&url&inline` are appended. ### PoC 1. Start the dev server: `pnpm exec vite root --host 127.0.0.1 --port 5175 --strictPort` 2. Confirm that `server.fs.deny` is enforced (expect 403): `curl -i http://127.0.0.1:5175/src/.env | head -n 20` <img width="3944" height="1092" alt="image" src="https://github.com/user-attachments/assets/ecb9f2e0-e08f-4ac7-b194-e0f988c4cd4f" /> 3. Confirm that the same files can be retrieved with query parameters (expect 200): <img width="2014" height="373" alt="image" src="https://github.com/user-attachments/assets/76bc2a6a-44f4-4161-ae47-eab5ae0c04a8" />

CVE-2026-39364 Affected Vite Versions

2 component(s)
Fixed Versions:
8.0.57.3.2
Product / Package Ecosystem Affected Versions Fixed Version
vite
npm
≥ 8.0.0
< 8.0.5
8.0.5
vite
npm
≥ 7.1.0
< 7.3.2
7.3.2

References

Frequently Asked Questions

What is CVE-2026-39364?
CVE-2026-39364 is a security vulnerability in Vite involving `server.fs.deny` bypassed with queries under CWE-284: Improper Access Control.
Which Vite versions are affected?
Affected versions include releases prior to 8.0.5, 7.3.2 across affected packages: vite.
What version fixes CVE-2026-39364?
Upgrading to 8.0.5, 7.3.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. Upgrade your dependency to 8.0.5, 7.3.2 or later.
What CWE is associated with CVE-2026-39364?
CVE-2026-39364 is classified under CWE-284: Improper Access Control (The product does not restrict or incorrectly restricts access to a resource from an unauthorized actor.).
How can I check npm dependencies for CVE-2026-39364?
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-v2wj-q39q-566r",
  "modified" : "2026-04-07T22:16:17Z",
  "published" : "2026-04-06T18:03:32Z",
  "aliases" : [ "CVE-2026-39364" ],
  "summary" : "Vite: `server.fs.deny` bypassed with queries",
  "details" : "### Summary\n\nThe contents of files that are specified by [`server.fs.deny`](https://vite.dev/config/server-options#server-fs-deny) 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- the sensitive file exists in the allowed directories specified by [`server.fs.allow`](https://vite.dev/config/server-options#server-fs-allow)\n- the sensitive file is denied with a pattern that matches a file by [`server.fs.deny`](https://vite.dev/config/server-options#server-fs-deny)\n\n### Details\n\nOn the Vite dev server, files that should be blocked by `server.fs.deny` (e.g., `.env`, `*.crt`) can be retrieved with HTTP 200 responses when query parameters such as `?raw`, `?import&raw`, or `?import&url&inline` are appended.\n\n### PoC\n\n1. Start the dev server: `pnpm exec vite root --host 127.0.0.1 --port 5175 --strictPort`\n2. Confirm that `server.fs.deny` is enforced (expect 403): `curl -i http://127.0.0.1:5175/src/.env | head -n 20`\n   <img width=\"3944\" height=\"1092\" alt=\"image\" src=\"https://github.com/user-attachments/assets/ecb9f2e0-e08f-4ac7-b194-e0f988c4cd4f\" />\n3. Confirm that the same files can be retrieved with query parameters (expect 200):\n   <img width=\"2014\" height=\"373\" alt=\"image\" src=\"https://github.com/user-attachments/assets/76bc2a6a-44f4-4161-ae47-eab5ae0c04a8\" />",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/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.1.0"
      }, {
        "fixed" : "7.3.2"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 7.3.1"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/vitejs/vite/security/advisories/GHSA-v2wj-q39q-566r"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-39364"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/vitejs/vite/pull/22160"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/vitejs/vite/commit/a9a3df299378d9cbc5f069e3536a369f8188c8ff"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/vitejs/vite"
  }, {
    "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-180", "CWE-284" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-04-06T18:03:32Z",
    "nvd_published_at" : "2026-04-07T20:16:30Z"
  }
}