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.

What is the risk?

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.

What systems are affected?

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

How severe is it?

CVSS 3.1
9.8 / 10
EPSS
0.5%
chance of exploitation in 30 days
Higher than 40% 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, VulnCheck KEV, CISA SSVC, EPSS, Metasploit, Exploit-DB, trickest/cve, Nuclei templates, and inthewild.io exploitation reports.

What is the 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

What should I do?

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.

What does CISA's SSVC say?

Decision Track*
Exploitation poc
Automatable Yes
Technical Impact partial

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

How is it classified?

Which compliance frameworks are affected?

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.51%.

What is the AI security impact?

Affected AI Architectures

model registriestraining pipelinesmodel servingMLOps/CI-CD pipelinesmodel hub integrations

MITRE ATLAS Techniques

AML.T0010.003 Model
AML.T0011.000 Unsafe AI Artifacts
AML.T0018.002 Embed Malware
AML.T0058 Publish Poisoned Models
AML.T0074 Masquerading
AML.T0107 Exploitation for Defense Evasion

Compliance Controls Affected

EU AI Act: Article 15, Article 9
ISO 42001: A.6.2, A.9.3
NIST AI RMF: GOVERN 1.7, MANAGE 2.4
OWASP LLM Top 10: LLM03:2025

What are the technical details?

Original Advisory

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.

Weaknesses (CWE)

CWE-345 — Insufficient Verification of Data Authenticity: The product does not sufficiently verify the origin or authenticity of data, in a way that causes it to accept invalid data.

Source: MITRE CWE corpus.

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