CVE-2025-50472

The modelscope/ms-swift library thru 2.6.1 is vulnerable to arbitrary code execution through deserialization of untrusted data within the `load_model_meta()`…

Critical · published August 1, 2025

CVSS v3.1
9.8
EPSS
1%
Percentile
71.5
In the wild
Unconfirmed
What it is

🚨 A seemingly innocent `.mdl` file can open the door to chaos! The modelscope/ms-swift library, through version 2.6.1, is vulnerable to arbitrary code execution that flies under the radar like a sneaky ninja. 🔥 Imagine a chef who unknowingly adds a secret ingredient to their dish, believing it’s just a regular spice. This ingredient, however, is actually a harmful substance that can wreak havoc in the kitchen! Similarly, in this vulnerability, an attacker can sneak in malicious code disguised as a harmless model file during training processes. This vulnerability is absolutely devastating! An attacker could craft a malicious serialized payload that executes arbitrary code, giving them control over the victim's machine without raising any alarms. While the model continues to train, the attacker gets a free pass to execute commands, which could lead to data breaches or complete system compromise!

Put simply

Imagine a chef who unknowingly adds a secret ingredient to their dish, believing it’s just a regular spice. This ingredient, however, is actually a harmful substance that can wreak havoc in the kitchen! Similarly, in this vulnerability, an attacker can sneak in malicious code disguised as a harmless model file during training processes. The `load_model_meta()` function in the `ModelFileSystemCache()` class uses `pickle.load()` to deserialize untrusted data from potentially malicious sources, enabling remote code execution (RCE). By loading a compromised `.mdl` file, attackers can execute arbitrary commands, completely bypassing user detection.

What to do

This vulnerability is absolutely devastating! An attacker could craft a malicious serialized payload that executes arbitrary code, giving them control over the victim's machine without raising any alarms. While the model continues to train, the attacker gets a free pass to execute commands, which could lead to data breaches or complete system compromise! Immediate action is crucial: patch to version 2.6.2 or later, which addresses this vulnerability. Additionally, avoid loading untrusted serialized data and implement strict validation on model files before use. Regularly audit your dependencies for vulnerabilities! You've got this! By taking these steps, you'll be well on your way to safeguarding your systems! 🛡️

The record
Technical detail
CVSS v3.1
9.8 · CRITICAL
Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
CVSS v4.0
Not supplied
EPSS
0.01360 · 71.5th percentile
Published
2025-08-01T00:00Z
EPSS history
Timeline
  • 01 AUG 00:00Z
    The modelscope/ms-swift library thru 2.6.1 is vulnerable to arbitrary code execution through deserialization of untrusted data within the `load_model_meta()`…
    cvelistv5