CVE-2025-50460: Unsafe PyYAML deserialization RCE in ms-swift tests/run.py
CVE-2025-50460 is a remote code execution vulnerability in ms-swift version 3.3.0 caused by unsafe deserialization in tests/run.py. The vulnerable code uses yaml.load() from PyYAML 5.3.1 to parse attacker-controlled YAML supplied via the --run_config parameter. Because yaml.load() can instantiate arbitrary Python objects during deserialization, a crafted YAML document can trigger execution of arbitrary Python code, including commands invoked through mechanisms such as os.system(). Successful exploitation occurs at deserialization time when the malicious YAML file is loaded, potentially resulting in full compromise of the host running the script.
Impact, mitigation & remediation
What it means and what to do now: patch path, interim mitigations, and the assume-compromise checklist.
Impact
What an attacker gets, and what they’ve been doing with it.
Successful exploitation allows arbitrary code execution in the security context of the user running the vulnerable ms-swift component. This can lead to full system compromise, including execution of shell commands, installation of additional payloads, data theft, modification or destruction of files, and use of the affected host as a pivot for further activity.
Mitigation
If you can’t patch tonight, do this now.
Do not pass untrusted or externally supplied YAML files to the --run_config parameter. Restrict who can modify or provide configuration files, validate configuration provenance, and run the script with least privilege to reduce impact. Where immediate code changes are not possible, isolate execution in a constrained environment and avoid using vulnerable PyYAML deserialization paths on untrusted input.
Remediation
Patch, then assume compromise.
Upgrade PyYAML to version 5.4 or later and replace yaml.load() with yaml.safe_load() in tests/run.py or equivalent parsing paths so that untrusted YAML is not deserialized into arbitrary Python objects. Review all YAML parsing in the project for similar unsafe loader usage and ensure only trusted configuration files are accepted where full object deserialization is required.
Exploits
No validated public exploits yet. Hidden: 2 rejected by Mallory's analysis as not a working exploit.
References
Frequently asked questions
- Is CVE-2025-50460 exploited in the wild?
- As of Oct 16, 2026, Mallory has no reports of CVE-2025-50460 being exploited in the wild. It is not listed in CISA KEV.
- Is there a public exploit for CVE-2025-50460?
- Yes. As of Oct 16, 2026, Mallory has reports of a public exploit for CVE-2025-50460.
- Is there a patch for CVE-2025-50460?
- Upgrade PyYAML to version 5.4 or later and replace yaml.load() with yaml.safe_load() in tests/run.py or equivalent parsing paths so that untrusted YAML is not deserialized into arbitrary Python objects. Review all YAML parsing in the project for similar unsafe loader usage and ensure only trusted configuration files are accepted where full object deserialization is required.
- How severe is CVE-2025-50460?
- CVE-2025-50460 has a CVSS v3.1 score of 9.8 (Critical) and an EPSS score of 2.9% (87th percentile) as of Oct 16, 2026.
Recent activity
4 sources tracked across advisories and community write-ups. News coverage will land here when it surfaces.
No news coverage yet. Advisories and community discussion only.