CVE-2025-71350: picklescan: scanner bypass enables pickle RCE
HIGH PoC AVAILABLE CISA: ATTENDpicklescan, a widely-used tool for scanning pickle files for malicious code before they're loaded into ML pipelines, fails to detect payloads that abuse the torch.utils.collect_env.run function inside a pickle's __reduce__ method, letting a crafted file execute arbitrary commands the moment it's deserialized. This matters less because of raw exploit probability — EPSS sits at 0.395% (top 68th percentile, no public PoC, no Nuclei template, not in CISA KEV) — and more because of what fails silently: teams that rely on picklescan as their safety gate before torch.load() will get a false 'clean' verdict on a genuinely malicious model file, defeating the exact control meant to catch this. The CVSS 8.1 (C:H/I:H) reflects that once a victim opens the file, full confidentiality and integrity compromise follows with no additional barriers beyond user interaction. Upgrade picklescan to 0.0.28+ immediately, and treat any picklescan-only gate as insufficient — pair it with format migration to safetensors or sandboxed/isolated loading for any pickle-based artifact from an untrusted source.
What is the risk?
CVSS 8.1 (network, low complexity, no privileges, user interaction required) reflects high confidentiality and integrity impact with no availability impact — consistent with arbitrary command execution triggered on deserialization rather than a crash. Actual exploitation likelihood is currently low: EPSS is 0.395% and there is no public exploit code or scanner template, and the CVE is not in CISA KEV. The real risk driver is not active exploitation but false assurance — this is a bypass of a security control itself, so organizations that treat 'picklescan passed' as sufficient clearance for loading a pickle file are exposed without knowing it. Risk should be rated high for any pipeline that gates untrusted model/artifact ingestion solely on picklescan, and low-to-moderate otherwise.
How does the attack unfold?
What systems are affected?
| Package | Ecosystem | Vulnerable Range | Patched |
|---|---|---|---|
| picklescan | pip | — | No patch |
| PyTorch | pip | — | No patch |
How severe is it?
What is the attack surface?
What should I do?
1 step-
Upgrade picklescan to version 0.0.28 or later immediately across all CI/CD and ingestion pipelines that use it as an artifact gate. Do not treat picklescan as a sole control — prefer safetensors or other non-executable serialization formats for model storage/distribution wherever possible. For pipelines that must accept pickle files, load them in an isolated/sandboxed environment (containers with no network egress, minimal privileges, no access to secrets) regardless of scanner verdict. Layer detection: combine picklescan with fickling or manual review of opcode streams for known-dangerous reduce targets, and monitor for outbound connections or subprocess spawns immediately following model-load events as a detection signal.
What does CISA's SSVC say?
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:
Frequently Asked Questions
What is CVE-2025-71350?
picklescan, a widely-used tool for scanning pickle files for malicious code before they're loaded into ML pipelines, fails to detect payloads that abuse the torch.utils.collect_env.run function inside a pickle's __reduce__ method, letting a crafted file execute arbitrary commands the moment it's deserialized. This matters less because of raw exploit probability — EPSS sits at 0.395% (top 68th percentile, no public PoC, no Nuclei template, not in CISA KEV) — and more because of what fails silently: teams that rely on picklescan as their safety gate before torch.load() will get a false 'clean' verdict on a genuinely malicious model file, defeating the exact control meant to catch this. The CVSS 8.1 (C:H/I:H) reflects that once a victim opens the file, full confidentiality and integrity compromise follows with no additional barriers beyond user interaction. Upgrade picklescan to 0.0.28+ immediately, and treat any picklescan-only gate as insufficient — pair it with format migration to safetensors or sandboxed/isolated loading for any pickle-based artifact from an untrusted source.
Is CVE-2025-71350 actively exploited?
Proof-of-concept exploit code is publicly available for CVE-2025-71350, increasing the risk of exploitation.
How to fix CVE-2025-71350?
Upgrade picklescan to version 0.0.28 or later immediately across all CI/CD and ingestion pipelines that use it as an artifact gate. Do not treat picklescan as a sole control — prefer safetensors or other non-executable serialization formats for model storage/distribution wherever possible. For pipelines that must accept pickle files, load them in an isolated/sandboxed environment (containers with no network egress, minimal privileges, no access to secrets) regardless of scanner verdict. Layer detection: combine picklescan with fickling or manual review of opcode streams for known-dangerous reduce targets, and monitor for outbound connections or subprocess spawns immediately following model-load events as a detection signal.
What systems are affected by CVE-2025-71350?
This vulnerability affects the following AI/ML architecture patterns: training pipelines, model serving, MLOps/model registries.
What is the CVSS score for CVE-2025-71350?
CVE-2025-71350 has a CVSS v3.1 base score of 8.1 (HIGH). The EPSS exploitation probability is 0.40%.
What is the AI security impact?
Affected AI Architectures
MITRE ATLAS Techniques
AML.T0010.001 AI Software AML.T0011 User Execution AML.T0011.000 Unsafe AI Artifacts AML.T0018.002 Embed Malware AML.T0050 Command and Scripting Interpreter Compliance Controls Affected
What are the technical details?
Original Advisory
picklescan before 0.0.28 fails to detect malicious pickle files using torch.utils.collect_env.run function in reduce methods. Attackers can embed undetected code in pickle files that executes remote commands when loaded by victims.
Exploitation Scenario
An attacker crafts a malicious PyTorch checkpoint whose pickle stream embeds a __reduce__ call that invokes torch.utils.collect_env.run with an attacker-controlled command string, then uploads it to a model-sharing platform or sends it directly to a target research team disguised as a legitimate fine-tuned checkpoint. The victim's ingestion pipeline runs picklescan (pre-0.0.28) as a safety gate; because the payload rides on a legitimate torch utility function rather than a known-dangerous builtin, the scanner reports the file clean. A data scientist or automated pipeline then calls torch.load() on the 'verified' file, triggering deserialization, which executes the embedded command and grants the attacker code execution on the host running the ML workload — potentially a training server, inference node, or CI runner with access to credentials, other models, or internal networks.
Weaknesses (CWE)
CWE-502 — Deserialization of Untrusted Data: The product deserializes untrusted data without sufficiently ensuring that the resulting data will be valid.
- [Architecture and Design, Implementation] If available, use the signing/sealing features of the programming language to assure that deserialized data has not been tainted. For example, a hash-based message authentication code (HMAC) could be used to ensure that data has not been modified.
- [Implementation] When deserializing data, populate a new object rather than just deserializing. The result is that the data flows through safe input validation and that the functions are safe.
Source: MITRE CWE corpus.
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N References
Timeline
Related Vulnerabilities
CVE-2024-5452 9.8 pytorch-lightning: RCE via deepdiff Delta deserialization
Same package: torch CVE-2023-43654 9.8 TorchServe: SSRF + RCE via unrestricted model URL loading
Same package: torch CVE-2022-45907 9.8 PyTorch: RCE via unsafe eval in JIT annotations
Same package: torch CVE-2022-0845 9.8 pytorch-lightning: code injection enables full RCE
Same package: torch CVE-2024-35198 9.8 TorchServe: URL bypass enables arbitrary model loading
Same package: torch