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 API serversequenceDiagram
actor Attacker
participant MW as Malicious Website
participant VS as Vitest API Server
participant FS as File System
Note over VS: API option enabled
Note over VS: No Origin header check
Note over VS: No authorization
Attacker->>MW: Visits malicious website
MW->>VS: WebSocket connection (ws://localhost:51204/__vitest_api__)
VS-->>MW: Connection accepted (vulnerable)
MW->>VS: getFiles request
VS-->>MW: Test file paths
MW->>VS: saveTestFile (inject malicious code)
VS->>FS: Write malicious code to test file
MW->>VS: rerun command
VS->>FS: Execute modified test file
Note over FS: Arbitrary code execution
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
ce53e26 to
cce14a4
Compare
cce14a4 to
9827024
Compare
3e7fbfc to
ab89306
Compare
ab89306 to
9334502
Compare
9334502 to
42a7508
Compare
42a7508 to
c08b5b4
Compare
c08b5b4 to
d075100
Compare
ae3483b to
2599cdd
Compare
2599cdd to
3fe7303
Compare
e3d2a29 to
375bb55
Compare
375bb55 to
b1e831b
Compare
b1e831b to
b32ef06
Compare
b32ef06 to
622d572
Compare
622d572 to
bbfdf05
Compare
04609a7 to
dea32c0
Compare
dea32c0 to
305fe42
Compare
305fe42 to
075f603
Compare
075f603 to
4ccb3fc
Compare
3a06c12 to
ad9c549
Compare
ad9c549 to
bb6fc4a
Compare
bb6fc4a to
73c445a
Compare
832729b to
b841ffa
Compare
b841ffa to
8244856
Compare
8244856 to
1fc298a
Compare
1fc298a to
505db21
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.