chore(deps): update dependency vitest to v1.6.1 [security]#2
chore(deps): update dependency vitest to v1.6.1 [security]#2renovate[bot] wants to merge 1 commit into
Conversation
|
Reviewer's Guide by SourceryThis PR updates the vitest dependency from version 1.6.0 to 1.6.1 to address a security vulnerability (CVE-2025-24964) that allows for arbitrary remote code execution. The vulnerability stems from a cross-site WebSocket hijacking (CSWSH) attack when the Sequence diagram showing the security vulnerability in Vitest 1.6.0sequenceDiagram
actor Attacker
participant MW as Malicious Website
participant WS as Vitest WebSocket Server
participant FS as File System
Note over WS: No Origin check or authorization
Attacker->>MW: Visits malicious website
MW->>WS: Connect to ws://localhost:51204/__vitest_api__
WS-->>MW: Connection accepted (vulnerable)
MW->>WS: saveTestFile API call
Note right of WS: Injects malicious code
WS->>FS: Write malicious test file
MW->>WS: rerun API call
WS->>FS: Execute test file
Note right of FS: Arbitrary code execution
Sequence diagram showing the fixed behavior in Vitest 1.6.1sequenceDiagram
actor Attacker
participant MW as Malicious Website
participant WS as Vitest WebSocket Server
participant FS as File System
Note over WS: With Origin check and authorization
Attacker->>MW: Visits malicious website
MW->>WS: Connect to ws://localhost:51204/__vitest_api__
WS-->>MW: Connection rejected (fixed)
Note right of WS: CSWSH attack prevented
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
dbabb9b to
768b68c
Compare
768b68c to
6344bd6
Compare
461b5da to
fe3ebe1
Compare
8f154c4 to
d77e1ea
Compare
d77e1ea to
1257858
Compare
91543dd to
cca6e73
Compare
cca6e73 to
1354085
Compare
1354085 to
d7599ee
Compare
d7599ee to
e1dbad4
Compare
b8db4b2 to
4a5f834
Compare
4a5f834 to
d40fb62
Compare
d40fb62 to
0d2434b
Compare
0d2434b to
00d93f0
Compare
00d93f0 to
f97eac1
Compare
500345e to
6b28ea9
Compare
6b28ea9 to
d398ad6
Compare
d398ad6 to
3eaef0c
Compare
3eaef0c to
4ae8d32
Compare
c95d182 to
98776ae
Compare
98776ae to
cc7f55e
Compare
cc7f55e to
97d49ed
Compare
97d49ed to
051721c
Compare
42f4610 to
d312232
Compare
d312232 to
04c5d55
Compare
04c5d55 to
9c28658
Compare
9c28658 to
e56da88
Compare
This PR contains the following updates:
1.6.0→1.6.1Vitest allows Remote Code Execution when accessing a malicious website while Vitest API server is listening
CVE-2025-24964 / GHSA-9crc-q9x8-hgqq
More information
Details
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
apioption 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
saveTestFileAPI that can edit a test file andrerunAPI that can rerun the tests. An attacker can execute arbitrary code by injecting a code in a test file by thesaveTestFileAPI and then running that file by calling thererunAPI.https://github.com/vitest-dev/vitest/blob/9a581e1c43e5c02b11e2a8026a55ce6a8cb35114/packages/vitest/src/api/setup.ts#L66-L76
PoC
calcexecutable inPATHenv 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.
Severity
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:HReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Release Notes
vitest-dev/vitest (vitest)
v1.6.1Compare Source
This release includes security patches for:
🐞 Bug Fixes
View changes on GitHub
Configuration
📅 Schedule: (UTC)
🚦 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 this update again.
This PR was generated by Mend Renovate. View the repository job log.