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
    • 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-1945

CVE-2025-1945: Mmaitre314 Picklescan RCE Vulnerability

CVE-2025-1945 is a remote code execution flaw in Mmaitre314 Picklescan that allows attackers to bypass detection of malicious pickle files in PyTorch models. This article covers technical details, affected versions, and mitigation.

Published: March 25, 2026

CVE-2025-1945 Overview

CVE-2025-1945 is an Insecure Deserialization vulnerability affecting PickleScan, a security tool designed to detect malicious pickle files in machine learning model archives. The vulnerability allows attackers to bypass PickleScan's detection mechanisms by manipulating specific flag bits in ZIP file headers. When certain bits in the ZIP file headers are flipped, malicious pickle files embedded within PyTorch model archives remain undetected by PickleScan while still being successfully loaded by PyTorch's torch.load() function, potentially leading to arbitrary code execution.

Critical Impact

Attackers can embed malicious pickle files in PyTorch model archives that bypass security scanning while still executing arbitrary code when the model is loaded, compromising ML/AI pipeline security.

Affected Products

  • mmaitre314 picklescan versions prior to 0.0.23

Discovery Timeline

  • 2025-03-10 - CVE-2025-1945 published to NVD
  • 2025-12-29 - Last updated in NVD database

Technical Details for CVE-2025-1945

Vulnerability Analysis

This vulnerability exploits a fundamental weakness in how PickleScan parses ZIP file structures compared to PyTorch's more permissive torch.load() implementation. The discrepancy arises because PickleScan uses Python's standard zipfile module with strict header validation, while PyTorch's loading mechanism is more forgiving of header anomalies.

The attack takes advantage of CWE-345 (Insufficient Verification of Data Authenticity), where PickleScan fails to properly validate and process ZIP archives with modified flag bits. An attacker can craft a PyTorch model archive (.pt or .pth file) containing malicious pickle payloads that execute arbitrary Python code upon deserialization. The modified ZIP headers cause PickleScan to either skip scanning certain files or misinterpret the archive structure entirely.

Root Cause

The root cause lies in PickleScan's reliance on the standard Python zipfile module, which strictly adheres to ZIP format specifications. When specific flag bits in ZIP file headers are modified, the standard zipfile implementation may fail to recognize or properly process embedded files. However, PyTorch's torch.load() uses a more relaxed parsing approach that successfully extracts and deserializes these files regardless of the header modifications. This parsing discrepancy creates a security gap where malicious content passes through undetected.

Attack Vector

The attack is network-based and requires user interaction. An attacker would:

  1. Create a PyTorch model archive containing malicious pickle files designed to execute arbitrary code
  2. Modify specific ZIP file header flag bits to evade PickleScan detection
  3. Distribute the compromised model through model repositories, shared storage, or supply chain attacks
  4. When a victim downloads and loads the model using torch.load(), the malicious pickle payload executes with the user's privileges

The fix introduced a RelaxedZipFile class that implements more permissive ZIP parsing to match PyTorch's behavior:

python
+import struct
+import zipfile
+
+# More forgiving implementation of zipfile.ZipFile
+_FH_SIGNATURE = 0
+_FH_FILENAME_LENGTH = 10
+_FH_EXTRA_FIELD_LENGTH = 11
+
+structFileHeader = "<4s2B4HL2L2H"
+stringFileHeader = b"PK\\003\\004"
+sizeFileHeader = struct.calcsize(structFileHeader)
+
+
+class RelaxedZipFile(zipfile.ZipFile):
+    def open(self, name, mode="r", pwd=None, *, force_zip64=False):
+        # near copy of zipfile.ZipFile.open with
+        """Return file-like object for 'name'.
+
+        name is a string for the file name within the ZIP file, or a ZipInfo
+        object.
+
+        mode should be 'r' to read a file already in the ZIP file, or 'w' to
+        write to a file newly added to the archive.
+
+        pwd is the password to decrypt files (only used for reading).
+
+        When writing, if the file size is not known in advance but may exceed
+        2 GiB, pass force_zip64 to use the ZIP64 format, which can handle large
+        files.  If the size is known in advance, it is best to pass a ZipInfo
+        instance for name, with zinfo.file_size set.

Source: GitHub Commit

The scanner was then updated to use this new relaxed implementation:

python
 from typing import IO, List, Optional, Set, Tuple
 import urllib.parse
 import zipfile
+from .relaxed_zipfile import RelaxedZipFile
 
 from .torch import (
     get_magic_number,

Source: GitHub Commit

Detection Methods for CVE-2025-1945

Indicators of Compromise

  • PyTorch model files (.pt, .pth) with unusual or modified ZIP file header structures
  • Model archives that fail standard ZIP validation but load successfully with torch.load()
  • Unexpected process spawning or network connections during model loading operations
  • Suspicious pickle opcodes like REDUCE, BUILD, or GLOBAL referencing dangerous modules such as os, subprocess, or builtins

Detection Strategies

  • Implement secondary validation of model archives using multiple ZIP parsing implementations to detect header manipulation
  • Monitor for code execution attempts during model deserialization operations
  • Deploy endpoint detection for suspicious child processes spawned by Python/ML workloads
  • Audit model provenance and implement integrity verification for downloaded models

Monitoring Recommendations

  • Enable detailed logging for all model loading operations in ML pipelines
  • Alert on ZIP parsing discrepancies or errors during security scans of model files
  • Monitor network activity originating from processes loading untrusted model files
  • Track file system modifications and process creation events during torch.load() calls

How to Mitigate CVE-2025-1945

Immediate Actions Required

  • Upgrade PickleScan to version 0.0.23 or later immediately
  • Re-scan all previously scanned model archives with the updated version
  • Audit model repositories and shared storage for potentially compromised models
  • Implement model provenance verification and cryptographic signing where possible

Patch Information

The vulnerability has been addressed in PickleScan version 0.0.23. The fix introduces a RelaxedZipFile class in src/picklescan/relaxed_zipfile.py that implements more permissive ZIP file parsing to match PyTorch's behavior, ensuring consistent detection regardless of ZIP header modifications.

Patch details are available in the GitHub Security Advisory and the specific commit fix.

Workarounds

  • Avoid loading PyTorch models from untrusted sources until PickleScan is updated
  • Use torch.load() with weights_only=True parameter when possible to restrict deserialization
  • Implement additional validation layers using alternative ZIP parsing libraries
  • Consider sandboxing model loading operations in isolated environments
bash
# Upgrade PickleScan to patched version
pip install --upgrade picklescan>=0.0.23

# Verify installed version
pip show picklescan | grep Version

# Re-scan existing model archives
picklescan --path /path/to/models/

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

  • Vulnerability Details
  • TypeRCE

  • Vendor/TechMmaitre314 Picklescan

  • SeverityMEDIUM

  • CVSS Score5.3

  • EPSS Probability0.31%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:L/VA:L/SC:N/SI:L/SA:L/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityLow
  • AvailabilityLow
  • CWE References
  • CWE-345

  • NVD-CWE-noinfo
  • Technical References
  • Sonatype CVE-2025-1945 Advisory
  • Vendor Resources
  • GitHub Commit Update

  • GitHub Security Advisory
  • Related CVEs
  • CVE-2025-1716: Mmaitre314 Picklescan RCE Vulnerability

  • CVE-2025-10156: Mmaitre314 Picklescan RCE Vulnerability

  • CVE-2025-1889: Picklescan Information Disclosure Flaw
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