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-31250

CVE-2026-31250: CosyVoice RCE Vulnerability

CVE-2026-31250 is an insecure deserialization flaw in CosyVoice that enables remote code execution through malicious PyTorch checkpoint files. This article covers the technical details, affected versions, and mitigation.

Published: May 18, 2026

CVE-2026-31250 Overview

CVE-2026-31250 is an insecure deserialization vulnerability (CWE-502) in CosyVoice, an open-source voice generation framework. The flaw resides in the average_model.py model averaging tool, which loads PyTorch checkpoint files (epoch_*.pt) using torch.load() without setting the weights_only=True security parameter. This causes the pickle module to deserialize arbitrary Python objects from the checkpoint files. An attacker who supplies a crafted checkpoint achieves arbitrary code execution on the victim's system when the averaging tool processes the directory. The issue is present through commit 6e01309e01bc93bbeb83bdd996b1182a81aaf11e.

Critical Impact

Arbitrary code execution on systems that average CosyVoice model checkpoints sourced from untrusted locations.

Affected Products

  • CosyVoice through commit 6e01309e01bc93bbeb83bdd996b1182a81aaf11e
  • The average_model.py model averaging utility
  • PyTorch checkpoint loading workflows that omit weights_only=True

Discovery Timeline

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

Technical Details for CVE-2026-31250

Vulnerability Analysis

The vulnerability is an insecure deserialization flaw in the model averaging utility shipped with CosyVoice. The average_model.py script enumerates checkpoint files matching the epoch_*.pt pattern in a user-supplied directory and loads them with torch.load(). Because torch.load() defaults to using Python's pickle module for object reconstruction, any callable referenced by a __reduce__ method inside the checkpoint executes during deserialization. A checkpoint is therefore a code-bearing artifact, not just data.

Exploitation runs in the victim's Python process with the privileges of the user executing the averaging tool. In machine learning pipelines that frequently process community-supplied weights, this provides a practical path to host compromise, credential theft, and downstream supply-chain attacks against trained models.

Root Cause

The root cause is the omission of the weights_only=True parameter when invoking torch.load(). PyTorch introduced this flag to restrict deserialization to safe tensor types and reject arbitrary Python object reconstruction. Without it, pickle opcodes such as REDUCE and GLOBAL are honored, allowing any importable callable to be invoked with attacker-controlled arguments.

Attack Vector

An attacker publishes or otherwise delivers a malicious epoch_*.pt file to a directory that a victim later passes to average_model.py. When the script iterates the directory and loads each checkpoint, the embedded pickle payload executes attacker code. Delivery channels include model hubs, shared training directories, mounted network storage, and downloads bundled with datasets or pretrained models. No authentication or user interaction with the malicious file is required beyond running the averaging tool against the directory.

Refer to the CosyVoice GitHub Repository for the affected source.

Detection Methods for CVE-2026-31250

Indicators of Compromise

  • Unexpected epoch_*.pt files in model directories that did not originate from local training runs
  • Python processes spawning shells, network connections, or unexpected child processes shortly after average_model.py execution
  • Checkpoint files whose pickle stream contains references to os.system, subprocess, builtins.exec, or posix.system

Detection Strategies

  • Scan .pt files with a pickle disassembler such as pickletools to identify GLOBAL opcodes referencing non-tensor modules
  • Monitor invocations of torch.load() in code review and CI to require weights_only=True
  • Hash and inventory trusted checkpoints, and alert on unsigned or unknown files appearing in averaging directories

Monitoring Recommendations

  • Log child process creation from Python interpreters running ML tooling and alert on shells, curl, wget, or compiler invocations
  • Capture outbound network connections from training and inference hosts, baselining expected destinations
  • Track file integrity on model directories and flag new epoch_*.pt writes from non-training user accounts

How to Mitigate CVE-2026-31250

Immediate Actions Required

  • Audit all callers of torch.load() in CosyVoice deployments and forks, and add weights_only=True where feasible
  • Restrict write access to checkpoint directories to trusted training accounts only
  • Quarantine any epoch_*.pt files received from external sources until they are verified

Patch Information

No official fixed version is identified in the NVD record at publication. Track the CosyVoice GitHub Repository for commits addressing average_model.py and apply the upstream fix when available. Additional notes are referenced in the CVE-2026-31250 disclosure details.

Workarounds

  • Modify local copies of average_model.py to call torch.load(path, weights_only=True, map_location='cpu')
  • Only average checkpoints produced by your own training pipeline and stored on access-controlled storage
  • Execute averaging in a sandboxed environment such as a container with no network egress and a non-privileged user
bash
# Configuration example: enforce safe checkpoint loading
# Patch average_model.py to require weights_only deserialization
sed -i 's/torch.load(\(.*\))/torch.load(\1, weights_only=True)/' average_model.py

# Run the averaging tool inside a restricted container
docker run --rm --network=none --read-only \
  -v "$PWD/checkpoints:/data:ro" \
  -u 1000:1000 cosyvoice:hardened \
  python average_model.py --src_path /data

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.05%

  • 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-502
  • Technical References
  • GitHub Repository for CosyVoice

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

  • CVE-2026-31252: CosyVoice RCE Vulnerability

  • CVE-2026-31251: 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