-
Notifications
You must be signed in to change notification settings - Fork 0
chore(deps): update dependency vitest to v1.6.1 [security] #2
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
base: main
Are you sure you want to change the base?
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
|
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.
We have skipped reviewing this pull request. It seems to have been created by a bot (hey, renovate[bot]!). We assume it knows what it's doing!
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
This PR contains the following updates:
1.6.0
->1.6.1
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)
v1.6.1
Compare Source
This release includes security patches for:
🐞 Bug Fixes
View changes on GitHub
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 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.