PickleScan
CVE-2025-71322
HIGH
Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessCraft pickle with pty.spawn GLOBAL opcode
-
DeliveryPublish malicious model to hub or send to victim
-
ExploitPickleScan flags as 'suspicious' not 'dangerous'
-
ExecutionVictim or pipeline proceeds to load model
-
Persisttorch.load triggers pty.spawn(/bin/sh)
-
ImpactAttacker obtains shell as loading user
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A06:2025 - Insecure Design
ASVS 5.0
V15 - Secure Coding and Architecture Protection mechanism completeness
|
| Exploitation Conditions | Exploitation requires that (1) a victim user, CI job, or platform service runs PickleScan on an attacker-supplied pickle/PyTorch/ZIP file and acts on its 'safe' verdict, and (2) the file is subsequently deserialized (e.g., via pickle.load or torch.load) so that the embedded pty.spawn opcode actually fires - code execution does not occur at scan time, only at load time. The CVSS 4.0 UI:P indicates passive user interaction (downloading and loading a model is sufficient; no active click-through is needed). Limiting factors: the victim system must have a POSIX pty module available (the attack does not work on stock Windows Python because pty is Unix-only), and the bypass only matters where PickleScan is the gatekeeper - environments that already refuse pickle deserialization or use safetensors are unaffected. |
| Impact | The CVSS 4.0 vector (AV:N/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N) scores 8.7 High: network reach, no privileges, but passive user interaction is required - a victim must download and load the malicious pickle/model. This matches the realistic threat model for ML supply-chain attacks, where users routinely download community models from public hubs and trust scanners like PickleScan to flag them. A working proof-of-concept is publicly available from the HeroCTF 2025 writeup and solve script, increasing weaponization likelihood; however, the CVE is not listed in CISA KEV and EPSS data was not provided, so widespread in-the-wild exploitation is not confirmed. The combination of public POC, low complexity, and a trust-relationship bypass (the scanner gives a false sense of safety) makes this a meaningful priority for anyone running PickleScan in CI or model-ingest workflows, even though the raw CVSS score alone might understate the supply-chain blast radius. |
| Exploit ScenarioDerived | An attacker uploads a backdoored PyTorch model to a public model hub; the embedded pickle uses the GLOBAL opcode to reference pty.spawn(['/bin/sh']). When a data scientist or an automated MLOps pipeline runs picklescan over the file (or a hub's ingest scanner does so), the scanner flags pty.spawn only as 'suspicious' and lets the artifact through; the subsequent torch.load call then spawns a shell under the loading user's identity. The HeroCTF 2025 solve script provides a working POC pickle generator. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Jun 17, 2026
Security check bypass in PickleScan versions before 0.0.33 allows attackers to smuggle arbitrary code execution payloads past the scanner by invoking the pty.spawn function, which was omitted from the unsafe globals deny-list. Publicly available exploit code exists (released as part of the HeroCTF 2025 'Irreductible 2' challenge writeup), and the flaw is particularly impactful for platforms like Hugging Face and other ML pipelines that rely on PickleScan to vet PyTorch model files. No public exploit identified at time of analysis in CISA KEV.
RemediationAI
Vendor-released patch: upgrade picklescan to 0.0.33 or later (pip install --upgrade picklescan), which adds pty.spawn to the dangerous-globals list per upstream PR https://github.com/mmaitre314/picklescan/pull/53 and commit 70c1c6c31beb6baaf52c8db1b6c3c0e84a6f9dab. Operators of model-hosting platforms should rebuild and redeploy any container images or services that pin an older picklescan version, and re-scan recently uploaded models with the fixed scanner since previously cleared artifacts may still contain pty.spawn payloads. As compensating controls until the upgrade is rolled out, refuse to deserialize pickle-based model formats and require safer alternatives such as safetensors, or load untrusted models inside a sandboxed/unprivileged container with no shell available on PATH (which neutralises pty.spawn's /bin/sh invocation) - note that the sandbox approach still permits other unsafe globals not covered by this CVE, so it is not a substitute for the patch.
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 static analysis tool maintained by mmaitre314 that inspects Python pickle streams (commonly embedded inside PyTorch .pt/.bin files and ZIP archives) for references to dangerous globals such as os.system, subprocess.Popen, or eval that would execute code when the pickle is deserialized. The tool relies on an allow/deny list of module-function pairs; CWE-693 (Protection Mechanism Failure) applies because the denylist was incomplete - the standard-library pty module's spawn() function, which internally invokes os.execlp on its first argument, was classified merely as 'suspicious' rather than 'dangerous'. An attacker can therefore hand-craft a pickle stream using the GLOBAL opcode to reference pty.spawn with arguments like ['/bin/sh'], and when the pickle is unpickled (e.g., via torch.load) the spawn call yields an interactive shell under the loading process. The CPE cpe:2.3:a:picklescan:picklescan:*:*:* indicates all versions prior to the fix are affected.
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:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
Malicious pickle is delivered over the network and requires the victim to load the file (UI:R); no prior auth or privileges are needed, and pickle deserialization yields full code execution (C/I/A:H).
Primary rating from Vendor (VulnCheck).
CVSS VectorVendor: VulnCheck
DescriptionCVE.org
PickleScan before 0.0.33 fails to include the pty.spawn function in its unsafe globals list, allowing attackers to bypass security checks. Malicious actors can craft pickle payloads using pty.spawn to achieve arbitrary code execution when files are processed by PickleScan.
Executive ViewAI
PickleScan, a widely-used security scanner for machine learning model files, contains a code-execution bypass in versions before 0.0.33 that allows attackers to inject malicious payloads past security checks. Publicly available exploit code exists, and organizations on Hugging Face and similar platforms that depend on PickleScan to vet untrusted models now face immediate risk of supply-chain compromise.
No vendor-released patch identified at time of analysis. Interim mitigations: (1) Execute all model inference in isolated sandboxed environments with minimal system privileges; (2) Require cryptographic verification that models are signed by trusted authors only; (3) Restrict model ingestion to internal curated repositories until patch available; (4) Deploy runtime monitoring for anomalous spawning of system processes or network connections during model inference; (5) Conduct manual security code review of any new or updated models from external sources prior to deployment.
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
Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.
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