-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
fix: validate websocket request #7317
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
fix: shouldHandle cannot be async wip: copy isHostAllowed chore: move code chore: comment wip: allow only same origin chore: cleanup wip: isApiRequestAllowed chore: cleanup wip: switch to token check chore: unused fix: inject VITEST_API_TOKEN in orchestrator ui docs: add api.allowedHosts fix: require token for __vitest_browser_api__ request chore: cleanup refactor: combine to isWebsocketRequestAllowed
✅ Deploy Preview for vitest-dev ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The token protection looks good to me.
The allowedHosts part is something I don't really understand. The WS endpoints will still be responding to any client that has the token. We are not passing allowedHosts anywhere else, so users still won't be able to open Vitest UI or browser from these. I don't understand why allowedHosts is needed here.
Co-authored-by: Ari Perkkiö <[email protected]>
This reverts commit 7f91828.
Co-authored-by: Ari Perkkiö <[email protected]>
##### [v3.0.5](https://github.com/vitest-dev/vitest/releases/tag/v3.0.5) ##### 🚀 Features - **ui**: Insert message "no tests found" in ui - by [@DevJoaoLopes](https://github.com/DevJoaoLopes) in vitest-dev/vitest#7366 [<samp>(92da4)</samp>](vitest-dev/vitest@92da490bd) ##### 🐞 Bug Fixes - Validate websocket request - by [@hi-ogawa](https://github.com/hi-ogawa) and [@AriPerkkio](https://github.com/AriPerkkio) in vitest-dev/vitest#7317 [<samp>(191ef)</samp>](vitest-dev/vitest@191ef9e34) - Don't toggle cli cursor on non-TTY - by [@AriPerkkio](https://github.com/AriPerkkio) in vitest-dev/vitest#7336 [<samp>(3c805)</samp>](vitest-dev/vitest@3c8050e69) - **vite-node**: Differentiate file url with hash and query - by [@hi-ogawa](https://github.com/hi-ogawa) in vitest-dev/vitest#7365 [<samp>(926ca)</samp>](vitest-dev/vitest@926ca9546) ##### [View changes on GitHub](vitest-dev/vitest@v3.0.4...v3.0.5)
##### [v3.0.5](https://github.com/vitest-dev/vitest/releases/tag/v3.0.5) This release includes security patches for: - [Remote Code Execution when accessing a malicious website while Vitest API server is listening | CVE-2025-24964](GHSA-9crc-q9x8-hgqq) ##### 🚀 Features - **ui**: Insert message "no tests found" in ui - by [@DevJoaoLopes](https://github.com/DevJoaoLopes) in vitest-dev/vitest#7366 [<samp>(92da4)</samp>](vitest-dev/vitest@92da490bd) ##### 🐞 Bug Fixes - Validate websocket request - by [@hi-ogawa](https://github.com/hi-ogawa) and [@AriPerkkio](https://github.com/AriPerkkio) in vitest-dev/vitest#7317 [<samp>(191ef)</samp>](vitest-dev/vitest@191ef9e34) - Don't toggle cli cursor on non-TTY - by [@AriPerkkio](https://github.com/AriPerkkio) in vitest-dev/vitest#7336 [<samp>(3c805)</samp>](vitest-dev/vitest@3c8050e69) - **vite-node**: Differentiate file url with hash and query - by [@hi-ogawa](https://github.com/hi-ogawa) in vitest-dev/vitest#7365 [<samp>(926ca)</samp>](vitest-dev/vitest@926ca9546) ##### [View changes on GitHub](vitest-dev/vitest@v3.0.4...v3.0.5)
##### [v3.0.5](https://github.com/vitest-dev/vitest/releases/tag/v3.0.5) This release includes security patches for: - [Remote Code Execution when accessing a malicious website while Vitest API server is listening | CVE-2025-24964](GHSA-9crc-q9x8-hgqq) ##### 🚀 Features - **ui**: Insert message "no tests found" in ui - by [@DevJoaoLopes](https://github.com/DevJoaoLopes) in vitest-dev/vitest#7366 [<samp>(92da4)</samp>](vitest-dev/vitest@92da490bd) ##### 🐞 Bug Fixes - Validate websocket request - by [@hi-ogawa](https://github.com/hi-ogawa) and [@AriPerkkio](https://github.com/AriPerkkio) in vitest-dev/vitest#7317 [<samp>(191ef)</samp>](vitest-dev/vitest@191ef9e34) - Don't toggle cli cursor on non-TTY - by [@AriPerkkio](https://github.com/AriPerkkio) in vitest-dev/vitest#7336 [<samp>(3c805)</samp>](vitest-dev/vitest@3c8050e69) - **vite-node**: Differentiate file url with hash and query - by [@hi-ogawa](https://github.com/hi-ogawa) in vitest-dev/vitest#7365 [<samp>(926ca)</samp>](vitest-dev/vitest@926ca9546) ##### [View changes on GitHub](vitest-dev/vitest@v3.0.4...v3.0.5)
##### [v3.0.5](https://github.com/vitest-dev/vitest/releases/tag/v3.0.5) This release includes security patches for: - [Remote Code Execution when accessing a malicious website while Vitest API server is listening | CVE-2025-24964](GHSA-9crc-q9x8-hgqq) ##### 🚀 Features - **ui**: Insert message "no tests found" in ui - by [@DevJoaoLopes](https://github.com/DevJoaoLopes) in vitest-dev/vitest#7366 [<samp>(92da4)</samp>](vitest-dev/vitest@92da490bd) ##### 🐞 Bug Fixes - Validate websocket request - by [@hi-ogawa](https://github.com/hi-ogawa) and [@AriPerkkio](https://github.com/AriPerkkio) in vitest-dev/vitest#7317 [<samp>(191ef)</samp>](vitest-dev/vitest@191ef9e34) - Don't toggle cli cursor on non-TTY - by [@AriPerkkio](https://github.com/AriPerkkio) in vitest-dev/vitest#7336 [<samp>(3c805)</samp>](vitest-dev/vitest@3c8050e69) - **vite-node**: Differentiate file url with hash and query - by [@hi-ogawa](https://github.com/hi-ogawa) in vitest-dev/vitest#7365 [<samp>(926ca)</samp>](vitest-dev/vitest@926ca9546) ##### [View changes on GitHub](vitest-dev/vitest@v3.0.4...v3.0.5)
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [@vitest/coverage-v8](https://github.com/vitest-dev/vitest/tree/main/packages/coverage-v8#readme) ([source](https://github.com/vitest-dev/vitest/tree/HEAD/packages/coverage-v8)) | devDependencies | patch | [`3.0.4` -> `3.0.5`](https://renovatebot.com/diffs/npm/@vitest%2fcoverage-v8/3.0.4/3.0.5) | | [vitest](https://github.com/vitest-dev/vitest) ([source](https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest)) | devDependencies | patch | [`3.0.4` -> `3.0.5`](https://renovatebot.com/diffs/npm/vitest/3.0.4/3.0.5) | --- ### Release Notes <details> <summary>vitest-dev/vitest (@​vitest/coverage-v8)</summary> ### [`v3.0.5`](https://github.com/vitest-dev/vitest/releases/tag/v3.0.5) [Compare Source](vitest-dev/vitest@v3.0.4...v3.0.5) This release includes security patches for: - [Remote Code Execution when accessing a malicious website while Vitest API server is listening | CVE-2025-24964](GHSA-9crc-q9x8-hgqq) ##### 🚀 Features - **ui**: Insert message "no tests found" in ui - by [@​DevJoaoLopes](https://github.com/DevJoaoLopes) in vitest-dev/vitest#7366 [<samp>(92da4)</samp>](vitest-dev/vitest@92da490bd) ##### 🐞 Bug Fixes - Validate websocket request - by [@​hi-ogawa](https://github.com/hi-ogawa) and [@​AriPerkkio](https://github.com/AriPerkkio) in vitest-dev/vitest#7317 [<samp>(191ef)</samp>](vitest-dev/vitest@191ef9e34) - Don't toggle cli cursor on non-TTY - by [@​AriPerkkio](https://github.com/AriPerkkio) in vitest-dev/vitest#7336 [<samp>(3c805)</samp>](vitest-dev/vitest@3c8050e69) - **vite-node**: Differentiate file url with hash and query - by [@​hi-ogawa](https://github.com/hi-ogawa) in vitest-dev/vitest#7365 [<samp>(926ca)</samp>](vitest-dev/vitest@926ca9546) ##### [View changes on GitHub](vitest-dev/vitest@v3.0.4...v3.0.5) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xNTcuMCIsInVwZGF0ZWRJblZlciI6IjM5LjE1OS4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119--> Reviewed-on: https://gitea.justinelmore.dev/jelmore1674/build-changelog/pulls/85 Co-authored-by: Renovate Bot <[email protected]> Co-committed-by: Renovate Bot <[email protected]>
Description
summary
Adds
?token=xxxrequirement for websocket upgrade request on__vitest__api__and__vitest_browser_api__. Token is randomly generated on the server and it's injected in ui, tester, and orchestrator html, which are not accessible from cross origin.Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
pnpm-lock.yamlunless you introduce a new test example.Tests
pnpm test:ci.Documentation
pnpm run docscommand.Changesets
feat:,fix:,perf:,docs:, orchore:.