{"id":"CVE-2025-24963","aliases":["EUVD-2025-0224","GHSA-8gvc-j273-4wm5"],"status":"published","title":"Browser mode serves arbitrary files in vitest","description":"Vitest is a testing framework powered by Vite. The `__screenshot-error` handler on the browser mode HTTP server that responds any file on the file system. Especially if the server is exposed on the network by `browser.api.host: true`, an attacker can send a request to that handler from remote to get the content of arbitrary files.This `__screenshot-error` handler on the browser mode HTTP server responds any file on the file system. This code was added by commit `2d62051`. Users explicitly exposing the browser mode server to the network by `browser.api.host: true` may get any files exposed. This issue has been addressed in versions 2.1.9 and 3.0.4. Users are advised to upgrade. There are no known workarounds for this vulnerability.","severity":{"version":"3.1","score":5.9,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N","level":"medium","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-11","score":0.02353,"percentile":0.83937,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":true,"fix_available":true},"cwes":["CWE-22"],"published":"2025-02-04T16:51:08Z","modified":"2026-10-28T02:30:28Z","exploits":[{"source":"pocgithub","id":"hiteshpatra/CVE-2025-24963","title":"hiteshpatra/CVE-2025-24963","date":"2025-04-23","url":"https://github.com/hiteshpatra/CVE-2025-24963"},{"source":"nuclei","id":"CVE-2025-24963","title":"Vitest Browser Mode - Local File Read","type":"detection template","url":"https://github.com/projectdiscovery/nuclei-templates/blob/main/http/cves/2025/CVE-2025-24963.yaml"}],"fixes":[{"ecosystem":"npm","package":"@vitest/browser","fixed_in":["2.1.9","3.0.4"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"npm","package":"@vitest/browser","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"2.0.4"},{"fixed":"2.1.9"}]}]},{"source":"ghsa","ecosystem":"npm","package":"@vitest/browser","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"3.0.0"},{"fixed":"3.0.4"}]}]},{"source":"osv","ecosystem":"npm","package":"@vitest/browser","ranges":[{"type":"SEMVER","events":[{"introduced":"2.0.4"},{"fixed":"2.1.9"}]}]},{"source":"osv","ecosystem":"npm","package":"@vitest/browser","ranges":[{"type":"SEMVER","events":[{"introduced":"3.0.0"},{"fixed":"3.0.4"}]}]}],"products":[{"vendor":"vitest-dev","product":"vitest"},{"vendor":"vitest.dev","product":"vitest"}],"references":[{"url":"https://github.com/vitest-dev/vitest/security/advisories/GHSA-8gvc-j273-4wm5","tags":["x_refsource_CONFIRM","Vendor Advisory","advisory","web"]},{"url":"https://github.com/vitest-dev/vitest/commit/2d62051f13b4b0939b2f7e94e88006d830dc4d1f","tags":["x_refsource_MISC","Patch","fix","web"]},{"url":"https://github.com/vitest-dev/vitest/blob/f17918a79969d27a415f70431e08a9445b051e45/packages/browser/src/node/plugin.ts#L88-L130","tags":["x_refsource_MISC","Product","web"]},{"url":"https://vitest.dev/guide/browser/config.html#browser-api","tags":["x_refsource_MISC","Product","web"]},{"url":"https://github.com/vitest-dev/vitest/commit/ed9aeba212df04b83ed01810780663ff2cdd0adf","tags":["web"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-24963","tags":["advisory"]},{"url":"https://github.com/advisories/GHSA-8gvc-j273-4wm5"},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/24xxx/CVE-2025-24963.json","tags":["advisory"]},{"url":"https://github.com/vitest-dev/vitest","tags":["package"]}],"sources":{"cve":[{"id":"CVE-2025-24963","title":"Browser mode serves arbitrary files in vitest","description":"Vitest is a testing framework powered by Vite. The `__screenshot-error` handler on the browser mode HTTP server that responds any file on the file system. Especially if the server is exposed on the network by `browser.api.host: true`, an attacker can send a request to that handler from remote to get the content of arbitrary files.This `__screenshot-error` handler on the browser mode HTTP server responds any file on the file system. This code was added by commit `2d62051`. Users explicitly exposing the browser mode server to the network by `browser.api.host: true` may get any files exposed. This issue has been addressed in versions 2.1.9 and 3.0.4. Users are advised to upgrade. There are no known workarounds for this vulnerability.","status":"published","published":"2025-02-04T19:36:52.385Z","modified":"2025-02-12T20:51:28.011Z","cvss":[{"version":"3.1","score":5.9,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N","level":"medium","assessor":"cna"}],"cwes":["CWE-22"],"updated_at":"2026-11-02T14:32:44.11109Z"}],"euvd":[{"id":"EUVD-2025-0224","description":"Vitest is a testing framework powered by Vite. The `__screenshot-error` handler on the browser mode HTTP server that responds any file on the file system. Especially if the server is exposed on the network by `browser.api.host: true`, an attacker can send a request to that handler from remote to get the content of arbitrary files.This `__screenshot-error` handler on the browser mode HTTP server responds any file on the file system. This code was added by commit `2d62051`. Users explicitly exposing the browser mode server to the network by `browser.api.host: true` may get any files exposed. This issue has been addressed in versions 2.1.9 and 3.0.4. Users are advised to upgrade. There are no known workarounds for this vulnerability.","status":"published","published":"2025-02-04T19:36:52Z","modified":"2025-02-12T20:51:28Z","cvss":[{"version":"3.1","score":5.9,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N","level":"medium"}],"updated_at":"2026-11-03T00:03:55.950052Z"}],"ghsa":[{"id":"GHSA-8gvc-j273-4wm5","title":"Vitest browser mode serves arbitrary files","description":"### Summary\n`__screenshot-error` handler on the browser mode HTTP server that responds any file on the file system. Especially if the server is exposed on the network by [`browser.api.host: true`](https://vitest.dev/guide/browser/config.html#browser-api), an attacker can send a request to that handler from remote to get the content of arbitrary files.\n\n### Details\nThis `__screenshot-error` handler on the browser mode HTTP server responds any file on the file system.\nhttps://github.com/vitest-dev/vitest/blob/f17918a79969d27a415f70431e08a9445b051e45/packages/browser/src/node/plugin.ts#L88-L130\n\nThis code was added by https://github.com/vitest-dev/vitest/commit/2d62051f13b4b0939b2f7e94e88006d830dc4d1f.\n\n### PoC\n1. Create a directory and change the current directory to that directory\n1. Run `npx vitest init browser`\n1. Run `npm run test:browser`\n2. Run `curl http://localhost:63315/__screenshot-error?file=/path/to/any/file`\n\n### Impact\nUsers explicitly exposing the browser mode server to the network by [`browser.api.host: true`](https://vitest.dev/guide/browser/config.html#browser-api) may get any files exposed.","status":"published","published":"2025-02-04T16:51:08Z","modified":"2026-04-07T16:20:19Z","cvss":[{"version":"3.1","score":5.9,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N","level":"medium"}],"cwes":["CWE-22"],"updated_at":"2026-11-02T14:39:50.076383Z"}],"nvd":[{"id":"CVE-2025-24963","description":"Vitest is a testing framework powered by Vite. The `__screenshot-error` handler on the browser mode HTTP server that responds any file on the file system. Especially if the server is exposed on the network by `browser.api.host: true`, an attacker can send a request to that handler from remote to get the content of arbitrary files.This `__screenshot-error` handler on the browser mode HTTP server responds any file on the file system. This code was added by commit `2d62051`. Users explicitly exposing the browser mode server to the network by `browser.api.host: true` may get any files exposed. This issue has been addressed in versions 2.1.9 and 3.0.4. Users are advised to upgrade. There are no known workarounds for this vulnerability.","status":"published","published":"2025-02-04T20:15:50.33Z","modified":"2026-06-17T08:59:53.44Z","cvss":[{"version":"3.1","score":5.9,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N","level":"medium","assessor":"secondary"},{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","level":"high","assessor":"primary"}],"cwes":["CWE-22"],"updated_at":"2026-11-02T14:10:50.916773Z"}],"osv":[{"id":"CVE-2025-24963","title":"Browser mode serves arbitrary files in vitest","description":"Vitest is a testing framework powered by Vite. The `__screenshot-error` handler on the browser mode HTTP server that responds any file on the file system. Especially if the server is exposed on the network by `browser.api.host: true`, an attacker can send a request to that handler from remote to get the content of arbitrary files.This `__screenshot-error` handler on the browser mode HTTP server responds any file on the file system. This code was added by commit `2d62051`. Users explicitly exposing the browser mode server to the network by `browser.api.host: true` may get any files exposed. This issue has been addressed in versions 2.1.9 and 3.0.4. Users are advised to upgrade. There are no known workarounds for this vulnerability.","status":"published","published":"2025-02-04T19:36:52.385Z","modified":"2026-10-28T02:30:28.60552139Z","cvss":[{"version":"3.1","score":5.9,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N","level":"medium"}],"cwes":["CWE-22"],"updated_at":"2026-11-02T15:44:47.386092Z"},{"id":"GHSA-8gvc-j273-4wm5","title":"Vitest browser mode serves arbitrary files","description":"### Summary\n`__screenshot-error` handler on the browser mode HTTP server that responds any file on the file system. Especially if the server is exposed on the network by [`browser.api.host: true`](https://vitest.dev/guide/browser/config.html#browser-api), an attacker can send a request to that handler from remote to get the content of arbitrary files.\n\n### Details\nThis `__screenshot-error` handler on the browser mode HTTP server responds any file on the file system.\nhttps://github.com/vitest-dev/vitest/blob/f17918a79969d27a415f70431e08a9445b051e45/packages/browser/src/node/plugin.ts#L88-L130\n\nThis code was added by https://github.com/vitest-dev/vitest/commit/2d62051f13b4b0939b2f7e94e88006d830dc4d1f.\n\n### PoC\n1. Create a directory and change the current directory to that directory\n1. Run `npx vitest init browser`\n1. Run `npm run test:browser`\n2. Run `curl http://localhost:63315/__screenshot-error?file=/path/to/any/file`\n\n### Impact\nUsers explicitly exposing the browser mode server to the network by [`browser.api.host: true`](https://vitest.dev/guide/browser/config.html#browser-api) may get any files exposed.","status":"published","published":"2025-02-04T16:51:08Z","modified":"2025-02-04T22:03:47Z","cvss":[{"version":"3.1","score":5.9,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N","level":"medium"}],"cwes":["CWE-22"],"updated_at":"2026-11-02T15:46:42.437513Z"}]}}
