CVE-2025-71321: picklescan: blocklist bypass allows arbitrary file write/RCE
CRITICAL PoC AVAILABLE CISA: ATTENDpicklescan, the widely-used ML model scanner specifically built to prevent pickle-based attacks, contains a critical bypass (CVSS 9.8) that allows attackers to invoke distutils.file_util.write_file and circumvent its dangerous-operations blocklist entirely. The threat inversion here is the key risk: organizations running picklescan as a security gate in their model-ingestion pipelines are now themselves the attack surface — the scan act is what triggers the exploit, not the subsequent model load. With no authentication, no user interaction, and network-level access required only to deliver the malicious file, any CI/CD pipeline or MLOps platform that accepts .pkl files from external contributors is directly exposed. No public exploit exists yet and it is not in CISA KEV, but with 68 prior CVEs in this package and a well-understood vulnerability class, weaponization is within reach of any attacker with pickle expertise; upgrade to picklescan ≥0.0.33 immediately and treat all pre-patch scan results as untrustworthy.
What is the risk?
Critical risk for any ML team relying on picklescan as a security control. The vulnerability profile is maximally hostile: network-accessible, zero authentication, zero user interaction, low complexity — the full CVSS 9.8 triple-high reflects this accurately. The compounding factor is trust inversion: picklescan is deployed precisely because teams believe models are safe after scanning; a bypass means the protection layer silently converts into an attack surface without any visible indicator of compromise. Automated scanning pipelines that consume models from model hubs, open-source contributors, or third-party vendors face immediate RCE risk on the scanning host. The 68 prior CVEs in this package signal a recurring pattern of security gaps in the tool, warranting an architectural review of whether pickle-based scanning alone is sufficient defense.
How does the attack unfold?
What systems are affected?
| Package | Ecosystem | Vulnerable Range | Patched |
|---|---|---|---|
| picklescan | pip | — | No patch |
Do you use picklescan? You're affected.
How severe is it?
What is the attack surface?
What should I do?
6 steps-
Patch: Upgrade picklescan to ≥0.0.33 immediately — this is the only complete fix.
-
Isolate scanners: Run picklescan in a minimal container with a read-only filesystem and no network egress so that a bypass cannot reach critical paths; treat the scan host as untrusted until patched.
-
Audit history: Review scan logs for any pickle files processed before patching from untrusted sources; assume any such file may have been a weaponized attempt.
-
Complement with format alternatives: Adopt safetensors for model sharing wherever possible — it avoids pickle serialization entirely and eliminates this class of risk.
-
Detect: Monitor for unexpected file write events from scanning processes (auditd, eBPF-based tools) and alert on any outbound connections originating from model-scan jobs.
-
Defense-in-depth: Do not rely solely on picklescan; layer with static analysis (fickling) and sandbox deserialization in ephemeral VMs for untrusted sources.
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-71321?
picklescan, the widely-used ML model scanner specifically built to prevent pickle-based attacks, contains a critical bypass (CVSS 9.8) that allows attackers to invoke distutils.file_util.write_file and circumvent its dangerous-operations blocklist entirely. The threat inversion here is the key risk: organizations running picklescan as a security gate in their model-ingestion pipelines are now themselves the attack surface — the scan act is what triggers the exploit, not the subsequent model load. With no authentication, no user interaction, and network-level access required only to deliver the malicious file, any CI/CD pipeline or MLOps platform that accepts .pkl files from external contributors is directly exposed. No public exploit exists yet and it is not in CISA KEV, but with 68 prior CVEs in this package and a well-understood vulnerability class, weaponization is within reach of any attacker with pickle expertise; upgrade to picklescan ≥0.0.33 immediately and treat all pre-patch scan results as untrustworthy.
Is CVE-2025-71321 actively exploited?
Proof-of-concept exploit code is publicly available for CVE-2025-71321, increasing the risk of exploitation.
How to fix CVE-2025-71321?
1. Patch: Upgrade picklescan to ≥0.0.33 immediately — this is the only complete fix. 2. Isolate scanners: Run picklescan in a minimal container with a read-only filesystem and no network egress so that a bypass cannot reach critical paths; treat the scan host as untrusted until patched. 3. Audit history: Review scan logs for any pickle files processed before patching from untrusted sources; assume any such file may have been a weaponized attempt. 4. Complement with format alternatives: Adopt safetensors for model sharing wherever possible — it avoids pickle serialization entirely and eliminates this class of risk. 5. Detect: Monitor for unexpected file write events from scanning processes (auditd, eBPF-based tools) and alert on any outbound connections originating from model-scan jobs. 6. Defense-in-depth: Do not rely solely on picklescan; layer with static analysis (fickling) and sandbox deserialization in ephemeral VMs for untrusted sources.
What systems are affected by CVE-2025-71321?
This vulnerability affects the following AI/ML architecture patterns: training pipelines, model serving, CI/CD model scanning gates, MLOps platforms, model registries.
What is the CVSS score for CVE-2025-71321?
CVE-2025-71321 has a CVSS v3.1 base score of 9.8 (CRITICAL). The EPSS exploitation probability is 0.62%.
What is the AI security impact?
Affected AI Architectures
MITRE ATLAS Techniques
AML.T0010.001 AI Software AML.T0011.000 Unsafe AI Artifacts AML.T0018.002 Embed Malware AML.T0049 Exploit Public-Facing Application Compliance Controls Affected
What are the technical details?
Original Advisory
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.
Exploitation Scenario
An adversary targeting an ML engineering team submits a crafted model file to a public model hub used by the target organization, or opens a pull request against a shared model repository. The target's CI/CD pipeline automatically invokes picklescan as a security gate before any model is loaded for testing. The malicious .pkl file contains a pickle opcode sequence that calls distutils.file_util.write_file — a vector not present in picklescan's blocklist prior to 0.0.33. During the scan phase, before any verdict is returned, the payload executes and overwrites an SSH authorized_keys file or a cron entry on the scanning host. Because CI/CD scan workers in ML environments typically have broad network access to the GPU cluster, object storage buckets, and internal package registries, the attacker pivots freely from the foothold gained through the 'security' step itself.
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:N/S:U/C:H/I:H/A:H References
Timeline
Related Vulnerabilities
CVE-2026-3490 10.0 picklescan: blocklist bypass enables full RCE
Same package: picklescan GHSA-vvpj-8cmc-gx39 10.0 picklescan: security flaw enables exploitation
Same package: picklescan GHSA-g38g-8gr9-h9xp 9.8 picklescan: Allowlist Bypass evades input filtering
Same package: picklescan CVE-2025-1945 9.8 picklescan: ZIP flag bypass enables RCE in PyTorch models
Same package: picklescan GHSA-7wx9-6375-f5wh 9.8 picklescan: Allowlist Bypass evades input filtering
Same package: picklescan