Missing Origin Validation in WebSockets Affecting vitest package, versions >=1.0.0 <1.6.1>=2.0.0 <2.1.9<3.0.5


Severity

Recommended
0.0
medium
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of concept

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-JS-VITEST-8688130
  • published5 Feb 2025
  • disclosed4 Feb 2025
  • creditsapphi-red

Introduced: 4 Feb 2025

NewCVE-2025-24964  (opens in a new tab)
CWE-1385  (opens in a new tab)

How to fix?

Upgrade vitest to version 1.6.1, 2.1.9, 3.0.5 or higher.

Overview

vitest is a Next generation testing framework powered by Vite

Affected versions of this package are vulnerable to Missing Origin Validation in WebSockets through the WebSocket server setup, due to missing checks of the Origin header and authorization mechanism. An attacker can execute arbitrary code by injecting malicious code into a test file using the saveTestFile API and subsequently executing the file via the rerun API.

CVSS Scores

version 4.0
version 3.1