Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
2.1.8
->2.1.9
GitHub Vulnerability Alerts
CVE-2025-24964
Summary
Arbitrary remote Code Execution when accessing a malicious website while Vitest API server is listening by Cross-site WebSocket hijacking (CSWSH) attacks.
Details
When
api
option is enabled (Vitest UI enables it), Vitest starts a WebSocket server. This WebSocket server did not check Origin header and did not have any authorization mechanism and was vulnerable to CSWSH attacks.https://github.com/vitest-dev/vitest/blob/9a581e1c43e5c02b11e2a8026a55ce6a8cb35114/packages/vitest/src/api/setup.ts#L32-L46
This WebSocket server has
saveTestFile
API that can edit a test file andrerun
API that can rerun the tests. An attacker can execute arbitrary code by injecting a code in a test file by thesaveTestFile
API and then running that file by calling thererun
API.https://github.com/vitest-dev/vitest/blob/9a581e1c43e5c02b11e2a8026a55ce6a8cb35114/packages/vitest/src/api/setup.ts#L66-L76
PoC
calc
executable inPATH
env var (you'll likely have it if you are running on Windows), that application will be executed.Impact
This vulnerability can result in remote code execution for users that are using Vitest serve API.
Release Notes
vitest-dev/vitest (vitest)
v2.1.9
Compare Source
🚨 Breaking Changes
coverage.ignoreEmptyLines
by default - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/5543 (31994)pool
to'forks'
- by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/5047 (7f8f9)--merge-reports
to support coverage - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/5736 (b7438)🚀 Features
--output-json
- by @Joristdh in https://github.com/vitest-dev/vitest/issues/5745 (0766b)parseAst
,parseAstAsync
from vite - by @sheremet-va (f645e)click
event - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/5777 (839c3)page.screenshot
method - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/5853 (81c42)userEvent
methods, addfill
anddragAndDrop
events - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/5882 (4dbea)expect.dom
method and bundlejest-dom
matchers with@vitest/browser
- by @sheremet-va in https://github.com/vitest-dev/vitest/issues/5910 (3a96a)tripleClick
to interactive api - by @userquin in https://github.com/vitest-dev/vitest/issues/5987 (200a4)userEvent.upload
in playwright provider - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/6442 (cf148)--inspect
- by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/6433 (0499a)--inspect-brk
- by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/6434 (7ab0f)transformIndexHtml
- by @sheremet-va in https://github.com/vitest-dev/vitest/issues/6725 (16902)thresholds.<glob>.100
option - by @thor-juhasz and @AriPerkkio in https://github.com/vitest-dev/vitest/issues/6174 (f6845)--exclude-after-remap
- by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/6309 (5932a){ spy: true }
instead of a factory - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/6289 (95f02)test.for
- by @hi-ogawa and @sheremet-va in https://github.com/vitest-dev/vitest/issues/5861 (c2380)vi.advanceTimersToNextFrame
- by @bnjm and @sheremet-va in https://github.com/vitest-dev/vitest/issues/6347 (8ff63)🐞 Bug Fixes
--exclude
option - by @fregante in https://github.com/vitest-dev/vitest/issues/5782 (d6700)--inspect-brk
stop on Windows - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/6110 (f8519)require
- by @sheremet-va in https://github.com/vitest-dev/vitest/issues/6159 (807a2)testNamePattern
adds leading space - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/6186 (073a5)index
file - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/6266 (081cf)expect.getState().testPath
always returns correct path - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/6472 (ac698)Vitest.setServer
to postconfigureServer
hook to enable import analysis for workspace config loading - by @hi-ogawa in https://github.com/vitest-dev/vitest/issues/6584 (e7f35)toBeNaN, toBeUndefined, toBeNull, toBeTruthy, toBeFalsy
- by @hi-ogawa in https://github.com/vitest-dev/vitest/issues/6697 (e0027)dangerouslyIgnoreUnhandledErrors
without base reporter - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/6808 (0bf0a)unhandledRejection
even when base reporter is not used - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/6812 (8878b)sequence.concurrent
from theRuntimeConfig
type - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/6880 (6af73).poll
,.element
,.rejects
/.resolves
, andlocator.*
weren't awaited - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/6877 (93b67)project.provide
type - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/5959 (0eda9)BenchmarkResult.samples
array to reduce memory usage - by @hi-ogawa and @AriPerkkio in https://github.com/vitest-dev/vitest/issues/6541 (a6407)preview
provider when running in StackBlitz - by @userquin in https://github.com/vitest-dev/vitest/issues/5836 (76e13)coverage.reporter
from string values - by @AriPerkkio in https://github.com/vitest-dev/vitest/issues/5920 (f33da)crypto.randomUUID
from the client - by @userquin in https://github.com/vitest-dev/vitest/issues/6079 (04c83)afterEach
cleanup hooks in node entrypoint - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/6192 (e6fbc)process
global - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/6213 (1affb)process
global " - by @sheremet-va in https://github.com/vitest-dev/vitest/issues/6213 (9069b)Configuration
📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.