{"id":"GHSA-p458-7748-mcp3","revision":null,"records":[{"revision":"4312268b496c4fc3bbf870a80b9d96bf","observedAt":"2026-10-23T15:48:27.903+00:00","statement":{"source":"cve-program","id":"CVE-2026-112948","aliases":[],"title":"Vitest: Servers misapply `server.fs.deny`, serving `.env`, private keys, `.git`, and the API token file","description":"Vitest is a testing framework powered by Vite. From 5.0.0-beta.6 until 5.0.5, Vitest dev servers can misapply server.fs.deny because project servers replace Vite's defaults and the root server adds .vitest-secret-token after Vite compiles its matcher. An attacker who can reach an affected UI, Browser Mode, or API server can read denied project files or the fallback API token at node_modules/.vitest/.vitest-secret-token, and Browser Mode with test.projects can expose JavaScript-compatible .env values through a malicious website. This issue is fixed in version 5.0.5.","state":0,"publishedAt":"2026-10-20T15:15:01.927+00:00","modifiedAt":"2026-10-20T16:16:59.623+00:00","affected":[{"ecosystem":"Vendor product","name":"vitest","ranges":[],"versions":[],"rawVersionEvidence":"{\n                    \"vendor\": \"vitest-dev\",\n                    \"product\": \"vitest\",\n                    \"versions\": [\n                        {\n                            \"version\": \">= 5.0.0-beta.6, < 5.0.5\",\n                            \"status\": \"affected\"\n                        }\n                    ]\n                }"},{"ecosystem":"Vendor product","name":"browser","ranges":[],"versions":[],"rawVersionEvidence":"{\n                    \"vendor\": \"@vitest\",\n                    \"product\": \"browser\",\n                    \"versions\": [\n                        {\n                            \"version\": \">= 5.0.0-beta.6, < 5.0.5\",\n                            \"status\": \"affected\"\n                        }\n                    ]\n                }"},{"ecosystem":"Vendor product","name":"ui","ranges":[],"versions":[],"rawVersionEvidence":"{\n                    \"vendor\": \"@vitest\",\n                    \"product\": \"ui\",\n                    \"versions\": [\n                        {\n                            \"version\": \">= 5.0.0-beta.6, < 5.0.5\",\n                            \"status\": \"affected\"\n                        }\n                    ]\n                }"},{"ecosystem":"Vendor product","name":"vite-plus","ranges":[],"versions":[],"rawVersionEvidence":"{\n                    \"vendor\": \"vitejs\",\n                    \"product\": \"vite-plus\",\n                    \"versions\": [\n                        {\n                            \"version\": \">= 1.0.0-rc.0, < 1.3.0\",\n                            \"status\": \"affected\"\n                        }\n                    ]\n                }"}],"metrics":[{"system":"CVSS 3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N","score":6.5,"severity":"MEDIUM"}],"references":["https://github.com/vitest-dev/vitest/security/advisories/GHSA-p458-7748-mcp3","https://github.com/vitest-dev/vitest/pull/11578","https://github.com/vitest-dev/vitest/commit/28dc1edfb6ba5a181fe208576989063795aeadb3","https://github.com/vitest-dev/vitest/releases/tag/v5.0.5"],"sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2026-112948","license":"CVE Program Terms of Use","key":"cve-program:CVE-2026-112948","identifiers":["CVE-2026-112948"]},"retained":false,"historicalAffected":[]},{"revision":"8dc6ef65a75e41d88b9d10acf4a7f5e7","observedAt":"2026-11-07T04:33:38.621+00:00","statement":{"source":"euvd","id":"EUVD-2026-105143","aliases":["CVE-2026-112948","GHSA-p458-7748-mcp3"],"title":"Vitest is a testing framework powered by Vite. From 5.0.0-beta.6 until 5.0.5, Vitest dev servers can misapply server.fs.deny because project servers replace Vite's defaults and the root server adds .vitest-secret-token after Vite compiles i…","description":"Vitest is a testing framework powered by Vite. From 5.0.0-beta.6 until 5.0.5, Vitest dev servers can misapply server.fs.deny because project servers replace Vite's defaults and the root server adds .vitest-secret-token after Vite compiles its matcher. An attacker who can reach an affected UI, Browser Mode, or API server can read denied project files or the fallback API token at node_modules/.vitest/.vitest-secret-token, and Browser Mode with test.projects can expose JavaScript-compatible .env values through a malicious website. This issue is fixed in version 5.0.5.","state":0,"publishedAt":null,"modifiedAt":null,"affected":[],"metrics":[{"system":"EUVD CVSS 3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N","score":6.5,"severity":null}],"references":["https://github.com/vitest-dev/vitest/security/advisories/GHSA-p458-7748-mcp3","https://github.com/vitest-dev/vitest/pull/11578","https://github.com/vitest-dev/vitest/commit/28dc1edfb6ba5a181fe208576989063795aeadb3","https://github.com/vitest-dev/vitest/releases/tag/v5.0.5"],"sourceUrl":"https://euvd.enisa.europa.eu/vulnerability/EUVD-2026-105143","license":"ENISA EUVD · source terms and attribution apply","enrichment":{"sourceStatus":null,"weaknesses":[],"productCriteria":[],"sourceDates":{"datePublished":"Oct 20, 2026, 3:15:01 PM","dateUpdated":"Oct 20, 2026, 4:16:59 PM"},"relatedAdvisories":[],"note":"EUVD source date text has no stated timezone and is retained without inventing a UTC instant. Related bulletin membership is not an alias, common cause or applicability claim. A missing vector with a zero score is treated as unrated. Complete vendor/product and underlying source evidence remains in the original JSON."},"key":"euvd:EUVD-2026-105143","identifiers":["EUVD-2026-105143","CVE-2026-112948","GHSA-p458-7748-mcp3"]},"retained":false,"historicalAffected":[]},{"revision":"3fd2352d26de453998339bc8bf14c6f7","observedAt":"2026-10-25T05:17:13.11+00:00","statement":{"source":"nvd","id":"CVE-2026-112948","aliases":[],"title":"Vitest is a testing framework powered by Vite. From 5.0.0-beta.6 until 5.0.5, Vitest dev servers can misapply server.fs.deny because project servers replace Vite's defaults and the root server adds .vitest-secret-token after Vite compiles i…","description":"Vitest is a testing framework powered by Vite. From 5.0.0-beta.6 until 5.0.5, Vitest dev servers can misapply server.fs.deny because project servers replace Vite's defaults and the root server adds .vitest-secret-token after Vite compiles its matcher. An attacker who can reach an affected UI, Browser Mode, or API server can read denied project files or the fallback API token at node_modules/.vitest/.vitest-secret-token, and Browser Mode with test.projects can expose JavaScript-compatible .env values through a malicious website. This issue is fixed in version 5.0.5.","state":0,"publishedAt":"2026-10-20T16:17:05.517+00:00","modifiedAt":"2026-10-20T19:56:45.543+00:00","affected":[],"metrics":[{"system":"CVSS 3.1 · security-advisories@github.com · Secondary","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N","score":6.5,"severity":"MEDIUM"}],"references":["https://github.com/vitest-dev/vitest/commit/28dc1edfb6ba5a181fe208576989063795aeadb3","https://github.com/vitest-dev/vitest/pull/11578","https://github.com/vitest-dev/vitest/releases/tag/v5.0.5","https://github.com/vitest-dev/vitest/security/advisories/GHSA-p458-7748-mcp3"],"sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2026-112948","license":"NIST NVD usage terms; underlying source attribution retained","enrichment":{"sourceStatus":"Awaiting Analysis","weaknesses":["CWE-200","CWE-552"],"productCriteria":[],"sourceDates":{"published":"2026-10-20T16:17:05.517","lastModified":"2026-10-20T19:56:45.543"},"relatedAdvisories":[],"note":"NVD analysis and CPE criteria are source context, not proof that a package or your environment is affected. Complete affected data, logical configurations and SSVC are retained in the original JSON."},"key":"nvd:CVE-2026-112948","identifiers":["CVE-2026-112948"]},"retained":false,"historicalAffected":[]},{"revision":"82584a1705bf43968994a8a8eb8402bf","observedAt":"2026-10-24T13:17:17.793+00:00","statement":{"source":"osv","id":"GHSA-p458-7748-mcp3","aliases":["CVE-2026-112948"],"title":"Vitest: Servers misapply `server.fs.deny`, serving `.env`, private keys, `.git`, and the API token file","description":"### Summary\n\nIn Vitest 5, Vite's `server.fs.deny` is not applied as intended on Vitest's dev servers. Depending on the server, files that Vite refuses to serve by default (such as `.env`, private keys and certificates, `.npmrc`, and `.git`) or Vitest's own API token file (`.vitest-secret-token`) can be read over plain HTTP by a client that can reach the server. In Browser Mode with `test.projects`, a malicious website can also read `.env` values through the developer's browser.\n\nThis only applies when Vitest runs an HTTP server, which happens with the UI (`--ui`), Browser Mode, or `api` enabled. Plain `vitest` and `vitest run` don't listen on any port and are not affected. The fix ships in `vitest`, and `@vitest/ui` and `@vitest/browser` are listed because they are what enables the affected setups. Both pin `vitest` to the same version as a peer dependency, so upgrading either one also requires the patched `vitest`. Users who enable `api` without `@vitest/ui` or `@vitest/browser` are also affected and should upgrade `vitest`.\n\n### Details\n\nVitest 5 adds its API token file to `server.fs.deny`, but neither server ended up with the intended list. That's because of two Vite behaviors. Vite applies its default deny list only when `server.fs.deny` is unset, and it compiles the list into a matcher during config resolution, so later changes to the array have no effect.\n\n| setup                              | listening server                | Vite's default deny list | `.vitest-secret-token`              |\n| ---------------------------------- | ------------------------------- | ------------------------ | ----------------------------------- |\n| plain `vitest` / `vitest run`      | none                            | not reachable            | not reachable                       |\n| `--ui` or `api`                    | root                            | denied                   | **served** (fallback location only) |\n| Browser Mode, single project       | root (also the browser server)  | denied                   | **served** (fallback location only) |\n| Browser Mode with `test.projects`  | each browser project's server   | **served**               | denied                              |\n\n- **Project servers** set `deny: ['.vitest-secret-token']` from a `config()` hook, which replaces Vite's defaults. A project server listens on a port in Browser Mode with `test.projects`, so in that setup a request like `GET /.env?raw` returns the file. A plain `GET /.env` is also served as `text/javascript`, so a malicious page can include it with `<script src=\"http://localhost:<port>/.env\">`. A classic script include needs no CORS, and each dotenv line whose value is valid JavaScript (a quoted string, number, or boolean) runs as a global assignment the page can read. A syntax error anywhere in the file, such as a `#` comment, keeps the whole script from running. The same missing defaults also loosen Browser Mode's file-access checks for `server.readFile`/`writeFile`/`removeFile`, screenshots, and traces.\n- **The root server** adds the token entry after Vite has compiled the matcher, so the entry is never applied. The token file normally lives in the per-user data directory, which is outside `server.fs.allow`. When that directory can't be written, for example in a container whose user has no writable `HOME`, Vitest falls back to `<workspaceRoot>/node_modules/.vitest/.vitest-secret-token`, which the root server then serves. The token authenticates the UI, `/__vitest_attachment__`, and the API WebSocket, whose RPC can write and rerun test files when `api.allowWrite`/`api.allowExec` are enabled.\n\n### Impact\n\nInformation disclosure from the Vitest dev server, and with the token, privileged API access.\n\n- **From a malicious website**, in Browser Mode with `test.projects`: while the browser server runs, any page the developer visits can read `.env` values that are valid JavaScript, through a classic `<script>` include. This works when the file consists of `KEY=\"value\"` lines. An unquoted value causes a runtime error that stops the script at that line, so only the lines before it leak. A syntax error anywhere in the file, such as a `#` comment line or an `export` prefix, prevents the script from running at all. Recent Chrome versions may ask for Local Network Access permission first. `fetch` and XHR reads from other websites are still blocked by Vite's default CORS policy, and Vite's `Host` check blocks DNS rebinding. That CORS policy does allow localhost origins, so a page served from another local dev server could read full files. The token file can't be read through a classic `<script>`, because a bare token isn't valid JavaScript.\n- **With local access or developer-set network exposure** (such as `api.host` or `browser.api.host`, port forwarding, or a published container port): full file contents are readable over plain HTTP, including the token file when it's in the fallback location.\n\nOnly the machine running Vitest is exposed, while it runs one of the setups above. Applications built or deployed from the project aren't affected.\n\nThe fix is in `vitest` `<PATCHED>`. Vitest 4 and earlier are unaffected. They don't persist an API token, and they don't override `server.fs.deny`.\n\n### Workaround\n\nSet `server.fs.deny` explicitly in the root Vitest config, including Vite's default list for your Vite version and the token file. For Vite 8.3:\n\n```ts\nexport default defineConfig({\n  server: {\n    fs: {\n      deny: [\n        '.env',\n        '.env.*',\n        '*.{crt,pem,key,p12,pfx,cer,der}',\n        '.npmrc',\n        '.yarnrc.yml',\n        '**/.git/**',\n        '.vitest-secret-token',\n      ],\n    },\n  },\n})\n```","state":0,"publishedAt":"2026-10-21T19:57:00+00:00","modifiedAt":"2026-10-21T20:01:39.8626798+00:00","affected":[{"ecosystem":"npm","name":"@vitest/ui","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"5.0.0-beta.6"},{"kind":"fixed","version":"5.0.5"}]}],"versions":[],"rawVersionEvidence":null},{"ecosystem":"npm","name":"@vitest/browser","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"5.0.0-beta.6"},{"kind":"fixed","version":"5.0.5"}]}],"versions":[],"rawVersionEvidence":null},{"ecosystem":"npm","name":"vite-plus","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"1.0.0-rc.0"},{"kind":"fixed","version":"1.3.0"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[{"system":"CVSS_V3","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N","score":null,"severity":null},{"system":"Publisher rating","vector":null,"score":null,"severity":"MODERATE"}],"references":["https://github.com/vitest-dev/vitest/security/advisories/GHSA-p458-7748-mcp3","https://nvd.nist.gov/vuln/detail/CVE-2026-112948","https://github.com/vitest-dev/vitest/pull/11578","https://github.com/vitest-dev/vitest/commit/28dc1edfb6ba5a181fe208576989063795aeadb3","https://github.com/vitest-dev/vitest","https://github.com/vitest-dev/vitest/releases/tag/v5.0.5"],"sourceUrl":"https://github.com/advisories/GHSA-p458-7748-mcp3","license":"GitHub Advisory Database · CC-BY-4.0","key":"osv:GHSA-p458-7748-mcp3","identifiers":["GHSA-p458-7748-mcp3","CVE-2026-112948"]},"retained":false,"historicalAffected":[]}],"coverage":[{"source":"cisa-kev:global","scope":"Complete CISA KEV catalog; all vendors. Missing entries do not establish absence of exploitation.","generation":"2026-11-08T09:05:07.1353409+00:00","complete":true,"records":1769,"lastAttemptAt":"2026-11-08T09:05:07.1353409+00:00","lastSuccessAt":"2026-11-08T09:05:07.314358+00:00","error":null,"lastVerifiedAt":"2026-11-08T09:05:07.3144897+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"cve-program","scope":"Official CVE Program baseline and cumulative hourly delta; all vendors, published and rejected records","generation":"cve-eaa64dac63caa79c8d4905619258c41c51b39e461b996124e1a21b5e85e7e738-e58a079eb6f76d5949b871c295ad9e8f78e928765ff9950581a38d46375b9852","complete":true,"records":421096,"lastAttemptAt":"2026-11-08T09:04:21.5548423+00:00","lastSuccessAt":"2026-11-08T07:59:14.3145447+00:00","error":"HttpRequestException","lastVerifiedAt":"2026-11-08T07:59:14.338564+00:00","snapshotPublishedAt":"2026-11-08T07:27:32+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"euvd","scope":"Rolling EUVD lookups of CVE aliases in current public OSV archives; 500 identifiers per refresh, rechecked after 48 hours. Not a global EUVD catalog. Successful not-found lookups count as checked; they do not imply withdrawal or safety. No reader inventory is sent.","generation":"enrichment-ce0df89a405747cda5b7c61ae0b48fb2","complete":true,"records":13633,"lastAttemptAt":"2026-11-08T09:05:09.4085736+00:00","lastSuccessAt":"2026-11-08T05:08:40.263+00:00","error":null,"lastVerifiedAt":"2026-11-08T05:08:40.263+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":13685,"expectedIdentifiers":13685,"failedIdentifiers":0},{"source":"first-epss:nuget","scope":"FIRST EPSS for explicit CVE aliases in the collected public NuGet archive. Not a global EPSS backfill.","generation":"2026-11-08T09:05:07.1353409+00:00","complete":true,"records":1096,"lastAttemptAt":"2026-11-08T09:05:07.1353409+00:00","lastSuccessAt":"2026-11-08T09:05:07.4545479+00:00","error":null,"lastVerifiedAt":"2026-11-08T09:05:07.4545481+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"nvd","scope":"Rolling NVD lookups of CVE aliases in current public OSV archives; 500 identifiers per refresh, rechecked after 48 hours. Not a global NVD catalog. Successful not-found lookups count as checked; they do not imply withdrawal or safety. No reader inventory is sent.","generation":"enrichment-2404c35233cd476289f9792161a850e3","complete":true,"records":13645,"lastAttemptAt":"2026-11-08T09:05:08.6143971+00:00","lastSuccessAt":"2026-11-08T08:59:23.805+00:00","error":null,"lastVerifiedAt":"2026-11-08T08:59:23.805+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":13685,"expectedIdentifiers":13685,"failedIdentifiers":0},{"source":"osv:Go","scope":"Complete OSV Go ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"go-0eb4d6dde62dffacd040ad992d4fd5a65cd7d0dc5f5f4cfa8b41967fc6f9ca5f","complete":true,"records":9914,"lastAttemptAt":"2026-11-08T09:05:07.0080286+00:00","lastSuccessAt":"2026-11-06T20:10:36.6450506+00:00","error":null,"lastVerifiedAt":"2026-11-08T09:05:07.0080286+00:00","snapshotPublishedAt":"2026-11-06T20:02:57+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:NuGet","scope":"Complete OSV NuGet ecosystem archive, including GitHub Advisory Database records; NuGet version matching only","generation":"nuget-fde804134ecdda0ddd5ff5c26ee1fff5a6fa659311f7ef2e51c6ad54964db0e2","complete":true,"records":1971,"lastAttemptAt":"2026-11-08T09:05:03.7558577+00:00","lastSuccessAt":"2026-11-06T19:03:17.0399903+00:00","error":"HttpRequestException","lastVerifiedAt":"2026-11-08T08:58:58.22321+00:00","snapshotPublishedAt":"2026-11-06T18:17:57+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:crates.io","scope":"Complete OSV crates.io ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"crates.io-335633e78a15c9cde10a6025895b5617717087fb945489ae7e15d377bacf34a9","complete":true,"records":3055,"lastAttemptAt":"2026-11-08T09:05:07.0409305+00:00","lastSuccessAt":"2026-11-06T16:03:00.7615789+00:00","error":null,"lastVerifiedAt":"2026-11-08T09:05:07.0409305+00:00","snapshotPublishedAt":"2026-11-06T16:02:48+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:npm","scope":"Complete OSV npm ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"npm-8efbf882841c7fda0cba0c3b55677f4781f461b96ab83577ad2701c4eaf88b1e","complete":true,"records":231293,"lastAttemptAt":"2026-11-08T09:05:06.6586785+00:00","lastSuccessAt":"2026-11-08T08:01:14.837451+00:00","error":null,"lastVerifiedAt":"2026-11-08T09:05:06.6586785+00:00","snapshotPublishedAt":"2026-11-08T07:33:16+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null}]}