CVE-2026-31249: CosyVoice: insecure deserialization RCE via .pt files
UNKNOWNCosyVoice's data preprocessing script loads PyTorch model files using torch.load() without the weights_only=True safety flag, meaning any .pt file placed in a processed data directory can execute arbitrary code via Python's pickle module at parse time. While no CVSS score has been assigned and the vulnerability is absent from CISA KEV, the exploit primitive—crafting a malicious pickle payload—is trivially documented and script-kiddie accessible, making this dangerous wherever CosyVoice pipelines ingest externally-sourced or shared .pt files. Organizations using CosyVoice for voice synthesis or TTS pipelines should patch by pinning to a commit after 6e01309e01bc93bbeb83bdd996b1182a81aaf11e and ensuring all torch.load() calls pass weights_only=True; as an interim control, scan all incoming .pt files with picklescan or fickling before processing.
What is the risk?
Risk is moderate-to-high for teams running CosyVoice data preprocessing on untrusted inputs or in multi-tenant and shared environments. Exploitation requires attacker-controlled .pt files to reach the data directory, which is feasible in collaborative AI training environments, shared data lakes, or pipelines consuming external speech datasets from public repositories. The absence of CVSS, KEV status, and public PoC lowers immediate urgency, but insecure pickle deserialization is one of the most well-understood and reliably exploitable vulnerability classes in the ML ecosystem—no specialized ML knowledge is required to build a working exploit.
How does the attack unfold?
How severe is it?
What should I do?
5 steps-
Upgrade CosyVoice to a commit after 6e01309e01bc93bbeb83bdd996b1182a81aaf11e that addresses this issue, or manually patch make_parquet_list.py to replace torch.load(path) with torch.load(path, weights_only=True).
-
Audit all torch.load() calls across your ML codebase for the same insecure pattern.
-
Integrate picklescan or fickling into CI/CD pipelines to inspect .pt files before ingestion.
-
Enforce data provenance controls—only load .pt files from cryptographically verified, trusted sources.
-
Run preprocessing scripts in isolated containers with minimal privileges and no network egress to limit blast radius if exploited.
What does CISA's SSVC say?
Source: CISA Vulnrichment (SSVC v2.0). Decision based on the CISA Coordinator decision tree.
How is it classified?
Which compliance frameworks are affected?
This CVE is relevant to:
Frequently Asked Questions
What is CVE-2026-31249?
CosyVoice's data preprocessing script loads PyTorch model files using torch.load() without the weights_only=True safety flag, meaning any .pt file placed in a processed data directory can execute arbitrary code via Python's pickle module at parse time. While no CVSS score has been assigned and the vulnerability is absent from CISA KEV, the exploit primitive—crafting a malicious pickle payload—is trivially documented and script-kiddie accessible, making this dangerous wherever CosyVoice pipelines ingest externally-sourced or shared .pt files. Organizations using CosyVoice for voice synthesis or TTS pipelines should patch by pinning to a commit after 6e01309e01bc93bbeb83bdd996b1182a81aaf11e and ensuring all torch.load() calls pass weights_only=True; as an interim control, scan all incoming .pt files with picklescan or fickling before processing.
Is CVE-2026-31249 actively exploited?
No confirmed active exploitation of CVE-2026-31249 has been reported, but organizations should still patch proactively.
How to fix CVE-2026-31249?
1. Upgrade CosyVoice to a commit after 6e01309e01bc93bbeb83bdd996b1182a81aaf11e that addresses this issue, or manually patch make_parquet_list.py to replace torch.load(path) with torch.load(path, weights_only=True). 2. Audit all torch.load() calls across your ML codebase for the same insecure pattern. 3. Integrate picklescan or fickling into CI/CD pipelines to inspect .pt files before ingestion. 4. Enforce data provenance controls—only load .pt files from cryptographically verified, trusted sources. 5. Run preprocessing scripts in isolated containers with minimal privileges and no network egress to limit blast radius if exploited.
What systems are affected by CVE-2026-31249?
This vulnerability affects the following AI/ML architecture patterns: Training pipelines, Data preprocessing pipelines, MLOps automation, Voice synthesis and TTS systems.
What is the CVSS score for CVE-2026-31249?
No CVSS score has been assigned yet.
What is the AI security impact?
Affected AI Architectures
MITRE ATLAS Techniques
AML.T0010.002 Data AML.T0011.000 Unsafe AI Artifacts AML.T0018.002 Embed Malware Compliance Controls Affected
What are the technical details?
Original Advisory
CosyVoice thru commit 6e01309e01bc93bbeb83bdd996b1182a81aaf11e (2025-30-21) contains an insecure deserialization vulnerability (CWE-502) in its make_parquet_list.py data processing tool. The script loads PyTorch .pt files (utterance embeddings, speaker embeddings, speech tokens) using torch.load() without enabling the weights_only=True security parameter. This allows the deserialization of arbitrary Python objects via the pickle module. An attacker can exploit this by providing malicious .pt files within a data directory. When a victim processes this directory using the tool, arbitrary code is executed on the victim's system.
Exploitation Scenario
An adversary targeting an organization's voice synthesis pipeline identifies CosyVoice as the preprocessing tool for speaker embeddings. They contribute a poisoned speech dataset to a public repository or shared data lake—or socially engineer a data engineer into pulling it—containing a .pt file with an embedded pickle payload encoding a reverse shell. When the victim's automated data pipeline runs make_parquet_list.py against the directory, torch.load() deserializes the payload without safety checks, executing the attacker's code with pipeline process privileges. From there, the attacker pivots laterally to training infrastructure, exfiltrates proprietary model weights, or plants a persistent backdoor.
References
Timeline
Related Vulnerabilities
CVE-2025-59528 10.0 Flowise: Unauthenticated RCE via MCP config injection
Same attack type: Supply Chain CVE-2024-2912 10.0 BentoML: RCE via insecure deserialization (CVSS 10)
Same attack type: Supply Chain CVE-2023-3765 10.0 MLflow: path traversal allows arbitrary file read
Same attack type: Supply Chain CVE-2025-5120 10.0 smolagents: sandbox escape enables unauthenticated RCE
Same attack type: Supply Chain CVE-2026-21858 10.0 n8n: Input Validation flaw enables exploitation
Same attack type: Code Execution