CVE-2025-71359: picklescan: scan bypass lets malicious models RCE
HIGH CISA: ATTENDpicklescan is the de facto safety gate that scans pickled ML model files for malicious code before they're loaded, and versions before 0.0.29 fail to flag payloads that abuse lib2to3.pgen2.grammar.Grammar.loads inside a pickle REDUCE opcode, letting a booby-trapped model file sail through as 'safe' and execute arbitrary code the moment pickle.load() runs. This isn't a bug in some obscure library — it's a bypass of the specific control that Hugging Face Hub and many internal MLOps pipelines rely on to vet third-party models, so a false 'clean' verdict here directly undermines model supply-chain trust, even though CVSS is 8.1 (network vector, no privileges, but requires a user or pipeline to actually load the file). EPSS sits at 0.43% (top 66th percentile) with no CISA KEV listing and no public exploit or Nuclei template yet, so this hasn't been weaponized at scale, but the technique is trivial to reproduce once known and the blast radius is anyone who trusts a picklescan 'PASS' as a security decision. Upgrade picklescan to >=0.0.29 immediately, and treat any model-scanning result from before that version as unverified; where feasible, require safetensors instead of pickle-based model formats and add a secondary check (e.g., fickling) rather than relying on a single scanner.
What is the risk?
High impact (full RCE, confidentiality and integrity both rated High) but currently low observed exploitation likelihood — EPSS 0.43%, not in CISA KEV, no public PoC or scanner signature found. The real risk driver is scope, not current activity: picklescan is a trust anchor used across the ML supply chain (model hubs, MLOps pipelines, CI ingestion of third-party models), so a bypass silently converts a security control into a false sense of safety. Exploitation requires user/pipeline interaction (someone or something must load the crafted model), which caps automated worm-style spread but fits neatly into typical 'download and evaluate a model' workflows. Organizations that gate model ingestion solely on picklescan output are at meaningfully higher risk than the raw CVSS/EPSS numbers suggest.
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?
1 step-
1) Upgrade picklescan to >=0.0.29 across all scanning services, CI jobs, and developer tooling immediately — treat this as a patch-now item given the RCE impact. 2) Re-scan or re-vet any model files that were previously cleared by a pre-0.0.29 picklescan, especially those sourced from public model hubs. 3) Where possible, migrate model storage/exchange to safetensors or other non-executable serialization formats instead of pickle. 4) Do not rely on a single scanner as the sole gate — layer in a second detection tool (e.g., fickling) and/or sandbox model loading (unprivileged container, no network egress, seccomp) as defense in depth. 5) Add detection for anomalous pickle opcodes referencing unexpected stdlib modules (like lib2to3.pgen2.grammar) in ingestion logging, since legitimate models have no reason to invoke that code path.
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-71359?
picklescan is the de facto safety gate that scans pickled ML model files for malicious code before they're loaded, and versions before 0.0.29 fail to flag payloads that abuse lib2to3.pgen2.grammar.Grammar.loads inside a pickle REDUCE opcode, letting a booby-trapped model file sail through as 'safe' and execute arbitrary code the moment pickle.load() runs. This isn't a bug in some obscure library — it's a bypass of the specific control that Hugging Face Hub and many internal MLOps pipelines rely on to vet third-party models, so a false 'clean' verdict here directly undermines model supply-chain trust, even though CVSS is 8.1 (network vector, no privileges, but requires a user or pipeline to actually load the file). EPSS sits at 0.43% (top 66th percentile) with no CISA KEV listing and no public exploit or Nuclei template yet, so this hasn't been weaponized at scale, but the technique is trivial to reproduce once known and the blast radius is anyone who trusts a picklescan 'PASS' as a security decision. Upgrade picklescan to >=0.0.29 immediately, and treat any model-scanning result from before that version as unverified; where feasible, require safetensors instead of pickle-based model formats and add a secondary check (e.g., fickling) rather than relying on a single scanner.
Is CVE-2025-71359 actively exploited?
No confirmed active exploitation of CVE-2025-71359 has been reported, but organizations should still patch proactively.
How to fix CVE-2025-71359?
1) Upgrade picklescan to >=0.0.29 across all scanning services, CI jobs, and developer tooling immediately — treat this as a patch-now item given the RCE impact. 2) Re-scan or re-vet any model files that were previously cleared by a pre-0.0.29 picklescan, especially those sourced from public model hubs. 3) Where possible, migrate model storage/exchange to safetensors or other non-executable serialization formats instead of pickle. 4) Do not rely on a single scanner as the sole gate — layer in a second detection tool (e.g., fickling) and/or sandbox model loading (unprivileged container, no network egress, seccomp) as defense in depth. 5) Add detection for anomalous pickle opcodes referencing unexpected stdlib modules (like lib2to3.pgen2.grammar) in ingestion logging, since legitimate models have no reason to invoke that code path.
What systems are affected by CVE-2025-71359?
This vulnerability affects the following AI/ML architecture patterns: model serving, training pipelines, MLOps model registries, CI/CD model ingestion pipelines.
What is the CVSS score for CVE-2025-71359?
CVE-2025-71359 has a CVSS v3.1 base score of 8.1 (HIGH). The EPSS exploitation probability is 0.43%.
What is the AI security impact?
Affected AI Architectures
MITRE ATLAS Techniques
AML.T0010.003 Model AML.T0011 User Execution AML.T0011.000 Unsafe AI Artifacts AML.T0018.002 Embed Malware Compliance Controls Affected
What are the technical details?
Original Advisory
picklescan before 0.0.29 fails to detect malicious pickle payloads that utilize lib2to3.pgen2.grammar.Grammar.loads in the reduce method, allowing remote code execution. Attackers can craft pickle files embedding dangerous code that evades picklescan detection and executes during pickle.load() deserialization.
Exploitation Scenario
An adversary crafts a malicious pickle-based model file (e.g., a .pkl or .bin checkpoint) embedding a REDUCE opcode that calls lib2to3.pgen2.grammar.Grammar.loads with attacker-controlled arguments designed to trigger code execution on deserialization. They upload the file to a public model repository or send it directly to a target, relying on the fact that picklescan's dangerous-function blocklist doesn't recognize this call path and reports the file as safe. A victim's MLOps pipeline or data scientist, trusting the picklescan 'clean' result, downloads the model and loads it with pickle.load() (directly or via a framework wrapper), at which point the embedded gadget executes with the privileges of the loading process — potentially a CI runner, training server, or inference host.
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-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