Vitest browser mode serves arbitrary files
Summary
__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.
Details
This __screenshot-error handler on the browser mode HTTP server responds any file on the file system.
https://github.com/vitest-dev/vitest/blob/f17918a79969d27a415f70431e08a9445b051e45/packages/browser/src/node/plugin.ts#L88-L130
This code was added by https://github.com/vitest-dev/vitest/commit/2d62051f13b4b0939b2f7e94e88006d830dc4d1f.
PoC
- Create a directory and change the current directory to that directory
- Run
npx vitest init browser - Run
npm run test:browser - Run
curl http://localhost:63315/__screenshot-error?file=/path/to/any/file
Impact
Users explicitly exposing the browser mode server to the network by browser.api.host: true may get any files exposed.
Affected Packages
| Ecosystem | Package | Vulnerable Versions | Patched Version |
|---|---|---|---|
| npm |
@vitest/browser
|
>= 3.0.0, < 3.0.4>= 2.0.4, < 2.1.9 |
3.0.4
|
chore(deps): bump the minor-and-patch group across 1 directory with 25 updates
Open about 9 hours agoBuild(deps): Bump the npm_and_yarn group across 1 directory with 5 updates
Closed 4 months agoBump the npm_and_yarn group across 11 directories with 4 updates
Open 4 months agoBump the npm_and_yarn group across 12 directories with 4 updates
Closed 4 months agochore(deps): bump the npm_and_yarn group across 4 directories with 4 updates
Closed 4 months agobuild(deps): bump the npm_and_yarn group across 1 directory with 5 updates
Closed 4 months agobuild(deps): bump the pnpm-workspace group across 1 directory with 6 updates
Closed 4 months agobuild(deps-dev): Bump the dev-dependencies group with 4 updates
Open 4 months agoBump the npm_and_yarn group across 1 directory with 26 updates
Open 4 months agoBump vitest from 2.1.2 to 2.1.9 in /backend
Open 4 months agobuild(deps): bump the backend-minor-patch group in /novaRewards/backend with 11 updates
Closed 5 months agochore(deps-dev): bump vitest from 2.1.8 to 2.1.9
Closed 5 months agochore(deps-dev): bump vitest from 3.0.2 to 3.0.5 in /packages/app-core/test/contracts/lib/openzeppelin-contracts in the npm_and_yarn group across 1 directory
Open 5 months agobuild(deps): bump the npm_and_yarn group across 7 directories with 19 updates
Open 5 months agoBump the npm_and_yarn group across 1 directory with 23 updates
Open 5 months agoBump the npm_and_yarn group across 1 directory with 23 updates
Open 5 months agochore(deps): bump the npm_and_yarn group across 6 directories with 13 updates
Closed 5 months agobuild(deps): bump the npm_and_yarn group across 5 directories with 18 updates
Open 5 months agobuild(deps-dev): Bump vitest from 3.0.0 to 3.0.5 in /packages/agentmesh-integrations/copilot-governance
Closed 6 months agobuild(deps-dev): Bump vitest from 3.0.0 to 3.0.5 in /packages/agentmesh-integrations/mastra-agentmesh
Open 6 months agochore(deps): bump the npm_and_yarn group across 1 directory with 6 updates
Closed 6 months agochore(deps): bump the npm_and_yarn group across 2 directories with 18 updates
Open 6 months agochore(deps): bump the npm_and_yarn group across 3 directories with 9 updates
Closed 6 months agochore(deps): bump the dependencies group across 1 directory with 13 updates
Open 6 months agochore(deps): bump the npm_and_yarn group across 3 directories with 19 updates
Open 6 months agoBump the npm_and_yarn group across 7 directories with 21 updates
Closed 6 months agochore(deps): bump the npm_and_yarn group across 3 directories with 19 updates
Closed 6 months agochore(deps): bump the npm_and_yarn group across 3 directories with 24 updates
Open 6 months agoBump the npm_and_yarn group across 1 directory with 14 updates
Open 6 months agochore(deps): bump the npm_and_yarn group across 2 directories with 18 updates
Closed 6 months agochore(deps): bump the npm_and_yarn group across 4 directories with 12 updates
Closed 6 months agochore(deps): bump the npm_and_yarn group across 3 directories with 27 updates
Open 6 months agobuild(deps): bump the npm_and_yarn group across 5 directories with 15 updates
Closed 6 months agochore(deps): bump the npm_and_yarn group across 4 directories with 12 updates
Closed 6 months agoBump the npm_and_yarn group across 1 directory with 2 updates
Open 7 months agobuild(deps): bump the npm_and_yarn group across 3 directories with 8 updates
Open 7 months agobuild(deps): bump the npm_and_yarn group across 8 directories with 10 updates
Open 7 months agochore(deps): bump the npm_and_yarn group across 4 directories with 18 updates
Closed 7 months agochore(deps): bump the npm_and_yarn group across 2 directories with 27 updates
Open 7 months agochore(deps): bump the npm_and_yarn group across 4 directories with 17 updates
Closed 7 months agochore(deps): bump the npm_and_yarn group across 4 directories with 17 updates
Closed 7 months agoBump the npm_and_yarn group across 1 directory with 24 updates
Open 7 months agoBump the npm_and_yarn group across 3 directories with 14 updates
Open 7 months agobuild(deps): bump the npm_and_yarn group across 4 directories with 20 updates
Open 7 months agochore(deps): bump the npm_and_yarn group across 8 directories with 14 updates
Closed 7 months agochore(deps): bump the npm_and_yarn group across 6 directories with 10 updates
Open 7 months agobuild(deps): bump the npm_and_yarn group across 4 directories with 21 updates
Closed 7 months agobuild(deps): bump the npm_and_yarn group across 3 directories with 7 updates
Closed 7 months agobuild(deps): bump the npm_and_yarn group across 2 directories with 8 updates
Closed 7 months agobuild(deps): bump the npm_and_yarn group across 4 directories with 20 updates
Closed 7 months agoActions
Advisory Details
| Published: | February 04, 2025 over 1 year ago |
| Updated: | September 12, 2026 4 days ago |
| CVSS Score: | 5.9 CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N |
| EPSS: | 2.40% 83th percentile |
| Source: | Github |
| Classification: | GENERAL |
| UUID: | GSA_kwCzR0hTQS04Z3ZjLWoyNzMtNHdtNc4ABEIy |
PR Statistics
References
- https://github.com/vitest-dev/vitest/security/advisories/GHSA-8gvc-j273-4wm5
- https://github.com/vitest-dev/vitest/commit/2d62051f13b4b0939b2f7e94e88006d830dc4d1f
- https://github.com/vitest-dev/vitest/commit/ed9aeba212df04b83ed01810780663ff2cdd0adf
- https://nvd.nist.gov/vuln/detail/CVE-2025-24963
- https://github.com/vitest-dev/vitest/blob/f17918a79969d27a415f70431e08a9445b051e45/packages/browser/src/node/plugin.ts#L88-L130
- https://vitest.dev/guide/browser/config.html#browser-api
- https://github.com/advisories/GHSA-8gvc-j273-4wm5