CVE-2025-71358: picklescan: scanner bypass enables RCE via pickle
HIGHpicklescan before 0.0.29 contains a detection bypass that allows attackers to embed arbitrary command execution payloads in pickle files using Python's `idlelib.autocomplete.AutoComplete.get_entity` function in reduce methods, completely evading the scanner. This is especially damaging because picklescan is explicitly deployed as a security gate before `pickle.load()` calls — organizations relying on it to vet externally sourced AI models from Hugging Face, S3, or research repositories now have a false assurance layer with CVSS 8.1 exposure. No public exploit or KEV listing exists yet, but the bypass path is now publicly disclosed in the GHSA advisory, sharply lowering the attacker skill bar. Upgrade picklescan to 0.0.29 immediately and layer model sandboxing or process isolation as defense-in-depth; also prefer SafeTensors over pickle format wherever possible.
What is the risk?
High risk in AI/ML environments. The CVSS 8.1 reflects a low-complexity network-vector attack requiring only user interaction — loading a pickle file. The real amplification comes from the trust model: teams that use picklescan assume scanned files are safe, converting a hardened pipeline into a false-confidence liability. Any organization downloading models from external sources and relying solely on picklescan faces direct RCE exposure. No active exploitation or KEV listing confirmed, but the public disclosure of the exact bypass technique (idlelib module path) makes weaponization straightforward for anyone familiar with Python pickle internals.
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?
7 steps-
Upgrade picklescan to version 0.0.29 or later immediately — this is the primary fix.
-
Audit all pickle files previously scanned by pre-0.0.29 versions and treat results as potentially compromised; re-scan with the patched version.
-
As an interim detection indicator, grep pickle files for references to 'idlelib' or 'AutoComplete' in serialized bytes.
-
Migrate model exchange to SafeTensors format (HuggingFace) wherever possible — it is not executable by design.
-
Use
torch.load(..., weights_only=True)for PyTorch models to restrict deserialization scope. -
Sandbox model loading in isolated environments (containers, VMs, restricted Linux namespaces) even post-scan as defense-in-depth.
-
Restrict model sources to internal registries with provenance controls and code signing rather than relying solely on scanning.
How is it classified?
Which compliance frameworks are affected?
This CVE is relevant to:
Frequently Asked Questions
What is CVE-2025-71358?
picklescan before 0.0.29 contains a detection bypass that allows attackers to embed arbitrary command execution payloads in pickle files using Python's `idlelib.autocomplete.AutoComplete.get_entity` function in reduce methods, completely evading the scanner. This is especially damaging because picklescan is explicitly deployed as a security gate before `pickle.load()` calls — organizations relying on it to vet externally sourced AI models from Hugging Face, S3, or research repositories now have a false assurance layer with CVSS 8.1 exposure. No public exploit or KEV listing exists yet, but the bypass path is now publicly disclosed in the GHSA advisory, sharply lowering the attacker skill bar. Upgrade picklescan to 0.0.29 immediately and layer model sandboxing or process isolation as defense-in-depth; also prefer SafeTensors over pickle format wherever possible.
Is CVE-2025-71358 actively exploited?
No confirmed active exploitation of CVE-2025-71358 has been reported, but organizations should still patch proactively.
How to fix CVE-2025-71358?
1. Upgrade picklescan to version 0.0.29 or later immediately — this is the primary fix. 2. Audit all pickle files previously scanned by pre-0.0.29 versions and treat results as potentially compromised; re-scan with the patched version. 3. As an interim detection indicator, grep pickle files for references to 'idlelib' or 'AutoComplete' in serialized bytes. 4. Migrate model exchange to SafeTensors format (HuggingFace) wherever possible — it is not executable by design. 5. Use `torch.load(..., weights_only=True)` for PyTorch models to restrict deserialization scope. 6. Sandbox model loading in isolated environments (containers, VMs, restricted Linux namespaces) even post-scan as defense-in-depth. 7. Restrict model sources to internal registries with provenance controls and code signing rather than relying solely on scanning.
What systems are affected by CVE-2025-71358?
This vulnerability affects the following AI/ML architecture patterns: training pipelines, model serving, AI/ML supply chain, model registries, MLOps pipelines.
What is the CVSS score for CVE-2025-71358?
CVE-2025-71358 has a CVSS v3.1 base score of 8.1 (HIGH).
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.T0074 Masquerading Compliance Controls Affected
What are the technical details?
Original Advisory
picklescan before 0.0.29 fails to detect malicious pickle files that exploit idlelib.autocomplete.AutoComplete.get_entity function in reduce methods. Attackers can embed undetected code in pickle files that executes arbitrary commands when loaded by victims using pickle.load().
Exploitation Scenario
An attacker targeting an ML team uploads a malicious pickle file to a shared model repository — a public HuggingFace model, a compromised S3 bucket, or a poisoned research artifact shared via email. The file embeds a reduce method invoking `idlelib.autocomplete.AutoComplete.get_entity` carrying an OS command payload (reverse shell, credential harvester, or persistent backdoor). The victim team runs pre-0.0.29 picklescan on the file as part of their model intake pipeline — it reports clean with no detections. The victim then calls `pickle.load()` on the file, triggering execution on the ML training server or model serving host. The attacker gains access to model weights, training data, cloud credentials stored in the environment, and potentially the broader corporate network from the ML infrastructure foothold.
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