A Leader in the 2026 Gartner® Magic Quadrant™ for Endpoint Protection. Six years running.Six years. Gartner® Magic Quadrant™ Leader.Find Out Why
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-2026-31219

CVE-2026-31219: Optimate Project RCE Vulnerability

CVE-2026-31219 is a remote code execution flaw in the Optimate project caused by insecure deserialization in torch.load(). Attackers can execute arbitrary code via malicious model files. Learn about affected versions and fixes.

Published: May 17, 2026

CVE-2026-31219 Overview

CVE-2026-31219 is an insecure deserialization vulnerability [CWE-502] in the _load_model() function of the neural_magic_training.py script in the optimate project by nebuly-ai. The flaw affects commit a6d302f912b481c94370811af6b11402f51d377f dated 2024-07-21. The function calls torch.load() on a user-supplied model file without setting weights_only=True, allowing the Python Pickle module to deserialize arbitrary objects. A remote attacker who supplies a crafted .pt or .pth model file can execute arbitrary code on the victim's system during model loading.

Critical Impact

Loading an attacker-controlled PyTorch model file triggers arbitrary code execution under the privileges of the user running the training script.

Affected Products

  • optimate project by nebuly-ai (commit a6d302f912b481c94370811af6b11402f51d377f, 2024-07-21)
  • neural_magic_training.py script invoked with the --model argument
  • Environments using torch.load() without weights_only=True

Discovery Timeline

  • 2026-05-12 - CVE-2026-31219 published to NVD
  • 2026-05-15 - Last updated in NVD database

Technical Details for CVE-2026-31219

Vulnerability Analysis

The _load_model() function accepts a file path from the --model command-line argument and passes it directly to torch.load(). PyTorch's torch.load() historically defaults to unpickling the file contents, which invokes arbitrary Python callables defined inside the serialized object graph. Without weights_only=True, any __reduce__ method embedded in a malicious checkpoint executes during deserialization. The attack runs in the same process context as the training workflow, giving the attacker access to local files, credentials, and network resources available to the user.

Root Cause

The root cause is the use of Python's Pickle-based loader on untrusted input. torch.load() relies on pickle to reconstruct tensors and supporting objects. When weights_only=True is not specified, the loader permits any class to be instantiated, including classes that execute commands through os.system, subprocess.Popen, or eval. The script provides no signature validation, path restriction, or sandboxing before invoking the loader.

Attack Vector

An attacker hosts or distributes a crafted .pt or .pth file containing a Pickle payload whose __reduce__ method runs shell commands. The victim invokes the training script with --model <attacker_file>, and the payload executes during the torch.load() call. Delivery vectors include public model hubs, shared storage, supply-chain compromise of model repositories, and phishing links. The vulnerability is exploited at low complexity and requires only that the victim load the file.

No verified public proof-of-concept code is available. The exploitation pattern follows the documented PyTorch pickle deserialization technique. See the GitHub Repository for Optimate for the affected source.

Detection Methods for CVE-2026-31219

Indicators of Compromise

  • Unexpected child processes spawned by Python interpreters running neural_magic_training.py
  • .pt or .pth files originating from untrusted sources, public hubs, or unsigned channels
  • Outbound network connections from training hosts to unfamiliar domains immediately after model load
  • Modifications to user profile scripts, SSH keys, or cron entries during or after model loading

Detection Strategies

  • Inspect Python invocations for torch.load( calls that omit the weights_only=True argument using static code analysis (for example, Bandit or Semgrep rules).
  • Hunt for process trees where python spawns sh, bash, curl, wget, or powershell shortly after reading a .pt or .pth file.
  • Compare hashes of loaded model files against an allow-list of approved checkpoints.

Monitoring Recommendations

  • Enable command-line and process-creation auditing on hosts that run ML training workloads.
  • Forward Python audit hook events and EDR telemetry to a centralized SIEM for correlation.
  • Alert on torch.load activity that precedes outbound connections to non-corporate IP ranges.

How to Mitigate CVE-2026-31219

Immediate Actions Required

  • Stop loading .pt or .pth files from untrusted sources with the affected optimate commit.
  • Patch _load_model() to pass weights_only=True to torch.load() or migrate to safetensors for checkpoint storage.
  • Audit existing checkpoints and rebuild any sourced from external repositories.
  • Restrict the training script's runtime privileges and isolate it inside a container or dedicated user account.

Patch Information

No official fix commit is listed in the NVD record at the time of publication. Maintainers and downstream users should modify _load_model() in neural_magic_training.py to enforce weights_only=True, validate file provenance, and reject pickle-only checkpoints. Refer to the GitHub Repository for Optimate and the Notion CVE-2026-31219 Details for upstream status.

Workarounds

  • Convert trusted checkpoints to the safetensors format, which does not execute code during loading.
  • Run model-loading code inside a sandboxed environment with no network egress and minimal filesystem access.
  • Apply a wrapper that rejects any torch.load() call missing weights_only=True through a Python audit hook.
bash
# Configuration example: enforce safe loading and block untrusted checkpoints
export PYTHONNODEBUGRANGES=1
python -c "import torch; torch.load('model.pt', weights_only=True)"
# Reject files not on the allow-list
sha256sum -c approved_models.sha256 || exit 1

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

  • Vulnerability Details
  • TypeRCE

  • Vendor/TechTorch

  • SeverityHIGH

  • CVSS Score8.8

  • EPSS Probability0.42%

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

  • Notion CVE-2026-31219 Details
  • Related CVEs
  • CVE-2026-31218: Optimate Project RCE Vulnerability

  • CVE-2026-31253: Flash-Attention Framework RCE Vulnerability
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today 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