A Leader in the 2026 Gartner® Magic Quadrant™ for Endpoint Protection. Six years running.Six years. Gartner® Magic Quadrant™ Leader.Find Out Why
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
    • AI Data Pipelines
      Security Data Pipeline for AI SIEM and Data Optimization
    • 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-2026-31251

CVE-2026-31251: CosyVoice RCE Vulnerability

CVE-2026-31251 is a remote code execution flaw in CosyVoice caused by insecure deserialization in its gRPC server. Malicious model files can execute arbitrary code during server startup. This article covers technical details, affected versions, impact, and mitigation strategies.

Published: May 18, 2026

CVE-2026-31251 Overview

CVE-2026-31251 is an insecure deserialization vulnerability [CWE-502] affecting the CosyVoice speech synthesis project through commit 6e01309e01bc93bbeb83bdd996b1182a81aaf11e. The gRPC server component loads model files using torch.load() without setting the weights_only=True parameter. This permits unpickling of arbitrary Python objects from attacker-controlled model directories. When a victim launches the gRPC server pointing at a malicious model path, code embedded in the pickle stream executes during server initialization.

Critical Impact

Attackers who supply or substitute a model file in the directory loaded by the CosyVoice gRPC server gain arbitrary code execution on the host during startup.

Affected Products

  • CosyVoice (FunAudioLLM) through commit 6e01309e01bc93bbeb83bdd996b1182a81aaf11e
  • gRPC server component shipped with the CosyVoice repository
  • Any deployment loading untrusted CosyVoice model directories

Discovery Timeline

  • 2026-05-11 - CVE-2026-31251 published to NVD
  • 2026-05-12 - Last updated in NVD database

Technical Details for CVE-2026-31251

Vulnerability Analysis

The CosyVoice gRPC server initializes by loading a pretrained speech synthesis model from a directory specified at launch time. The loader invokes PyTorch's torch.load() function against files in that directory. Without the weights_only=True flag, torch.load() falls back to Python's pickle module to deserialize objects. Pickle deserialization invokes constructors and __reduce__ methods embedded in the stream, which can execute arbitrary Python during load.

An attacker who controls the contents of the model directory crafts a pickle payload that runs commands when the server starts. Execution occurs in the security context of the user running the gRPC service, which in many machine learning deployments is a privileged or GPU-enabled account.

Root Cause

The root cause is missing input validation on deserialized data. PyTorch documents weights_only=True as the safe loading mode for tensors and state dictionaries. CosyVoice omits this parameter, so the loader treats every file as a fully trusted pickle stream. The flaw is tracked under [CWE-20: Improper Input Validation] in addition to the deserialization weakness class.

Attack Vector

Exploitation requires the victim to start the gRPC server with a model path that contains an attacker-supplied file. Attack scenarios include supply-chain substitution of model weights downloaded from public hubs, shared filesystem tampering, and social engineering that convinces a developer to test a malicious fine-tune. No authentication to the gRPC service is required because the payload triggers during server startup, before any client request.

For exploitation mechanics, see the CosyVoice repository and the public CVE analysis.

Detection Methods for CVE-2026-31251

Indicators of Compromise

  • Unexpected child processes spawned by the Python interpreter hosting the CosyVoice gRPC server during startup
  • Model files in CosyVoice directories with recent modification timestamps from untrusted users or external downloads
  • Outbound network connections initiated by the server process before any gRPC client traffic arrives
  • Pickle files containing references to os.system, subprocess, posix.system, or builtins.exec opcodes

Detection Strategies

  • Scan .pt, .pth, and .bin files in model directories with pickle inspection tools such as picklescan or fickling
  • Audit Python process trees for CosyVoice servers that launch shells, package managers, or interpreters as children
  • Hash and compare model artifacts against vendor-published checksums before each server start

Monitoring Recommendations

  • Log all invocations of the CosyVoice gRPC entrypoint with the resolved model directory path and file hashes
  • Alert on torch.load calls without weights_only=True discovered through static analysis of CosyVoice forks
  • Forward process-creation and network-connection telemetry from inference hosts to a centralized analytics platform for retrospective review

How to Mitigate CVE-2026-31251

Immediate Actions Required

  • Restrict the CosyVoice gRPC server to load models only from directories under administrative control
  • Replace torch.load(path) calls with torch.load(path, weights_only=True) in local forks until an official patch is available
  • Verify cryptographic hashes of every model file against a trusted source before service startup
  • Run the gRPC server under a low-privilege, network-isolated service account

Patch Information

No vendor-supplied patch is referenced in the NVD entry as of the last modified date. Monitor the CosyVoice GitHub repository for upstream fixes and adopt the weights_only=True loader pattern in the interim.

Workarounds

  • Convert model artifacts to the safetensors format, which does not execute code during deserialization
  • Place model directories on read-only mounts writable only by trusted release pipelines
  • Block outbound network egress from inference hosts at the firewall to limit second-stage payloads
bash
# Configuration example: replace unsafe loader and run with least privilege
# 1. Patch the loader call in CosyVoice source
sed -i 's/torch.load(\(.*\))/torch.load(\1, weights_only=True)/g' cosyvoice/cli/model.py

# 2. Run the gRPC server as an unprivileged user with read-only model mount
sudo useradd -r -s /usr/sbin/nologin cosyvoice
sudo mount -o ro,bind /opt/models/cosyvoice /srv/cosyvoice/models
sudo -u cosyvoice python -m cosyvoice.bin.grpc_server \
  --model_dir /srv/cosyvoice/models

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

  • Vulnerability Details
  • TypeRCE

  • Vendor/TechCosyvoice

  • SeverityHIGH

  • CVSS Score7.3

  • EPSS Probability0.04%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityLow
  • CWE References
  • CWE-20
  • Technical References
  • GitHub PoC Repository

  • Notion CVE Analysis
  • Related CVEs
  • CVE-2026-31232: CosyVoice RCE Vulnerability

  • CVE-2026-31252: CosyVoice RCE Vulnerability

  • CVE-2026-31250: CosyVoice RCE Vulnerability
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today 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