{"id":61030,"date":"2025-08-07T13:18:07","date_gmt":"2025-08-07T13:18:07","guid":{"rendered":""},"modified":"2025-09-04T22:36:56","modified_gmt":"2025-09-05T04:36:56","slug":"cve-2025-50472-arbitrary-code-execution-vulnerability-in-modelscope-ms-swift-library","status":"publish","type":"post","link":"https:\/\/www.ameeba.com\/blog\/cve-2025-50472-arbitrary-code-execution-vulnerability-in-modelscope-ms-swift-library\/","title":{"rendered":"<strong>CVE-2025-50472: Arbitrary Code Execution Vulnerability in modelscope\/ms-swift library<\/strong>"},"content":{"rendered":"<p><strong>Overview<\/strong><\/p>\n<p>CVE-2025-50472 is a critical vulnerability that resides in the modelscope\/ms-swift library up to and including version 2.6.1. The vulnerability allows an attacker to execute arbitrary code remotely by exploiting the deserialization of untrusted data in the `load_model_meta()` function. This flaw poses a serious threat to any system running the <a href=\"https:\/\/www.ameeba.com\/blog\/cve-2025-5243-critical-security-vulnerability-in-smg-software-information-portal\/\"  data-wpil-monitor-id=\"68010\">vulnerable software<\/a>, potentially leading to system compromise or leakage of sensitive data.<br \/>\nThe <a href=\"https:\/\/www.ameeba.com\/blog\/cve-2025-8028-critical-vulnerability-in-firefox-and-thunderbird-due-to-incorrect-computation-of-branch-address\/\"  data-wpil-monitor-id=\"73838\">vulnerability is particularly concerning due<\/a> to the stealthy nature of its exploitation. The malicious payload is hidden, and the normal training process remains unaffected even after the arbitrary <a href=\"https:\/\/www.ameeba.com\/blog\/cve-2025-50460-remote-code-execution-vulnerability-in-ms-swift-project\/\"  data-wpil-monitor-id=\"71420\">code execution<\/a>, making it extremely difficult for the user to detect any malicious activities. This blog <a href=\"https:\/\/www.ameeba.com\/blog\/cve-2025-24000-authentication-bypass-vulnerability-in-wpexperts-post-smtp-plugin\/\"  data-wpil-monitor-id=\"78990\">post offers a detailed analysis of the vulnerability<\/a>, its potential impact, and the steps necessary to mitigate its risks.<\/p>\n<p><strong>Vulnerability Summary<\/strong><\/p>\n<p>CVE ID: CVE-2025-50472<br \/>\nSeverity: Critical (CVSS 9.8)<br \/>\nAttack Vector: Network<br \/>\nPrivileges Required: None<br \/>\nUser Interaction: Required<br \/>\nImpact: <a href=\"https:\/\/www.ameeba.com\/blog\/cve-2025-50160-heap-based-buffer-overflow-in-windows-rras-posing-system-compromise-risk\/\"  data-wpil-monitor-id=\"78588\">System Compromise<\/a>, Potential Data Leakage<\/p>\n<p><strong>Affected Products<\/strong><\/p><div id=\"ameeb-1472791387\" class=\"ameeb-content-2 ameeb-entity-placement\"><div style=\"border-left: 4px solid #555; padding-left: 20px; margin: 48px 0; font-family: Roboto, sans-serif; color: #ffffff; line-height: 1.6; max-width: 700px;\">\r\n  <h2 style=\"margin-top: 0; font-size: 20px; font-weight: 600; display: flex; align-items: center;\">\r\n    <a href=\"https:\/\/www.ameeba.com\/chat\" style=\"display: inline-flex; align-items: center; margin-right: 8px;\">\r\n      <img decoding=\"async\" src=\"https:\/\/www.ameeba.com\/blog\/wp-content\/uploads\/2025\/10\/Best-App-icon-Ameeba.png\" alt=\"Ameeba Chat Icon\" style=\"width: 40px; height: 40px;\" \/>\r\n    <\/a>\r\n    A new way to communicate\r\n  <\/h2>\r\n\r\n  <p style=\"margin-bottom: 12px;\">\r\n    Ameeba Chat is built on encrypted identity, not personal profiles.\r\n  <\/p>\r\n\r\n  <p style=\"margin-bottom: 16px;\">\r\n    Message, call, share files, and coordinate with identities kept separate.\r\n  <\/p>\r\n\r\n  <ul style=\"list-style: none; padding-left: 0; margin-bottom: 20px;\">\r\n    <li>\u2022 Encrypted identity<\/li>\r\n    <li>\u2022 Ameeba Chat authenticates access<\/li>\r\n    <li>\u2022 Aliases and categories<\/li>\r\n    <li>\u2022 End-to-end encrypted chat, calls, and files<\/li>\r\n    <li>\u2022 Secure notes for sensitive information<\/li>\r\n  <\/ul>\r\n\r\n  <p style=\"font-style: italic; font-weight: 600; margin-bottom: 24px;\">\r\n    Private communication, rethought.\r\n  <\/p>\r\n\r\n  <div style=\"display: flex; flex-wrap: wrap; gap: 12px;\">\r\n    <a href=\"https:\/\/www.ameeba.com\/chat\/download\" style=\"background-color: #ffffff; color: #000000; padding: 10px 20px; text-decoration: none; border-radius: 6px; font-weight: 500;\">Download Ameeba Chat<\/a>\r\n    <a href=\"https:\/\/www.ameeba.com\/chat\" style=\"border: 1px solid #ffffff; color: #ffffff; padding: 10px 20px; text-decoration: none; border-radius: 6px; font-weight: 500;\">Learn More<\/a>\r\n  <\/div>\r\n<\/div>\r\n<\/div>\n<p>Product | Affected Versions<\/p>\n<p>modelscope\/ms-swift | <= 2.6.1\n\n<strong>How the Exploit Works<\/strong><\/p>\n<p>The vulnerability exploits the `load_model_meta()` function of the `ModelFileSystemCache()` class in the <a href=\"https:\/\/www.ameeba.com\/blog\/cve-2025-48903-permission-bypass-vulnerability-in-media-library-module\/\"  data-wpil-monitor-id=\"72888\">modelscope\/ms-swift<\/a> library. This function uses `pickle.load()` to <a href=\"https:\/\/www.ameeba.com\/blog\/cve-2025-28961-critical-deserialization-of-untrusted-data-vulnerability-in-md-yeasin-ul-haider-url-shortener\/\"  data-wpil-monitor-id=\"70562\">deserialize data from potentially untrusted<\/a> sources.<br \/>\nAn attacker can craft a malicious serialized `.mdl` payload and deceive the victim into loading it during a normal training process. This subsequently <a href=\"https:\/\/www.ameeba.com\/blog\/cve-2025-47168-use-after-free-vulnerability-in-microsoft-office-word-allowing-unauthorized-code-execution\/\"  data-wpil-monitor-id=\"73116\">allows the attacker to execute arbitrary code<\/a> on the targeted machine. The payload file is hidden, making it difficult for the victim to notice any tampering. Moreover, the normal training process remains unaffected even after the <a href=\"https:\/\/www.ameeba.com\/blog\/cve-2025-30327-integer-overflow-vulnerability-in-incopy-leading-to-potential-arbitrary-code-execution\/\"  data-wpil-monitor-id=\"73554\">arbitrary code<\/a> execution, leaving the user unaware of the exploit.<\/p>\n<p><strong>Conceptual Example Code<\/strong><\/p>\n<p>While the actual exploit code is complex and beyond the scope of this blog post due to its malicious nature, a conceptual example might look something like this:<\/p><div id=\"ameeb-2251912677\" class=\"ameeb-content ameeb-entity-placement\"><div class=\"poptin-embedded\" data-id=\"f6b387694f681\"><\/div>\r\n\r\n\r\n\r\n\r\n\r\n<\/div>\n<pre><code class=\"\" data-line=\"\">import pickle\nimport os\n# Malicious code to be executed\nclass Exploit(object):\ndef __reduce__(self):\nreturn (os.system, (&#039;&lt;arbitrary command&gt;&#039;,))\n# Serialize malicious code into .mdl payload\nwith open(&#039;.hidden_mdl_payload.mdl&#039;, &#039;wb&#039;) as file:\npickle.dump(Exploit(), file)<\/code><\/pre>\n<p>In this conceptual example, the `Exploit` class defines a `__reduce__` method that, when unpickled, results in the <a href=\"https:\/\/www.ameeba.com\/blog\/cve-2025-54416-arbitrary-command-execution-vulnerability-in-tj-actions-branch-names-github-action\/\"  data-wpil-monitor-id=\"69546\">execution of an arbitrary command<\/a>. This malicious `.mdl` file is then loaded unsuspectingly by the victim during the normal training process, <a href=\"https:\/\/www.ameeba.com\/blog\/cve-2025-25214-race-condition-vulnerability-in-wwbn-avideo-14-4-leading-to-arbitrary-code-execution\/\"  data-wpil-monitor-id=\"67505\">leading to arbitrary code<\/a> execution.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Overview CVE-2025-50472 is a critical vulnerability that resides in the modelscope\/ms-swift library up to and including version 2.6.1. The vulnerability allows an attacker to execute arbitrary code remotely by exploiting the deserialization of untrusted data in the `load_model_meta()` function. This flaw poses a serious threat to any system running the vulnerable software, potentially leading to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"footnotes":""},"categories":[1],"tags":[],"vendor":[],"product":[],"attack_vector":[80],"asset_type":[],"severity":[],"exploit_status":[],"class_list":["post-61030","post","type-post","status-publish","format-standard","hentry","category-uncategorized","attack_vector-rce"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.ameeba.com\/blog\/wp-json\/wp\/v2\/posts\/61030","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ameeba.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ameeba.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ameeba.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ameeba.com\/blog\/wp-json\/wp\/v2\/comments?post=61030"}],"version-history":[{"count":11,"href":"https:\/\/www.ameeba.com\/blog\/wp-json\/wp\/v2\/posts\/61030\/revisions"}],"predecessor-version":[{"id":71391,"href":"https:\/\/www.ameeba.com\/blog\/wp-json\/wp\/v2\/posts\/61030\/revisions\/71391"}],"wp:attachment":[{"href":"https:\/\/www.ameeba.com\/blog\/wp-json\/wp\/v2\/media?parent=61030"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ameeba.com\/blog\/wp-json\/wp\/v2\/categories?post=61030"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ameeba.com\/blog\/wp-json\/wp\/v2\/tags?post=61030"},{"taxonomy":"vendor","embeddable":true,"href":"https:\/\/www.ameeba.com\/blog\/wp-json\/wp\/v2\/vendor?post=61030"},{"taxonomy":"product","embeddable":true,"href":"https:\/\/www.ameeba.com\/blog\/wp-json\/wp\/v2\/product?post=61030"},{"taxonomy":"attack_vector","embeddable":true,"href":"https:\/\/www.ameeba.com\/blog\/wp-json\/wp\/v2\/attack_vector?post=61030"},{"taxonomy":"asset_type","embeddable":true,"href":"https:\/\/www.ameeba.com\/blog\/wp-json\/wp\/v2\/asset_type?post=61030"},{"taxonomy":"severity","embeddable":true,"href":"https:\/\/www.ameeba.com\/blog\/wp-json\/wp\/v2\/severity?post=61030"},{"taxonomy":"exploit_status","embeddable":true,"href":"https:\/\/www.ameeba.com\/blog\/wp-json\/wp\/v2\/exploit_status?post=61030"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}