CVE-2025-71358: picklescan Detection Bypass via Malicious Pickle Files (CVSS 8.1)
picklescan, a tool designed to scan pickle files for malicious content, contains a detection bypass flaw affecting versions before 0.0.29. The vulnerability allows attackers to craft malicious pickle files that evade picklescan's security checks by exploiting a specific function in Python's idlelib library. When victims use Python's standard pickle.load() to open these seemingly-safe files, arbitrary code executes on their systems. This is particularly dangerous because picklescan is often deployed as a safety gate—organizations rely on it to vet untrusted pickle data, making this bypass a fundamental breach of that trust.
Source data · NVD / CISA · public domain
- CVSS
- 3.1 · 8.1 HIGH · CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N
- Weaknesses (CWE)
- CWE-502
- Affected products
- 0 configuration(s)
- Published / Modified
- 2026-06-22 / 2026-06-23
NVD description (verbatim)
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().
3 reference(s) · View on NVD →
SEC.co analysis · AI-assisted, reviewed against source
Technical summary
The vulnerability exists in picklescan's inspection logic, which fails to identify malicious reduce operations that invoke idlelib.autocomplete.AutoComplete.get_entity. The pickle protocol's reduce opcode allows arbitrary Python callables to be invoked during deserialization. picklescan's detection mechanism does not properly flag this specific gadget chain, permitting an attacker to embed code that executes with the privileges of the Python process unpickling the data. The flaw is rooted in incomplete gadget detection—picklescan maintains a list of dangerous functions, but the AutoComplete.get_entity method was either not included or not properly matched during inspection. When pickle.load() deserializes the crafted payload, the reduce operation reconstructs an object by calling the undetected gadget, leading to code execution.
Business impact
Organizations using picklescan to validate pickle files from untrusted sources face a direct security regression. Data pipelines, machine learning model loading systems, and any application accepting pickled objects from external parties operate under a false sense of security. A successful exploit grants attackers code execution in the context of the Python application, enabling data theft, lateral movement, malware deployment, or service disruption. The severity is amplified because picklescan is often part of a defense-in-depth strategy; its bypass eliminates a critical validation layer. Remediation requires both tool updates and potential re-evaluation of past pickle file ingestion.
Affected systems
Any system running picklescan version 0.0.28 or earlier is vulnerable. The impact extends to all applications or services that depend on picklescan for security validation of pickle files, including data science platforms, MLOps infrastructure, and data serialization services. Python environments that rely on picklescan as a gating mechanism before calling pickle.load() are at direct risk. Systems not yet upgraded cannot reliably distinguish safe from malicious pickle payloads.
Exploitability
This vulnerability is readily exploitable. Crafting a malicious pickle file requires only standard Python pickle tools and knowledge of the gadget chain; no special privileges or local access are needed. The attack is entirely remote—an attacker can deliver a crafted pickle file via email, file upload, API response, or any data channel. User interaction is minimal: the victim simply needs to load the pickle file using pickle.load() or a wrapper that calls it. Given that picklescan is marketed as a security tool, defenders may have lower suspicion of validated pickle files, increasing the likelihood of successful exploitation.
Remediation
Upgrade picklescan to version 0.0.29 or later immediately. This version includes detection updates that properly identify the malicious reduce chain. After patching, consider re-scanning any pickle files ingested while running vulnerable versions, as they may harbor undetected payloads. Organizations should also review their pickle handling practices: whenever possible, use safer serialization formats (JSON, Protocol Buffers, MessagePack) instead of pickle for untrusted data. If pickle is unavoidable, combine picklescan with other security controls such as sandboxing, strict file permissions, and runtime monitoring.
Patch guidance
The fix is available in picklescan version 0.0.29. Update via your package manager (pip install --upgrade picklescan>=0.0.29). Verify the installed version with picklescan --version or by checking pip show picklescan. Test the patched version in a non-production environment first to ensure compatibility with your pipeline. If you maintain a locked dependency tree, prioritize this update in your next release cycle. For air-gapped or offline environments, download the patched wheel from the official Python Package Index and deploy via your internal package repository.
Detection guidance
Check for picklescan usage across your codebase and infrastructure: grep -r "picklescan" in version control, container images, and requirements files. Identify pickle file sources and ingestion points—focus on those accepting external data. Log pickle.load() calls and monitor for successful executions following picklescan validation. If you have access to historical pickle files scanned by vulnerable versions, re-run them against picklescan 0.0.29+ to detect bypasses. Monitor for unusual process spawning or system calls originating from Python interpreters processing pickled data, as this may indicate exploitation. Check for any error logs or warnings in applications using picklescan; a sudden jump in detection failures post-update may indicate an attempted exploit.
Why prioritize this
This vulnerability merits immediate attention because it directly undermines a security control. Organizations have deployed picklescan precisely to prevent pickle deserialization attacks. A bypass of that control re-exposes a well-known attack surface (CWE-502: Deserialization of Untrusted Data) that many teams considered mitigated. The CVSS score of 8.1 reflects the high impact (code execution, information disclosure) combined with low attack complexity and no authentication requirements. The attack surface is broad—any application accepting pickle files from users, partners, or untrusted infrastructure is vulnerable.
Risk score, explained
The CVSS 3.1 score of 8.1 (HIGH) is justified by the following factors: Network accessibility (AV:N) and low attack complexity (AC:L) mean remote, unauthenticated exploitation is straightforward. No special privileges are required (PR:N), lowering the bar further. The impact is significant—confidentiality (C:H) and integrity (I:H) are fully compromised through code execution, though availability is not directly impacted (A:N). The requirement for user interaction (UI:R) to load the pickle file prevents a critical rating, but remains a practical exploit precondition rather than a meaningful defense. The single-user scope (S:U) limits cross-user privilege escalation but does not reduce the severity within a target's context.
Frequently asked questions
Why is picklescan vulnerable if its entire purpose is to detect malicious pickles?
picklescan maintains a curated list of known dangerous gadgets—functions and classes that can be abused during deserialization. The idlelib.autocomplete.AutoComplete.get_entity method was not included in this list or was matched incompletely. As pickle exploitation techniques evolve, gadgets can be discovered that bypass existing allowlists. This is why picklescan is a useful layer but should not be the only control protecting against pickle deserialization attacks.
Do I need to re-process pickle files I scanned with the old version?
Yes, any pickle files validated by picklescan before version 0.0.29 should be re-scanned with the patched version. While this is operationally expensive, files that were approved by the vulnerable version may contain undetected payloads. Prioritize files from external sources or untrusted senders. For historical data, implement a quarantine period if possible and schedule re-validation as part of your patch cycle.
What should I use instead of pickle if I want to deserialize untrusted data?
Pickle is inherently unsafe for untrusted data due to its object graph design. Prefer JSON, Protocol Buffers, MessagePack, or YAML (with safe loaders) for data exchange. These formats are designed for data representation, not arbitrary code execution. If you must use pickle internally, confine it to trusted, controlled environments (e.g., signed internal messages) and avoid loading pickle data from end-users or external APIs.
Is my application automatically vulnerable if I have picklescan installed?
No. You are vulnerable only if you rely on picklescan to validate pickle files before loading them with pickle.load(). If you use pickle only for internal, trusted data (e.g., serialized cache between your own services), or if you do not use picklescan at all, your risk profile differs. However, if picklescan is part of your security posture, this bypass is a direct threat to that posture.
This analysis is provided for informational purposes and reflects the state of CVE-2025-71358 as of the published date. Security assessments should be tailored to your specific infrastructure, threat model, and data flows. Consult the official picklescan advisory and vendor documentation for definitive patch details and compatibility notes. This document does not constitute legal advice, warranty, or guarantee of protection. Always test patches in non-production environments before deployment. Source: NVD (public-domain), retrieved 2026-07-28. Analysis generated by SEC.co (claude-haiku-4-5).
Weaknesses (CWE)
Related vulnerabilities
- CVE-2025-11993HIGHWooCommerce Infinite Scroll Plugin PHP Object Injection – HIGH Severity
- CVE-2025-27511HIGHGeoServer DB2 JNDI Injection Remote Code Execution
- CVE-2025-69130HIGHPHP Object Injection in Entrepreneur WordPress Booking Theme ≤3.1.3
- CVE-2025-71339HIGHPicklescan Gadget Bypass Allows Arbitrary Code Execution
- CVE-2025-71341HIGHPicklescan Bypass Enables Remote Code Execution via profile.Profile.runctx
- CVE-2025-71344HIGHpicklescan RCE via Undetected ensurepip._run_pip
- CVE-2025-71348HIGHpicklescan Detection Evasion in Torch Config Loading
- CVE-2025-71357HIGHPicklescan Evasion via idlelib.pyshell.ModifiedInterpreter