{"schema":"threatline.record/2","record":{"id":"CVE-2026-112946","aliases":["GHSA-rq7h-c2jc-7f22"],"summary":"Vite: Files outside `server.fs.allow` could be served when project paths match system paths on non-Windows machine","details":"### Summary\n\nThe content of files outside `server.fs` setting can be returned to the browser if the project imports a file path concatenated with the `root`. For example, if the project references `<path-to-project-root>/etc/hosts`, the content of `/etc/hosts` was possible to be returned.\n\nThe content of files outside the `server.fs.allow` option can be returned to the browser when a project imports a file whose root-relative path matches an absolute path on the host. For example, referencing `<project-root>/etc/hosts` could make Vite return the host's `/etc/hosts` file.\n\n### Impact\n\nOnly apps that meet all of the following conditions are affected:\n\n- explicitly expose the Vite dev server to the network (using `--host` or the [`server.host` option](https://vite.dev/config/server-options#server-host))\n- contain an imported file whose root-relative browser URL is also the absolute path of a readable file on the host\n- The sensitive file is not matched by [`server.fs.deny`](https://vite.dev/config/server-options#server-fs-deny)\n- the dev server is not running on Windows\n\n### Details\n\nWhen Vite analyzes an in-root import, it rewrites the resolved module ID to a browser URL such as `/etc/hostname`. In affected versions, Vite converts that URL with `fsPathFromUrl` and adds the result to `safeModulePaths`. Because `fsPathFromUrl` ensures a leading slash without resolving the URL against the project root, the project URL `/etc/hostname` is recorded as if it were the absolute filesystem path `/etc/hostname`.\n\nFor a later request to `/@fs/etc/hostname`, the raw-filesystem middleware interprets `/etc/hostname` as an absolute path. The access check applies `server.fs.deny`, then accepts paths present in `safeModulePaths` before checking `server.fs.allow`. As a result, the request can return the host file instead of the project file that originally populated `safeModulePaths`.\n\n### PoC\nThe following example requires Linux with a readable `/etc/hostname`:\n```bash\n$ mkdir vite-safe-module-path-poc\n$ cd vite-safe-module-path-poc\n$ npm init -y\n$ npm install vite@8.3.1\n$ mkdir -p etc\n$ echo 'PROJECT-DECOY\\n' > etc/hostname\n$ echo 'import \"./etc/hostname\"\\n' > main.js\n$ npx vite --host 127.0.0.1\n```\n\nIn another terminal:\n```bash\n$ curl -o /dev/null -s -w '%{http_code}\\n' http://127.0.0.1:5173/main.js\n200\n$ curl -sS -o response -w '%{http_code}\\n' http://127.0.0.1:5173/@fs/etc/hostname\n200\n$ cmp -s response /etc/hostname && echo 'response matches host file'\nresponse matches host file\n```","categories":["Libraries & packages"],"product":"vite","vendor":"vitejs","ecosystem":"npm","affected_ranges":[{"source":"GitHub Advisory Database","source_url":"https://github.com/advisories/GHSA-rq7h-c2jc-7f22","source_modified_at":"2026-10-21T16:47:43Z","fetched_at":"2026-10-23T18:42:43.628194Z","package":{"ecosystem":"npm","name":"vite"},"range":">= 8.3.0, <= 8.3.2"},{"source":"GitHub Advisory Database","source_url":"https://github.com/advisories/GHSA-rq7h-c2jc-7f22","source_modified_at":"2026-10-21T16:47:43Z","fetched_at":"2026-10-23T18:42:43.628194Z","package":{"ecosystem":"npm","name":"vite"},"range":">= 8.2.0, <= 8.2.3"},{"source":"GitHub Advisory Database","source_url":"https://github.com/advisories/GHSA-rq7h-c2jc-7f22","source_modified_at":"2026-10-21T16:47:43Z","fetched_at":"2026-10-23T18:42:43.628194Z","package":{"ecosystem":"npm","name":"vite"},"range":">= 8.0.0, <= 8.1.5"},{"source":"GitHub Advisory Database","source_url":"https://github.com/advisories/GHSA-rq7h-c2jc-7f22","source_modified_at":"2026-10-21T16:47:43Z","fetched_at":"2026-10-23T18:42:43.628194Z","package":{"ecosystem":"npm","name":"vite"},"range":">= 7.0.0, <= 7.3.6"},{"source":"GitHub Advisory Database","source_url":"https://github.com/advisories/GHSA-rq7h-c2jc-7f22","source_modified_at":"2026-10-21T16:47:43Z","fetched_at":"2026-10-23T18:42:43.628194Z","package":{"ecosystem":"npm","name":"vite"},"range":"<= 6.4.3"},{"source":"GitHub Advisory Database","source_url":"https://github.com/advisories/GHSA-rq7h-c2jc-7f22","source_modified_at":"2026-10-21T16:47:43Z","fetched_at":"2026-10-23T18:42:43.628194Z","package":{"ecosystem":"npm","name":"vite-plus"},"range":"<= 1.0.0"},{"source":"CVE List","source_url":"https://www.cve.org/CVERecord?id=CVE-2026-112946","source_modified_at":"2026-10-20T16:46:18.810Z","fetched_at":"2026-10-23T18:45:31.882637Z","product":"vite","vendor":"vitejs","versions":[{"version":">= 8.3.0, < 8.3.3","status":"affected"},{"version":">= 8.2.0, < 8.2.4","status":"affected"},{"version":">= 8.0.0, < 8.1.6","status":"affected"},{"version":">= 7.0.0, < 7.3.7","status":"affected"},{"version":"< 6.4.4","status":"affected"}],"defaultStatus":null},{"source":"CVE List","source_url":"https://www.cve.org/CVERecord?id=CVE-2026-112946","source_modified_at":"2026-10-20T16:46:18.810Z","fetched_at":"2026-10-23T18:45:31.882637Z","product":"vite-plus","vendor":"vitejs","versions":[{"version":"< 1.1.0","status":"affected"}],"defaultStatus":null},{"source":"OSV","source_url":"https://osv.dev/vulnerability/GHSA-rq7h-c2jc-7f22","source_modified_at":"2026-10-21T17:00:06.336868869Z","fetched_at":"2026-10-23T18:45:31.882637Z","package":{"name":"vite","ecosystem":"npm","purl":"pkg:npm/vite"},"ranges":[{"type":"SEMVER","events":[{"introduced":"8.3.0"},{"fixed":"8.3.3"}]}],"versions":[]},{"source":"OSV","source_url":"https://osv.dev/vulnerability/GHSA-rq7h-c2jc-7f22","source_modified_at":"2026-10-21T17:00:06.336868869Z","fetched_at":"2026-10-23T18:45:31.882637Z","package":{"name":"vite","ecosystem":"npm","purl":"pkg:npm/vite"},"ranges":[{"type":"SEMVER","events":[{"introduced":"8.2.0"},{"fixed":"8.2.4"}]}],"versions":[]},{"source":"OSV","source_url":"https://osv.dev/vulnerability/GHSA-rq7h-c2jc-7f22","source_modified_at":"2026-10-21T17:00:06.336868869Z","fetched_at":"2026-10-23T18:45:31.882637Z","package":{"name":"vite","ecosystem":"npm","purl":"pkg:npm/vite"},"ranges":[{"type":"SEMVER","events":[{"introduced":"8.0.0"},{"fixed":"8.1.6"}]}],"versions":[]},{"source":"OSV","source_url":"https://osv.dev/vulnerability/GHSA-rq7h-c2jc-7f22","source_modified_at":"2026-10-21T17:00:06.336868869Z","fetched_at":"2026-10-23T18:45:31.882637Z","package":{"name":"vite","ecosystem":"npm","purl":"pkg:npm/vite"},"ranges":[{"type":"SEMVER","events":[{"introduced":"7.0.0"},{"fixed":"7.3.7"}]}],"versions":[]},{"source":"OSV","source_url":"https://osv.dev/vulnerability/GHSA-rq7h-c2jc-7f22","source_modified_at":"2026-10-21T17:00:06.336868869Z","fetched_at":"2026-10-23T18:45:31.882637Z","package":{"name":"vite","ecosystem":"npm","purl":"pkg:npm/vite"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"6.4.4"}]}],"versions":[]},{"source":"OSV","source_url":"https://osv.dev/vulnerability/GHSA-rq7h-c2jc-7f22","source_modified_at":"2026-10-21T17:00:06.336868869Z","fetched_at":"2026-10-23T18:45:31.882637Z","package":{"name":"vite-plus","ecosystem":"npm","purl":"pkg:npm/vite-plus"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"1.1.0"}]}],"versions":[]}],"fixed_versions":[{"source":"GitHub Advisory Database","source_url":"https://github.com/advisories/GHSA-rq7h-c2jc-7f22","source_modified_at":"2026-10-21T16:47:43Z","fetched_at":"2026-10-23T18:42:43.628194Z","package":{"ecosystem":"npm","name":"vite"},"version":"8.3.3"},{"source":"GitHub Advisory Database","source_url":"https://github.com/advisories/GHSA-rq7h-c2jc-7f22","source_modified_at":"2026-10-21T16:47:43Z","fetched_at":"2026-10-23T18:42:43.628194Z","package":{"ecosystem":"npm","name":"vite"},"version":"8.2.4"},{"source":"GitHub Advisory Database","source_url":"https://github.com/advisories/GHSA-rq7h-c2jc-7f22","source_modified_at":"2026-10-21T16:47:43Z","fetched_at":"2026-10-23T18:42:43.628194Z","package":{"ecosystem":"npm","name":"vite"},"version":"8.1.6"},{"source":"GitHub Advisory Database","source_url":"https://github.com/advisories/GHSA-rq7h-c2jc-7f22","source_modified_at":"2026-10-21T16:47:43Z","fetched_at":"2026-10-23T18:42:43.628194Z","package":{"ecosystem":"npm","name":"vite"},"version":"7.3.7"},{"source":"GitHub Advisory Database","source_url":"https://github.com/advisories/GHSA-rq7h-c2jc-7f22","source_modified_at":"2026-10-21T16:47:43Z","fetched_at":"2026-10-23T18:42:43.628194Z","package":{"ecosystem":"npm","name":"vite"},"version":"6.4.4"},{"source":"GitHub Advisory Database","source_url":"https://github.com/advisories/GHSA-rq7h-c2jc-7f22","source_modified_at":"2026-10-21T16:47:43Z","fetched_at":"2026-10-23T18:42:43.628194Z","package":{"ecosystem":"npm","name":"vite-plus"},"version":"1.1.0"},{"source":"OSV","source_url":"https://osv.dev/vulnerability/GHSA-rq7h-c2jc-7f22","source_modified_at":"2026-10-21T17:00:06.336868869Z","fetched_at":"2026-10-23T18:45:31.882637Z","package":{"name":"vite","ecosystem":"npm","purl":"pkg:npm/vite"},"version":"8.3.3"},{"source":"OSV","source_url":"https://osv.dev/vulnerability/GHSA-rq7h-c2jc-7f22","source_modified_at":"2026-10-21T17:00:06.336868869Z","fetched_at":"2026-10-23T18:45:31.882637Z","package":{"name":"vite","ecosystem":"npm","purl":"pkg:npm/vite"},"version":"8.2.4"},{"source":"OSV","source_url":"https://osv.dev/vulnerability/GHSA-rq7h-c2jc-7f22","source_modified_at":"2026-10-21T17:00:06.336868869Z","fetched_at":"2026-10-23T18:45:31.882637Z","package":{"name":"vite","ecosystem":"npm","purl":"pkg:npm/vite"},"version":"8.1.6"},{"source":"OSV","source_url":"https://osv.dev/vulnerability/GHSA-rq7h-c2jc-7f22","source_modified_at":"2026-10-21T17:00:06.336868869Z","fetched_at":"2026-10-23T18:45:31.882637Z","package":{"name":"vite","ecosystem":"npm","purl":"pkg:npm/vite"},"version":"7.3.7"},{"source":"OSV","source_url":"https://osv.dev/vulnerability/GHSA-rq7h-c2jc-7f22","source_modified_at":"2026-10-21T17:00:06.336868869Z","fetched_at":"2026-10-23T18:45:31.882637Z","package":{"name":"vite","ecosystem":"npm","purl":"pkg:npm/vite"},"version":"6.4.4"},{"source":"OSV","source_url":"https://osv.dev/vulnerability/GHSA-rq7h-c2jc-7f22","source_modified_at":"2026-10-21T17:00:06.336868869Z","fetched_at":"2026-10-23T18:45:31.882637Z","package":{"name":"vite-plus","ecosystem":"npm","purl":"pkg:npm/vite-plus"},"version":"1.1.0"}],"cvss":6.3,"severity":"Medium","kev":{"listed":false},"epss":{"probability":0.00851,"percentile":0.57832,"score_date":"2026-10-23"},"published_at":"2026-10-20T15:03:55.196Z","modified_at":"2026-10-21T17:00:06.336868869Z","provenance":[{"source":"GitHub Advisory Database","url":"https://github.com/advisories/GHSA-rq7h-c2jc-7f22","fetched_at":"2026-10-23T18:42:43.628194Z","source_modified_at":"2026-10-21T16:47:43Z"},{"source":"CVE List","url":"https://www.cve.org/CVERecord?id=CVE-2026-112946","fetched_at":"2026-10-23T18:45:31.882637Z","source_modified_at":"2026-10-20T16:46:18.810Z"},{"source":"OSV","url":"https://osv.dev/vulnerability/GHSA-rq7h-c2jc-7f22","fetched_at":"2026-10-23T18:45:31.882637Z","source_modified_at":"2026-10-21T17:00:06.336868869Z"},{"source":"EPSS","url":"https://api.first.org/data/v1/epss?cve=CVE-2026-112946","fetched_at":"2026-10-23T18:42:43.628194Z","source_modified_at":"2026-10-23"}],"sources":["GitHub Advisory Database","CVE List","OSV","EPSS"],"references":[{"source":"CVE List","url":"https://github.com/vitejs/vite/security/advisories/GHSA-rq7h-c2jc-7f22","tags":["exploit"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-112946","source":"GitHub Advisory Database"},{"source":"CVE List","url":"https://github.com/vitejs/vite/pull/23656","tags":["x_refsource_MISC"]},{"source":"CVE List","url":"https://github.com/vitejs/vite/commit/170b92791421bcd484f7325936d989a82d6bd4aa","tags":["x_refsource_MISC"]},{"source":"CVE List","url":"https://github.com/vitejs/vite/commit/45c0e3392a298626955a0ab93a8e51232daac721","tags":["x_refsource_MISC"]},{"source":"CVE List","url":"https://github.com/vitejs/vite/commit/c3e06f92e969952466b4e2f5801e85e1e00cd905","tags":["x_refsource_MISC"]},{"source":"CVE List","url":"https://github.com/vitejs/vite/commit/e570d8d016096b5f8f6f09808376ca6cf73f27d0","tags":["x_refsource_MISC"]},{"source":"CVE List","url":"https://github.com/vitejs/vite/commit/f0d76c7da13d5e794807b82f0b86c1931a8438e3","tags":["x_refsource_MISC"]},{"url":"https://github.com/advisories/GHSA-rq7h-c2jc-7f22","source":"GitHub Advisory Database"}],"locations":[],"motoko_assessment":{"status":"requires_architecture_review","automatic_remediation":false},"cve_state":"PUBLISHED","ssvc":{"exploitation":"poc","automatable":"no","technical_impact":"partial","assessed_at":"2026-10-20T16:45:38.089794Z"},"classification":{"method":"product-first software-layer rules","rules_version":"2.1","matched_on":"ecosystem","confidence":"heuristic","reviewed":false},"change_timestamp":"2026-10-21T17:00:06.336868869Z","content_hash":"58a5083c001bba5017adedc8e57af8ca94b41ad83909ae0affbf8b45d19cb749"}}
