{"id":"CVE-2025-24963","aliases":["CVE-2025-24963","GHSA-8gvc-j273-4wm5"],"related":[],"kind":"vulnerability","state":"published","title":"Browser mode serves arbitrary files in vitest","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"### 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.","format":"markdown","source":"ghsa"},{"lang":"es","text":"Vitest es un framework de prueba desarrollado por Vite. El controlador `__screenshot-error` en el servidor HTTP en modo navegador que responde a cualquier archivo en el archivo sistema. Especialmente si el servidor está expuesto en la red por `browser.api.host: true`, un atacante puede enviar una solicitud a ese controlador desde el control remoto para obtener el contenido de archivos arbitrarios. Este controlador `__screenshot-error` en el servidor HTTP en modo navegador responde a cualquier archivo en el tallo sistema. Este código fue agregado por commit `2d62051`. Los usuarios que expongan explícitamente el servidor en modo navegador a la red por `browser.api.host: true` pueden exponer cualquier archivo. Este problema se ha solucionado en las versiones 2.1.9 y 3.0.4. Se recomienda a los usuarios que actualicen. No se conocen workarounds para esta vulnerabilidad.","source":"nvd"}],"published":"2025-02-04T16:51:08.000Z","modified":"2026-06-17T08:59:53.440Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N","score":5.9,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N","score":5.9,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N","score":5.9,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","score":7.5,"rating":"HIGH"}],"cwes":["CWE-22"],"affected":[{"ranges":[{"version":">= 2.0.4, < 2.1.9","status":"affected"},{"version":">= 3.0.0, < 3.0.4","status":"affected"}],"vendor":"vitest-dev","product":"vitest","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"2.0.4","status":"affected","fixed":"2.1.9"}],"ecosystem":"npm","package":"@vitest/browser","purl":"pkg:npm/%40vitest/browser","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"3.0.0","status":"affected","fixed":"3.0.4"}],"ecosystem":"npm","package":"@vitest/browser","purl":"pkg:npm/%40vitest/browser","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"2.1.9"},{"status":"affected","introduced":"3.0.0","fixed":"3.0.4"}],"vendor":"vitest.dev","product":"vitest","cpe":"cpe:2.3:a:vitest.dev:vitest:*:*:*:*:*:node.js:*:*","source":"nvd"}],"references":[{"url":"https://github.com/vitest-dev/vitest/security/advisories/GHSA-8gvc-j273-4wm5","tags":["vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/vitest-dev/vitest/commit/2d62051f13b4b0939b2f7e94e88006d830dc4d1f","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/vitest-dev/vitest/blob/f17918a79969d27a415f70431e08a9445b051e45/packages/browser/src/node/plugin.ts#L88-L130","tags":["product","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://vitest.dev/guide/browser/config.html#browser-api","tags":["product","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-24963","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/vitest-dev/vitest/commit/ed9aeba212df04b83ed01810780663ff2cdd0adf","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/vitest-dev/vitest","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"total","date":"2025-02-04T19:44:40.367Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-24963","url":"https://www.cve.org/CVERecord?id=CVE-2025-24963","licence":"CVE Terms of Use","modified":"2025-02-12T20:51:28.011Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-8gvc-j273-4wm5","url":"https://github.com/advisories/GHSA-8gvc-j273-4wm5","licence":"CC-BY-4.0","modified":"2025-02-04T22:03:47.000Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-24963","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-24963","licence":"Public domain","modified":"2026-06-17T08:59:53.440Z"}],"updatedAt":"2026-11-25T22:58:53.792Z","epss":{"score":0.02353,"percentile":0.84179,"date":"2026-12-01T12:00:22.000Z"}}