Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessAttacker embeds pickle payload in model file
-
DeliveryVictim downloads malicious model directory
-
ExploitVictim starts CosyVoice Web UI with malicious path
-
Executiontorch.load() deserializes pickle payload
-
ImpactArbitrary code executes on victim system
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Code injection prevention, sandbox exec
MITRE ATT&CK
2 techniques across 2 tactics: Execution, Initial Access The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires two concrete preconditions: first, the victim must obtain a malicious model directory - one in which at least one of the model weight files (llm.pt, flow.pt, or hift.pt) contains a crafted pickle payload; second, the victim must start the CosyVoice Web UI with the --model_dir argument (or equivalent configuration) pointing to that malicious directory. The attacker does not need any privileges on the victim's system; the delivery mechanism is social engineering or a compromised model distribution channel. Exploitation is limited by the UI:R requirement - the victim must actively invoke the Web UI - and by AV:L - the malicious files must already reside on the local filesystem at the time of loading. Non-default or cloud-only model hosting configurations where model files are never written to local disk would not be exploitable. The vulnerability does not affect systems that only run inference against already-loaded, in-memory models without reloading from disk. |
| Impact | The provided CVSS 3.1 score of 5.7 (AV:L/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:L) appears to understate the actual impact of arbitrary code execution: C:L/I:L/A:L is inconsistent with pickle deserialization, which typically grants full host compromise. The AV:L and UI:R metrics correctly capture the key limiting factors - malicious files must reside on the local filesystem and the victim must actively start the Web UI. However, the provided PR:L implies the attacker needs low-privilege access to the victim machine; an alternative realistic scenario is a malicious model distributed externally (e.g., via HuggingFace or GitHub), where the attacker needs no privileges on the victim system. EPSS at 0.02% (5th percentile) and SSVC exploitation status of 'none' both confirm no observed exploitation activity. No KEV listing exists and no POC code is referenced in the provided data. Real-world risk is moderate-to-high for ML practitioners who routinely download third-party model weights, but low for the general enterprise population given CosyVoice's niche deployment base. The primary threat model is supply-chain or social-engineering against ML researchers and developers, not automated mass exploitation. |
| Exploit ScenarioDerived | An attacker publishes a trojanized CosyVoice model repository on a public platform (e.g., GitHub or HuggingFace), embedding a malicious pickle payload inside llm.pt that spawns a reverse shell when deserialized. A researcher or developer downloads the model directory and starts the CosyVoice Web UI pointing to it; during startup, torch.load() invokes pickle deserialization, executing the attacker's embedded payload with the privileges of the running process. No publicly available exploit code is referenced in the provided data, but the technique is well-documented and trivially reproducible given open knowledge of pickle exploitation. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Jul 24, 2026
Insecure deserialization in CosyVoice's model loading pipeline permits arbitrary code execution on any system that loads a maliciously crafted model directory via the Web UI. The framework invokes torch.load() on model weight files (llm.pt, flow.pt, hift.pt) without the weights_only=True safety parameter, allowing Python's pickle module to deserialize and execute arbitrary objects embedded in those files. An attacker who can persuade a victim to point the CosyVoice Web UI at an attacker-controlled model directory - whether via a trojanized download, a shared malicious repository, or direct filesystem access - achieves code execution on the victim's machine at the moment of model loading. No public exploit code or CISA KEV listing is recorded at time of analysis; EPSS is 0.02% (5th percentile) and SSVC assesses exploitation as none, consistent with the social-engineering precondition required.
RemediationAI
The primary fix is to update CosyVoice to a commit or release that patches all torch.load() calls by adding the weights_only=True parameter, which restricts deserialization to safe tensor primitives and prevents pickle-based code execution. No specific patched release version is identified in the available data; monitor the upstream repository at https://github.com/FunAudioLLM/CosyVoice for a fix commit. Until a patch is available, the most effective compensating control is to load model files exclusively from trusted, verified sources - ideally cryptographically signed model archives with checksum verification before loading. Operators should avoid pointing the Web UI at any model directory whose provenance cannot be confirmed. As a secondary control, run the CosyVoice process in an isolated environment (Docker container, VM, or dedicated sandboxed user account) so that even if code executes, lateral movement is constrained. Note that sandboxing does not prevent the initial code execution; it only limits blast radius. For organizations that can tolerate the effort, the underlying fix can be applied locally by patching the model loading code to use torch.load(path, weights_only=True) or by using the safer safetensors format as an alternative model serialization mechanism. See the NVD entry at https://nvd.nist.gov/vuln/detail/CVE-2026-31252 for advisory updates.
Affected VersionsENISA
Affects your stack
Find out whether the stacks and servers you run are on an affected version.
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
CosyVoice is an open-source AI voice synthesis framework (github.com/FunAudioLLM/CosyVoice) that loads PyTorch model checkpoint files using torch.load(). PyTorch's torch.load() defaults to full pickle deserialization, which can reconstruct arbitrary Python objects - including those with __reduce__ methods that execute shell commands - during the load process. The safe API surface is torch.load(f, weights_only=True), which restricts deserialization to tensor primitives only; this parameter was introduced precisely to address the known insecurity of pickle-based model loading. The root-cause CWE listed in the input is CWE-94 (Code Injection), though the description explicitly references CWE-502 (Deserialization of Untrusted Data); both apply since the vector is pickle deserialization producing arbitrary code injection. The vulnerability is present through commit 6e01309e01bc93bbeb83bdd996b1182a81aaf11e. CPE data from NVD is listed as n/a, indicating the product has not yet been formally mapped in the National Vulnerability Database.
Know when Python gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:L/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:L
AV:L because model files must be local; PR:N as attacker distributes files externally; arbitrary code execution justifies C:H/I:H/A:H over the provided C:L/I:L/A:L.
Primary rating from NVD.
CVSS VectorNVD
Lifecycle Timeline
3DescriptionCVE.org
CosyVoice thru commit 6e01309e01bc93bbeb83bdd996b1182a81aaf11e (2025-30-21) contains an insecure deserialization vulnerability (CWE-502) in its model loading component. The framework uses torch.load() to load model weight files (e.g., llm.pt, flow.pt, hift.pt) without enabling the security-restrictive weights_only=True parameter. This allows the deserialization of arbitrary Python objects via the pickle module. An attacker can exploit this by providing a malicious model directory containing specially crafted model files. When a victim starts the CosyVoice Web UI pointing to this directory, arbitrary code is executed on the victim's system during the model loading process.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Insecure deserialization occurs when an application converts serialized data (a stream of bytes representing an object's state) back into a living object without proper validation.
Code injection occurs when an application accepts user input and passes it directly into a language interpreter or evaluator without proper sanitization.
Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.
Wazuh SIEM platform versions 4.4.0 through 4.9.0 contain an unsafe deserialization vulnerability in the DistributedAPI t
BentoML version 1.4.2 and earlier contains an unauthenticated remote code execution vulnerability through insecure deser
pgAdmin 4 contains critical remote code execution vulnerabilities in the Query Tool download and Cloud Deployment endpoi
The renderLocalView function in render/views.py in graphite-web in Graphite 0.9.5 through 0.9.10 uses the pickle Python
BentoML is a Python library for building online serving systems optimized for AI apps and model inference. Rated critica
OpenSSL before 0.9.8za, 1.0.0 before 1.0.0m, and 1.0.1 before 1.0.1h does not properly restrict processing of ChangeCiph
pyLoad download manager version prior to 0.5.0b3.dev77 exposes the Flask SECRET_KEY through an unauthenticated endpoint.
Langflow (a visual LLM pipeline builder) contains a critical unauthenticated code execution vulnerability (CVE-2026-3301
In Mercurial before 4.1.3, "hg serve --stdio" allows remote authenticated users to launch the Python debugger, and conse
Unauthenticated remote code execution affects Kestra OSS (the open-source event-driven orchestration platform) prior to
Unauthenticated remote code execution in Marimo ≤0.20.4 allows attackers to execute arbitrary system commands via the `/
pyLoad is the free and open-source Download Manager written in pure Python. Rated medium severity (CVSS 5.3), this vulne
EUVD-2026-29099
GHSA-4xxc-9mf8-p66h
NVD
CVE.org
EPSS
Vulnrichment
Exploit-DB