The SentinelOne Annual Threat Report - A Defenders Guide from the FrontlinesThe SentinelOne Annual Threat ReportGet the Report
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2025-24964

CVE-2025-24964: Vitest.dev Vitest RCE Vulnerability

CVE-2025-24964 is a remote code execution vulnerability in Vitest.dev Vitest caused by Cross-site WebSocket hijacking. Attackers can exploit the WebSocket API to inject and execute arbitrary code. This article covers technical details, affected versions, impact, and mitigation strategies.

Updated: January 22, 2026

CVE-2025-24964 Overview

CVE-2025-24964 is a critical remote code execution vulnerability affecting Vitest, a popular testing framework powered by Vite. The vulnerability exists in the Vitest API server's WebSocket implementation, which fails to validate the Origin header and lacks proper authorization mechanisms. This weakness enables Cross-site WebSocket Hijacking (CSWSH) attacks, allowing attackers to execute arbitrary code on systems running vulnerable versions of Vitest when the API server is listening.

When the api option is enabled (which is automatically activated by Vitest UI), Vitest starts a WebSocket server that exposes dangerous APIs including saveTestFile and rerun. An attacker can exploit this by luring a developer to visit a malicious website while Vitest is running, injecting malicious code into test files via the saveTestFile API, and then triggering execution through the rerun API.

Critical Impact

Remote code execution is possible when developers access malicious websites while the Vitest API server is active, potentially compromising development environments and source code repositories.

Affected Products

  • Vitest versions prior to 1.6.1
  • Vitest versions 2.x prior to 2.1.9
  • Vitest versions 3.x prior to 3.0.5

Discovery Timeline

  • 2025-02-04 - CVE-2025-24964 published to NVD
  • 2025-12-31 - Last updated in NVD database

Technical Details for CVE-2025-24964

Vulnerability Analysis

This vulnerability stems from the insecure design of Vitest's WebSocket server implementation when the API functionality is enabled. The WebSocket server, used to facilitate communication between the Vitest UI and the testing framework, accepts connections from any origin without verification. This architectural flaw makes it susceptible to Cross-site WebSocket Hijacking (CSWSH) attacks.

The attack chain leverages two exposed WebSocket APIs:

  1. saveTestFile API - Allows writing arbitrary content to test files in the project
  2. rerun API - Triggers execution of test files, including any malicious code injected via saveTestFile

By combining these APIs, an attacker can achieve full remote code execution within the context of the Node.js process running Vitest. The vulnerable code can be found in the Vitest API setup implementation.

Root Cause

The root cause of CVE-2025-24964 is the absence of Origin header validation and authentication mechanisms in the Vitest WebSocket server. According to CWE-1385 (Missing Origin Validation in WebSockets), web applications that use WebSocket connections must validate the Origin header to prevent cross-origin attacks. The Vitest implementation failed to implement this security control, allowing malicious websites to establish WebSocket connections and invoke sensitive APIs. Additionally, there was no authorization mechanism to restrict which clients could call dangerous APIs like saveTestFile and rerun.

Attack Vector

The attack is network-based and requires user interaction—specifically, a developer must visit a malicious website while the Vitest API server is running on their local machine. The attack flow proceeds as follows:

  1. The attacker creates a malicious web page containing JavaScript code that attempts to connect to the local Vitest WebSocket server
  2. A developer running Vitest with UI or API mode enabled visits the malicious website
  3. The malicious JavaScript establishes a WebSocket connection to localhost on the Vitest port
  4. The attacker's script calls saveTestFile to inject malicious code into an existing test file
  5. The script then calls rerun to execute the modified test file, running the injected code with full Node.js privileges

The vulnerability exploits the trust relationship between browser-based JavaScript and locally running development servers. For technical implementation details, see the Vitest WebSocket handler code and the Vitest API configuration documentation.

Detection Methods for CVE-2025-24964

Indicators of Compromise

  • Unexpected modifications to test files (e.g., *.test.js, *.spec.ts) with suspicious code injections
  • Unusual WebSocket connections to Vitest's API port from external origins
  • Unexpected child processes spawned by the Node.js Vitest process
  • Anomalous file system activity in project directories during test runs

Detection Strategies

  • Monitor WebSocket connections to development tool ports for non-localhost origins
  • Implement file integrity monitoring on test directories to detect unauthorized modifications
  • Review browser network traffic for suspicious WebSocket connections to localhost ports
  • Audit development environment logs for unexpected test file changes or reruns

Monitoring Recommendations

  • Enable verbose logging for Vitest during development sessions to track API calls
  • Use network monitoring tools to detect WebSocket connections from untrusted origins
  • Implement endpoint detection solutions that can identify suspicious Node.js process behavior
  • Consider using browser extensions that block cross-origin WebSocket connections to localhost

How to Mitigate CVE-2025-24964

Immediate Actions Required

  • Upgrade Vitest to patched versions: 1.6.1, 2.1.9, or 3.0.5 or later
  • Avoid running Vitest UI or API mode while browsing untrusted websites
  • Disable the api configuration option if not needed for your workflow
  • Review recent test file changes for any suspicious modifications

Patch Information

Vitest has released security patches that address this vulnerability by implementing proper Origin header validation and authorization mechanisms for the WebSocket server. Users should upgrade to the following versions:

  • For Vitest 1.x: Upgrade to version 1.6.1 or later
  • For Vitest 2.x: Upgrade to version 2.1.9 or later
  • For Vitest 3.x: Upgrade to version 3.0.5 or later

For detailed information about the security fix, refer to the GitHub Security Advisory GHSA-9crc-q9x8-hgqq.

Workarounds

  • There are no known workarounds for this vulnerability; upgrading is the only effective mitigation
  • As a temporary measure, avoid enabling Vitest UI or API mode during development sessions
  • Run Vitest in headless mode without the API server when possible
  • Use network isolation to prevent browser access to the Vitest API port
bash
# Upgrade Vitest to the latest patched version
npm update vitest

# Or install a specific patched version
npm install vitest@3.0.5

# Verify the installed version
npx vitest --version

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypeRCE

  • Vendor/TechVitest

  • SeverityHIGH

  • CVSS Score8.8

  • EPSS Probability0.14%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityHigh
  • AvailabilityHigh
  • CWE References
  • CWE-1385
  • Technical References
  • GitHub Vitest Code Snippet

  • GitHub Vitest Code Snippet

  • Vitest Configuration API Documentation
  • Vendor Resources
  • GitHub Security Advisory GHSA-9crc-q9x8-hgqq
  • Related CVEs
  • CVE-2025-24963: Vitest Path Traversal Vulnerability
Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English