CVE-2025-51427 ModelScope is vulnerable to arbitrary code injection via a crafted module
Attackers can execute arbitrary code by crafting a malicious module entry in the configuration file, affecting ModelScope users.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2025-51427?
CVE-2025-51427 is a high-severity unsafe deserialization vulnerability in n/a, published on 19 May 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
An issue was discovered in ModelScope 1.25.0 allowing attackers to execute arbitrary code via crafted module listed in the configuration file (dey_mini.yaml) under the key ['nnet']['module'].
Which versions are affected by CVE-2025-51427?
3 open source packages ship an affected version, including modelscope.
| Package | Affected | Fixed in |
|---|---|---|
modelscope PyPI | All versions | 1.27.0 |
modelscope PyPI | All versions | 1.27.0 |
modelscope PyPI | All versions | 1.27.0 |
How do I fix CVE-2025-51427?
Upgrade modelscope to 1.27.0 or later.
Upgrade, and only deserialise data from trusted sources or with an allow-list of types. More about Unsafe deserialization.
Is CVE-2025-51427 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-51427 exists.
Sources
Also known as GHSA-fhhq-h4hg-549x, PYSEC-2026-2663.