The SentinelOne Annual Threat Report - A Defenders Guide from the FrontlinesThe SentinelOne Annual Threat ReportGet the Report
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • AI Data Pipelines
      Security Data Pipeline for AI SIEM and Data Optimization
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2025-50472

CVE-2025-50472: ModelScope ms-swift RCE Vulnerability

CVE-2025-50472 is a remote code execution vulnerability in modelscope/ms-swift library through version 2.6.1 caused by insecure deserialization. This article covers technical details, affected versions, and mitigation.

Published: March 25, 2026

CVE-2025-50472 Overview

CVE-2025-50472 is an insecure deserialization vulnerability affecting the modelscope/ms-swift library through version 2.6.1. The vulnerability exists within the load_model_meta() function of the ModelFileSystemCache() class, where untrusted data is processed using Python's pickle.load() function. This allows attackers to craft malicious serialized .mdl payload files that execute arbitrary code when loaded by victims during what appears to be a normal model training process.

The attack vector is particularly insidious because the malicious payload file is hidden, making detection difficult, and the normal training process continues unaffected after code execution—leaving the victim completely unaware that their system has been compromised.

Critical Impact

This vulnerability enables remote code execution through malicious model checkpoint files. Attackers can execute arbitrary commands on targeted machines while the victim remains unaware, as normal training operations continue uninterrupted after exploitation.

Affected Products

  • modelscope/ms-swift library versions through 2.6.1
  • Python applications utilizing the ModelFileSystemCache() class
  • Machine learning environments loading untrusted model checkpoints

Discovery Timeline

  • 2025-08-01 - CVE-2025-50472 published to NVD
  • 2025-08-04 - Last updated in NVD database

Technical Details for CVE-2025-50472

Vulnerability Analysis

This vulnerability falls under CWE-502 (Deserialization of Untrusted Data), a well-known class of security issues that can lead to severe consequences including remote code execution. The ms-swift library, used for fine-tuning and deploying large language models in the ModelScope ecosystem, contains a caching utility that processes serialized model metadata files.

The core issue stems from the library's use of Python's pickle module to deserialize .mdl files without proper validation. The pickle format is inherently insecure when processing data from untrusted sources, as it can execute arbitrary Python code during the deserialization process. An attacker who can place a malicious .mdl file in a location where the library will load it can achieve code execution with the privileges of the process running the training operation.

The attack is particularly dangerous in machine learning workflows because model checkpoints are frequently shared between researchers, downloaded from public repositories, or transferred between systems. The hidden nature of the payload file and the fact that training continues normally after exploitation means that compromised systems may operate for extended periods without any indication of breach.

Root Cause

The root cause of this vulnerability is the unsafe use of pickle.load() within the load_model_meta() function of the ModelFileSystemCache() class. Python's pickle module can instantiate arbitrary Python objects during deserialization, which attackers can exploit to execute malicious code.

The vulnerable code path is located in the caching utility at line 141 of caching.py. When the library loads model metadata from .mdl files, it trusts the serialized content without validation, allowing crafted payloads to execute arbitrary system commands.

Attack Vector

The attack leverages the network-accessible nature of machine learning model repositories and checkpoint sharing. An attacker can execute this attack through several vectors:

  1. Supply Chain Attack: Compromising a model repository or checkpoint hosting service to inject malicious .mdl files
  2. Social Engineering: Convincing researchers to download and use a seemingly legitimate model checkpoint containing the malicious payload
  3. Shared Storage Compromise: Gaining write access to shared training directories or network file systems

The vulnerability is exploitable without authentication and requires no user interaction beyond loading the compromised checkpoint file. The attack executes automatically during the load_model_meta() function call, and because the malicious file is hidden and training continues normally, victims have no immediate indication of compromise.

Since no verified code examples are available, the vulnerability mechanism can be understood through the vulnerable source code in caching.py and the CVE-2025-50472 proof-of-concept repository which contain technical details about the exploitation technique.

Detection Methods for CVE-2025-50472

Indicators of Compromise

  • Presence of unexpected hidden .mdl files in model checkpoint directories
  • Unusual process spawning from Python training processes, particularly shell processes or network connections
  • Modifications to model checkpoint files with timestamps inconsistent with legitimate training activities
  • Unexpected network connections originating from machine learning training environments

Detection Strategies

  • Implement file integrity monitoring on model checkpoint directories to detect unauthorized modifications
  • Monitor for pickle.load() calls processing data from external or untrusted sources in application logs
  • Use endpoint detection and response (EDR) solutions to identify suspicious child processes spawned during training operations
  • Deploy behavioral analysis to detect anomalous system calls from Python processes during model loading phases

Monitoring Recommendations

  • Enable verbose logging for model loading operations in ms-swift applications
  • Configure alerts for new or modified hidden files (files starting with .) in training directories
  • Implement network segmentation to isolate machine learning training environments from sensitive internal resources
  • Monitor for unusual outbound connections from training hosts that may indicate command-and-control communication

How to Mitigate CVE-2025-50472

Immediate Actions Required

  • Audit all model checkpoints and .mdl files in use for signs of tampering or unexpected content
  • Implement strict access controls on model checkpoint storage locations to prevent unauthorized modifications
  • Isolate machine learning training environments using containers or virtual machines with limited network access
  • Only load model checkpoints from trusted, verified sources with cryptographic integrity validation

Patch Information

As of the last update on 2025-08-04, users should monitor the ms-swift GitHub repository for security patches addressing this deserialization vulnerability. Check for updates beyond version 2.6.1 that implement safe deserialization practices.

Workarounds

  • Validate the integrity of all .mdl files using cryptographic checksums before loading
  • Replace pickle.load() with safer alternatives like json or implement a restricted unpickler that only allows specific safe object types
  • Run training processes in sandboxed environments with limited system privileges
  • Implement a pre-loading scanner that inspects .mdl file contents for suspicious pickle opcodes before deserialization
bash
# Example: Scan for potentially malicious pickle files before loading
# This command finds hidden .mdl files which may indicate tampering
find /path/to/model/checkpoints -name ".*mdl" -type f -ls

# Verify file integrity using checksums
sha256sum /path/to/model/checkpoints/*.mdl > checksums.txt
sha256sum -c checksums.txt

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypeRCE

  • Vendor/TechMs Swift

  • SeverityCRITICAL

  • CVSS Score9.8

  • EPSS Probability0.77%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-502
  • Technical References
  • GitHub Caching Utility Source

  • GitHub CVE-2025-50472 Repository
  • Related CVEs
  • CVE-2025-50460: ms-swift PyYAML Deserialization RCE Flaw
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English