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

CVE-2026-31252: CosyVoice RCE Vulnerability

CVE-2026-31252 is a remote code execution flaw in CosyVoice caused by insecure deserialization in model loading. Attackers can execute arbitrary code via malicious model files. This article covers technical details, impact, and mitigation.

Published: May 18, 2026

CVE-2026-31252 Overview

CVE-2026-31252 is an insecure deserialization vulnerability [CWE-502] in CosyVoice, an open-source voice synthesis framework from FunAudioLLM. The flaw exists through commit 6e01309e01bc93bbeb83bdd996b1182a81aaf11e and affects the model loading component. CosyVoice calls torch.load() on model weight files such as llm.pt, flow.pt, and hift.pt without setting weights_only=True. This default behavior allows the underlying pickle module to deserialize arbitrary Python objects. An attacker who supplies a malicious model directory can execute arbitrary code on a victim's system when the CosyVoice Web UI loads the files. The issue is tracked under [CWE-94] (Improper Control of Code Generation).

Critical Impact

Loading an attacker-supplied CosyVoice model directory results in arbitrary code execution in the context of the user running the Web UI.

Affected Products

  • CosyVoice framework through commit 6e01309e01bc93bbeb83bdd996b1182a81aaf11e
  • CosyVoice Web UI instances loading user-provided model directories
  • Deployments using torch.load() against llm.pt, flow.pt, or hift.pt files

Discovery Timeline

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

Technical Details for CVE-2026-31252

Vulnerability Analysis

CosyVoice loads model weights with PyTorch's torch.load() function. By default, torch.load() deserializes the file using Python's pickle module, which can instantiate arbitrary classes and invoke arbitrary callables encoded inside the file. PyTorch introduced the weights_only=True parameter specifically to restrict deserialization to safe tensor types, but CosyVoice does not enable it.

When the Web UI is pointed at a model directory, the framework iterates through expected files such as llm.pt, flow.pt, and hift.pt and deserializes each one. A crafted pickle stream containing a __reduce__ method runs attacker-controlled code at load time. Execution occurs with the privileges of the user running the Web UI process.

The attack requires local access and user interaction, as the victim must launch the Web UI and select the malicious directory. The scope is changed because code executes outside the model loader's intended boundary.

Root Cause

The root cause is the use of torch.load() without weights_only=True. This permits pickle-based object reconstruction during model deserialization, which is a documented unsafe operation when loading untrusted files.

Attack Vector

An attacker distributes a model directory through unofficial model hubs, file shares, or social engineering. The directory contains weight files that look legitimate but embed a malicious pickle payload. When the victim opens the CosyVoice Web UI and configures it to load the directory, the payload executes during deserialization. No additional privilege escalation primitive is required for code execution within the user's account.

The vulnerability manifests during the torch.load() call on the tampered .pt file. See the GitHub PoC Repository and Notion CVE Details for technical references.

Detection Methods for CVE-2026-31252

Indicators of Compromise

  • Unexpected child processes spawned by the Python interpreter hosting the CosyVoice Web UI during model load.
  • .pt files originating from untrusted sources placed in CosyVoice model directories.
  • Outbound network connections initiated by the Web UI process shortly after a new model directory is selected.
  • Modifications to user startup files, cron entries, or shell profiles immediately after launching CosyVoice.

Detection Strategies

  • Inspect pickle streams inside .pt files for GLOBAL, REDUCE, or BUILD opcodes referencing modules like os, subprocess, or builtins.
  • Hunt for invocations of torch.load() in source code without an explicit weights_only=True argument.
  • Correlate Web UI process telemetry with file read events targeting unknown llm.pt, flow.pt, or hift.pt paths.

Monitoring Recommendations

  • Log and alert on process trees where the CosyVoice Python process spawns shells, interpreters, or networking utilities.
  • Track filesystem writes by the Web UI process outside its working directory and model cache.
  • Audit downloads of CosyVoice model archives from non-official sources.

How to Mitigate CVE-2026-31252

Immediate Actions Required

  • Restrict CosyVoice Web UI usage to model directories from trusted, verified publishers.
  • Patch local installations to invoke torch.load() with weights_only=True for all weight files.
  • Run the CosyVoice Web UI under a low-privilege account isolated from sensitive data and credentials.
  • Block ingestion of model archives from untrusted file shares, forums, or third-party mirrors.

Patch Information

No official fixed commit is referenced in the published advisory at the time of writing. Monitor the CosyVoice GitHub repository for upstream changes that add weights_only=True to model loading calls or migrate to safetensors-based formats.

Workarounds

  • Manually modify model loading code to pass weights_only=True to every torch.load() call.
  • Convert trusted models to the safetensors format and load them with the safetensors library, which does not execute arbitrary code.
  • Execute the Web UI inside a container or sandbox with no network egress and read-only access to sensitive paths.
  • Verify cryptographic hashes of model files against publisher-provided values before loading.
bash
# Configuration example: enforce safe loading in CosyVoice forks
# Replace insecure calls such as:
#   state = torch.load(model_path)
# with:
#   state = torch.load(model_path, weights_only=True, map_location='cpu')

# Run the Web UI under a restricted user with no outbound network access
sudo useradd -r -s /usr/sbin/nologin cosyvoice
sudo -u cosyvoice python3 webui.py --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

  • SeverityMEDIUM

  • CVSS Score5.7

  • EPSS Probability0.02%

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

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

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