CVE-2025-71322: PickleScan: pty.spawn bypass enables RCE in model scans
HIGH PoC AVAILABLEPickleScan, the de-facto tool for detecting malicious pickle payloads in ML model files, fails to flag Python's `pty.spawn` function as dangerous, allowing adversaries to craft model checkpoints that pass security scanning while still executing arbitrary code when loaded. This is an especially corrosive vulnerability class: it targets the security control itself, meaning every team relying on PickleScan to gate model loading is operating with a false sense of safety. Attack complexity is low and the impact is full C/I/A compromise (CVSS 8.8), though user interaction is required and no public exploit is currently reported. Upgrade to PickleScan ≥ 0.0.33 immediately and re-scan any model files previously cleared by older versions before loading them.
What is the risk?
High risk for AI/ML teams that use PickleScan as a security gate in model validation workflows. The vulnerability defeats the primary defense against pickle-based code execution — the exact threat PickleScan was built to prevent — with low attack complexity once the bypass technique is known. The 68 prior CVEs in the same package and a package risk score of 53/100 signal a historically security-troubled codebase. Direct downstream dependents are limited to 3, reducing ecosystem blast radius, but the qualitative impact per affected organization is severe: any pipeline trusting a PickleScan clean result for a maliciously crafted file is fully exposed to RCE on the host running the scan.
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?
5 steps-
Upgrade PickleScan to version 0.0.33 or later immediately — this release adds
pty.spawnto the unsafe globals list. -
Re-scan all model files previously approved by PickleScan < 0.0.33 before loading them in any environment.
-
As defense-in-depth, run model deserialization inside isolated sandboxes (gVisor, Firecracker, or ephemeral containers) regardless of scan results.
-
Evaluate
fickling(Trail of Bits) as a secondary validator — it performs AST-level analysis independent of a fixed unsafe globals list. -
For detection: search model files for
ptystring references as a lightweight pre-check; review PickleScan audit logs for any files scanned with versions below 0.0.33 that were subsequently loaded.
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-71322?
PickleScan, the de-facto tool for detecting malicious pickle payloads in ML model files, fails to flag Python's `pty.spawn` function as dangerous, allowing adversaries to craft model checkpoints that pass security scanning while still executing arbitrary code when loaded. This is an especially corrosive vulnerability class: it targets the security control itself, meaning every team relying on PickleScan to gate model loading is operating with a false sense of safety. Attack complexity is low and the impact is full C/I/A compromise (CVSS 8.8), though user interaction is required and no public exploit is currently reported. Upgrade to PickleScan ≥ 0.0.33 immediately and re-scan any model files previously cleared by older versions before loading them.
Is CVE-2025-71322 actively exploited?
Proof-of-concept exploit code is publicly available for CVE-2025-71322, increasing the risk of exploitation.
How to fix CVE-2025-71322?
1. Upgrade PickleScan to version 0.0.33 or later immediately — this release adds `pty.spawn` to the unsafe globals list. 2. Re-scan all model files previously approved by PickleScan < 0.0.33 before loading them in any environment. 3. As defense-in-depth, run model deserialization inside isolated sandboxes (gVisor, Firecracker, or ephemeral containers) regardless of scan results. 4. Evaluate `fickling` (Trail of Bits) as a secondary validator — it performs AST-level analysis independent of a fixed unsafe globals list. 5. For detection: search model files for `pty` string references as a lightweight pre-check; review PickleScan audit logs for any files scanned with versions below 0.0.33 that were subsequently loaded.
What systems are affected by CVE-2025-71322?
This vulnerability affects the following AI/ML architecture patterns: training pipelines, model serving, MLOps pipelines, model registries, CI/CD security gates.
What is the CVSS score for CVE-2025-71322?
CVE-2025-71322 has a CVSS v3.1 base score of 8.8 (HIGH). The EPSS exploitation probability is 0.38%.
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.T0072 Reverse Shell AML.T0107 Exploitation for Defense Evasion Compliance Controls Affected
What are the technical details?
Original Advisory
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.
Exploitation Scenario
An adversary targeting an ML team's infrastructure crafts a malicious PyTorch `.pt` checkpoint that calls `pty.spawn` to open a reverse shell. The file is submitted to a shared model repository — a pull request adding a fine-tuned checkpoint, a model hub upload, or a poisoned artifact in a CI/CD store. An MLOps engineer runs PickleScan (< 0.0.33) as part of their standard validation workflow; the scan returns clean because `pty.spawn` is not in the unsafe globals list. The engineer loads the checkpoint in a training or inference environment, triggering immediate code execution. The attacker gains shell access to the ML host, with access to model weights, training data, API tokens, and a foothold for lateral movement into cloud infrastructure.
Weaknesses (CWE)
CWE-693 — Protection Mechanism Failure: The product does not use or incorrectly uses a protection mechanism that provides sufficient defense against directed attacks against the product.
Source: MITRE CWE corpus.
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/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