picklescan
CVE-2025-71321
CRITICAL
Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessCraft pickle with distutils.file_util.write_file reduce
-
DeliveryPublish poisoned model to hub or send to victim
-
ExploitVictim runs picklescan which returns safe
-
ExecutionVictim unpickles model in pipeline
-
Persistwrite_file overwrites authorized_keys or config
-
ImpactAchieve persistence or RCE
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A08:2025 - Software or Data Integrity Failures
ASVS 5.0
V1 - Encoding and Sanitization Safe deserialization, type allowlists
MITRE ATT&CK
2 techniques across 2 tactics: Execution, Initial Access The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires the target environment to (1) use picklescan < 0.0.33 as its pickle-safety scanner, (2) treat a clean picklescan result as authorization to load the file, and (3) subsequently unpickle an attacker-supplied pickle, model, or .pkl artifact in a process with write permission to the file the attacker wants to overwrite. The bypass relies on distutils.file_util.write_file being importable in the unpickling Python (distutils is deprecated and removed in Python 3.12+, so victims on 3.12 without a distutils shim are not exploitable via this exact primitive). No authentication or user interaction with picklescan itself is needed, but the picklescan project is a developer tool - exposure depends on whether downstream consumers actually load the scanned pickle. |
| Impact | The CVSS 4.0 score of 9.3 (AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H) reflects network-reachable, no-auth, no-interaction exploitation with high impact on the host that consumes the pickle - appropriate for the ML supply-chain context where users routinely download community models. However, the realistic risk is narrower than the raw score suggests: exploitation requires the victim to (a) use picklescan as their safety check and (b) subsequently unpickle the file the scanner blessed, so the vulnerability is a scanner-bypass, not a direct RCE against picklescan itself. A working PoC is published in the GHSA advisory, but there is no public exploit identified at time of analysis indicating active exploitation and the CVE is not on CISA KEV; no EPSS score is provided in the input. The primary worry is supply-chain - malicious models on Hugging Face / model hubs that defeat picklescan-based gating used by MLOps pipelines. |
| Exploit ScenarioDerived | An attacker publishes a poisoned PyTorch or scikit-learn model to a public model hub; the victim's MLOps pipeline runs picklescan against the .pkl/.bin file, which reports no dangerous calls because distutils is not on the blocklist. When the pipeline subsequently torch.loads or pickle.loads the model, the embedded __reduce__ invokes distutils.file_util.write_file to overwrite ~/.ssh/authorized_keys or a web server config, yielding persistence and remote code execution as documented by the published PoC in the GHSA advisory. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Jun 17, 2026
Arbitrary file write in picklescan before 0.0.33 lets attackers bypass the tool's dangerous-call blocklist by abusing distutils.file_util.write_file inside crafted pickle payloads. Because picklescan is used as a safety gate before loading ML model pickles, a bypass means malicious models pass scanning and can overwrite files on disk to achieve denial of service or remote code execution. Publicly available exploit code exists in the GHSA advisory, though there is no public exploit identified at time of analysis indicating active exploitation.
RemediationAI
Vendor-released patch: upgrade picklescan to 0.0.33 or later (pip install --upgrade picklescan), which adds distutils to the dangerous globals list per the upstream fix in https://github.com/mmaitre314/picklescan/pull/53 and commit 70c1c6c31beb6baaf52c8db1b6c3c0e84a6f9dab; see the advisory at https://github.com/mmaitre314/picklescan/security/advisories/GHSA-m273-6v24-x4m4. Where immediate upgrade is not possible, supplement scanning by extending your own denylist to include distutils.file_util.write_file (and audit for other writable callables such as os.* and pathlib writes), or refuse to unpickle any model from untrusted sources and prefer safetensors-format weights instead - the trade-off is that legitimate distutils-using pickles will be blocked and migrating off pickle requires re-saving models. Treat picklescan as one defense layer only and sandbox the unpickling process (separate user, read-only filesystem, no SSH key access) so that even an arbitrary write cannot reach .ssh/authorized_keys or webroot config.
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in pypi
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
picklescan is a Python library used to statically inspect pickle files (commonly Hugging Face / PyTorch model artifacts) for dangerous opcodes and imports before unpickling. It maintains a denylist of known-bad callables such as builtins.open and shutil.* that can be used to write or overwrite files via pickle's __reduce__ mechanism. The root cause is CWE-502 (Deserialization of Untrusted Data) compounded by an incomplete blocklist: distutils.file_util.write_file performs the same arbitrary file write primitive but was not enumerated, so a __reduce__ returning (distutils.file_util.write_file, (path, lines)) is reported as safe by the scanner and then writes attacker-controlled content when the consuming application loads the pickle. The affected component is cpe:2.3:a:picklescan:picklescan:* up to 0.0.32.
Know when Picklescan gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
Payload is delivered network-wide (e.g., model hub) but the victim must choose to scan-then-load an attacker-supplied pickle, so UI:R; no auth needed and impact is full host compromise.
Primary rating from Vendor (VulnCheck).
CVSS VectorVendor: VulnCheck
DescriptionCVE.org
picklescan before 0.0.33 contains an arbitrary file writing vulnerability that allows attackers to bypass the dangerous blocklist by using distutils.file_util.write_file. Attackers can construct malicious pickle objects to overwrite critical system files and achieve denial of service or remote code execution.
Executive ViewAI
picklescan, a security gating tool for machine learning model validation, contains an arbitrary file write vulnerability (CVE-2025-71321, CVSS 9.3) that allows attackers to bypass safety controls and achieve remote code execution. Organizations using picklescan to validate untrusted ML models face critical risk of supply-chain compromise and system takeover. With publicly available exploit code and no vendor patch currently available, immediate action is required across all affected deployments.
No vendor-released patch identified at time of analysis. Interim mitigations: (1) Eliminate pickle deserialization-migrate ML models to ONNX, TorchScript, or SafeTensors format; (2) Restrict model loading to internal, manually-reviewed repositories; (3) Implement application-level file system access controls to prevent write operations by model-loading processes; (4) Network-segment ML infrastructure from critical business systems to limit lateral movement from compromised loaders.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Insecure deserialization occurs when an application converts serialized data (a stream of bytes representing an object's state) back into a living object without proper validation.
Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.
Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.
Affected Products (CPE)CVE.org
More in Picklescan
View allRemote code execution against users of picklescan versions prior to 1.0.4 is achievable by smuggling any blocked functio
An Improper Handling of Exceptional Conditions vulnerability in the ZIP archive scanning component of mmaitre314 pickles
A Protection Mechanism Failure vulnerability in mmaitre314 picklescan versions up to and including 0.0.30 allows a remot
An Improper Input Validation vulnerability in the scanning logic of mmaitre314 picklescan versions up to and including 0
Detection bypass in picklescan prior to 0.0.29 allows attackers to smuggle remote code execution payloads through pickle
Detection bypass in picklescan versions before 0.0.25 allows attackers to embed remote code execution payloads in pickle
Detection bypass in picklescan before 0.0.28 allows attackers to embed malicious torch.jit.unsupported_tensor_ops.execWr
Detection bypass in picklescan before 0.0.28 allows attackers to smuggle arbitrary code through pickle files by abusing
Detection bypass in picklescan before 0.0.29 allows malicious pickle files to evade scanning by abusing the undetected i
Detection bypass in picklescan versions before 0.0.30 allows malicious pickle files to evade security scanning by using
Detection bypass in picklescan versions prior to 0.0.29 allows attackers to smuggle arbitrary code execution payloads th
Detection bypass in picklescan before 0.0.33 allows attackers to smuggle arbitrary code through malicious pickle files b
NVD
CVE.org
EPSS
Vulnrichment
GitHub
Exploit-DB