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 pull request updates the vitest dependency from version 1.6.0 to 1.6.1 to address a security vulnerability that could allow arbitrary remote code execution through Cross-site WebSocket hijacking attacks. The update includes changes to the WebSocket server to check the Origin header and implement an authorization mechanism. Sequence diagram showing the security vulnerability in Vitest WebSocket APIsequenceDiagram
participant M as Malicious Website
participant B as Browser
participant V as Vitest API Server
participant F as Test Files
Note over V: Before patch: No Origin check
M->>B: Load malicious script
B->>V: WebSocket connection
V-->>B: Connection accepted (no auth)
B->>V: saveTestFile API call
V->>F: Write malicious code
B->>V: rerun API call
V->>F: Execute test file
Note over F: Arbitrary code execution
Note over V: After patch 1.6.1:
Note over V: Added Origin header check
Note over V: Added authorization
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
c026850 to
f2f69b8
Compare
cd8ff45 to
1355aa3
Compare
4a1ddd6 to
1e5ce93
Compare
1e5ce93 to
7cb32b3
Compare
7cb32b3 to
84b453b
Compare
84b453b to
9b1eb70
Compare
9b1eb70 to
c690476
Compare
2d501ec to
7cc754d
Compare
7cc754d to
5ddae81
Compare
5ddae81 to
97e4bce
Compare
feedf90 to
d020703
Compare
d020703 to
cb50d10
Compare
cb50d10 to
c16b867
Compare
c16b867 to
ad45c75
Compare
ad45c75 to
8bcdac4
Compare
db85b1c to
1ac0d33
Compare
1ac0d33 to
63bb69d
Compare
63bb69d to
2294b17
Compare
2294b17 to
ca89868
Compare
63e873e to
f83e651
Compare
f83e651 to
72e9949
Compare
4c73b16 to
e6b382b
Compare
e6b382b to
09f657d
Compare
09f657d to
c030b55
Compare
c030b55 to
936d1bc
Compare
936d1bc to
644ef86
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.