CVE-2025-1945: picklescan: ZIP flag bypass enables RCE in PyTorch models

GHSA-w8jq-xcqf-f792 CRITICAL PoC AVAILABLE CISA: TRACK*
Published March 10, 2025
CISO Take

picklescan is a widely-deployed security gate for PyTorch model files — this vulnerability completely nullifies that control. An attacker can distribute malicious .pt/.pth files that pass picklescan inspection while executing arbitrary code on load via torch.load(). Update picklescan to 0.0.23 immediately and re-scan all previously cleared model files; any CI/CD or model registry pipeline that relied on picklescan < 0.0.23 should be treated as potentially compromised.

Risk Assessment

Critical risk for ML teams using picklescan as their primary or sole defense against unsafe model deserialization. The bypass is deterministic — flipping specific ZIP header bits is a reproducible technique requiring no special privileges or network access. EPSS is currently low (0.31%), suggesting no mass exploitation yet, but the patch and advisory are public, compressing the weaponization window. Organizations with public-facing model registries or shared model stores face the highest exposure. Defense-in-depth gaps are the core issue: most ML pipelines trust picklescan as a single control point rather than layering it with sandbox loading or format enforcement.

Affected Systems

Package Ecosystem Vulnerable Range Patched
picklescan pip No patch
402 3 dependents Pushed 2mo ago 95% patched ~12d to patch Full package profile →
picklescan pip < 0.0.23 0.0.23
402 3 dependents Pushed 2mo ago 95% patched ~12d to patch Full package profile →

Severity & Risk

CVSS 3.1
9.8 / 10
EPSS
0.9%
chance of exploitation in 30 days
Higher than 75% of all CVEs
Exploitation Status
Exploit Available
Exploitation: MEDIUM
Sophistication
Moderate
Exploitation Confidence
medium
CISA SSVC: Public PoC
Public PoC indexed (trickest/cve)
Composite signal derived from CISA KEV, CISA SSVC, EPSS, trickest/cve, and Nuclei templates.

Attack Surface

AV AC PR UI S C I A
AV Network
AC Low
PR None
UI None
S Unchanged
C High
I High
A High

Recommended Action

7 steps
  1. PATCH

    Update picklescan to >= 0.0.23 on all systems immediately (pip install --upgrade picklescan).

  2. RE-SCAN: Re-run updated picklescan against all model files previously scanned and cleared by older versions.

  3. FORMAT ENFORCEMENT

    Migrate to safetensors format (huggingface/safetensors) wherever possible — eliminates pickle deserialization risk entirely.

  4. TORCH LOAD HARDENING

    Enforce weights_only=True in all torch.load() calls (PyTorch >= 2.0) as a defense-in-depth measure; this disables arbitrary code execution during deserialization.

  5. SANDBOX LOADING

    Load untrusted models in isolated containers/VMs with no network access and minimal privileges before promoting to production.

  6. DETECTION

    Alert on picklescan version < 0.0.23 in your package inventories via SCA tooling (Dependabot, Snyk, Renovate).

  7. SUPPLY CHAIN

    Audit upstream model sources — any model pulled from public repositories (HuggingFace Hub, Kaggle, GitHub) since this technique became known should be re-validated.

CISA SSVC Assessment

Decision Track*
Exploitation poc
Automatable Yes
Technical Impact partial

Source: CISA Vulnrichment (SSVC v2.0). Decision based on the CISA Coordinator decision tree.

Classification

Compliance Impact

This CVE is relevant to:

EU AI Act
Article 15 - Accuracy, robustness and cybersecurity Article 9 - Risk management system
ISO 42001
A.6.2 - AI system supply chain management A.9.3 - Verification and validation of AI system
NIST AI RMF
GOVERN 1.7 - AI risk management processes are in place MANAGE 2.4 - Residual risks are managed
OWASP LLM Top 10
LLM03:2025 - Supply Chain Vulnerabilities

Frequently Asked Questions

What is CVE-2025-1945?

picklescan is a widely-deployed security gate for PyTorch model files — this vulnerability completely nullifies that control. An attacker can distribute malicious .pt/.pth files that pass picklescan inspection while executing arbitrary code on load via torch.load(). Update picklescan to 0.0.23 immediately and re-scan all previously cleared model files; any CI/CD or model registry pipeline that relied on picklescan < 0.0.23 should be treated as potentially compromised.

Is CVE-2025-1945 actively exploited?

Proof-of-concept exploit code is publicly available for CVE-2025-1945, increasing the risk of exploitation.

How to fix CVE-2025-1945?

1. PATCH: Update picklescan to >= 0.0.23 on all systems immediately (pip install --upgrade picklescan). 2. RE-SCAN: Re-run updated picklescan against all model files previously scanned and cleared by older versions. 3. FORMAT ENFORCEMENT: Migrate to safetensors format (huggingface/safetensors) wherever possible — eliminates pickle deserialization risk entirely. 4. TORCH LOAD HARDENING: Enforce weights_only=True in all torch.load() calls (PyTorch >= 2.0) as a defense-in-depth measure; this disables arbitrary code execution during deserialization. 5. SANDBOX LOADING: Load untrusted models in isolated containers/VMs with no network access and minimal privileges before promoting to production. 6. DETECTION: Alert on picklescan version < 0.0.23 in your package inventories via SCA tooling (Dependabot, Snyk, Renovate). 7. SUPPLY CHAIN: Audit upstream model sources — any model pulled from public repositories (HuggingFace Hub, Kaggle, GitHub) since this technique became known should be re-validated.

What systems are affected by CVE-2025-1945?

This vulnerability affects the following AI/ML architecture patterns: model registries, training pipelines, model serving, MLOps/CI-CD pipelines, model hub integrations.

What is the CVSS score for CVE-2025-1945?

CVE-2025-1945 has a CVSS v3.1 base score of 9.8 (CRITICAL). The EPSS exploitation probability is 0.87%.

Technical Details

NVD Description

picklescan before 0.0.23 fails to detect malicious pickle files inside PyTorch model archives when certain ZIP file flag bits are modified. By flipping specific bits in the ZIP file headers, an attacker can embed malicious pickle files that remain undetected by PickleScan while still being successfully loaded by PyTorch's torch.load(). This can lead to arbitrary code execution when loading a compromised model.

Exploitation Scenario

An adversary targets an organization's internal model registry that uses picklescan as a pre-upload security gate. They craft a malicious PyTorch model file containing a pickle payload that establishes a reverse shell. By flipping specific general-purpose bit flags in the ZIP local file headers of the .pt archive, the file passes picklescan's detection logic while remaining fully parseable by Python's zipfile module and PyTorch's torch.load(). The attacker uploads the trojanized model to a public HuggingFace repository or injects it into the organization's model supply chain (e.g., via a compromised third-party model vendor). A data scientist or MLOps pipeline calls torch.load() on the model — picklescan raises no alert — and the payload executes with the privileges of the loading process, granting the attacker initial access to the ML infrastructure.

CVSS Vector

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Timeline

Published
March 10, 2025
Last Modified
December 29, 2025
First Seen
March 10, 2025

Related Vulnerabilities