CVE-2025-71349: picklescan Undetected Code Execution via trace.Trace.run
CVE-2025-71349 is a vulnerability in picklescan, a security tool designed to detect dangerous code embedded in Python pickle files. The flaw allows attackers to hide malicious code using Python's built-in trace.Trace.run function, which picklescan versions before 0.0.29 fail to recognize. When someone opens a specially crafted malicious pickle file with Python's pickle.load function, the hidden code runs automatically, giving the attacker control over the affected system. The vulnerability requires user interaction—someone must open the malicious pickle file—but once they do, the attacker gains full code execution capabilities.
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-30 / 2026-07-01
NVD description (verbatim)
picklescan before 0.0.29 fails to detect the built-in trace.Trace.run function when analyzing pickle files, allowing attackers to embed undetected malicious code. Remote attackers can craft malicious pickle files using trace.Trace.run in the reduce method to achieve arbitrary code execution when pickle.load processes the file.
3 reference(s) · View on NVD →
SEC.co analysis · AI-assisted, reviewed against source
Technical summary
picklescan is a static analysis tool that inspects pickle serialization files for potentially dangerous bytecode operations before deserialization. The vulnerability stems from incomplete coverage of dangerous callable objects during analysis. Specifically, picklescan fails to identify trace.Trace.run as a dangerous builtin function that can be exploited via the pickle reduce protocol. An attacker can craft a pickle file that uses trace.Trace.run in its reduce method, bypassing picklescan's detection logic. When pickle.load deserializes the file, the reduce method executes arbitrary code with the privileges of the Python process. This is a classic unsafe deserialization issue (CWE-502) compounded by incomplete detection in the security scanner itself. Versions 0.0.29 and later address this by adding trace.Trace.run to the list of dangerous functions.
Business impact
Organizations relying on picklescan to prevent deserialization attacks face a critical gap in their defensive posture. If picklescan is used as a gating mechanism for processing untrusted pickle files—such as in data pipelines, machine learning model loading, or inter-service communication—attackers can circumvent it entirely. The business impact depends on exposure: data scientists loading untrusted models, API services deserializing pickled objects, or distributed systems passing serialized data between components are all at elevated risk. A successful exploit leads to arbitrary code execution, enabling data theft, system compromise, lateral movement, and supply chain attacks.
Affected systems
The vulnerability affects picklescan versions before 0.0.29. Any organization using an older version to validate pickle files is vulnerable. The exposure extends to systems that rely on picklescan as a security control, including Python-based applications that process untrusted pickle data, machine learning platforms that load external models, and data infrastructure that deserializes pickled objects. The severity is heightened in environments where picklescan is trusted as a primary defense against deserialization attacks.
Exploitability
Exploitability is moderate to high. The vulnerability requires an attacker to craft a malicious pickle file and deliver it to a target who will deserialize it—whether via email, file sharing, a compromised model repository, or other means. There is no network-direct exploitation; user interaction is required to load the file. However, the bar for weaponization is low: an attacker with basic Python knowledge can construct a pickle file that embeds trace.Trace.run in the reduce method. Once the user or application calls pickle.load on the file, arbitrary code executes immediately. The attack is reliable and does not depend on race conditions or environment-specific quirks.
Remediation
Upgrade picklescan to version 0.0.29 or later immediately. This version includes fixes to detect trace.Trace.run and other previously-missed dangerous functions. After upgrading, re-scan any pickle files that were processed by older picklescan versions using the new release. For organizations without the ability to upgrade immediately, do not use picklescan as a sole security control for untrusted pickle files; implement additional mitigations such as sandboxing pickle deserialization, restricting file sources, and limiting pickle processing to trusted, verified data.
Patch guidance
Verify the current version of picklescan in your environment using pip show picklescan or equivalent package management tools. Update to version 0.0.29 or later using pip install --upgrade picklescan. Test the updated version in a non-production environment to ensure compatibility with your existing data pipelines and tooling. After patching, consider performing a retrospective audit of pickle files processed in recent months, especially those from external sources or untrusted origins, to detect any prior exploitation. Document the patch deployment for compliance and incident response records.
Detection guidance
Look for usage of picklescan in your codebase and infrastructure to identify which systems depend on it. Cross-reference installed versions against version 0.0.29. Monitor logs for calls to pickle.load or pickle.loads, particularly when processing external or user-supplied data. In threat hunting, look for unexpected process spawning or system calls originating from Python deserialization contexts—picklescan bypasses would manifest as code execution without obvious triggering events. Network-based detection is limited since the attack is file-based, but monitor for unusual file transfers targeting data scientists, ML engineers, or automated ML pipelines, especially if the files are pickle archives.
Why prioritize this
This vulnerability warrants immediate prioritization due to the combination of high CVSS score (8.1), complete authentication bypass, and the critical nature of deserialization security controls. The fact that picklescan is a purpose-built security tool heightens the impact of its failure—organizations believed they were protected when they were not. While exploitation requires user interaction, the attack is reliable, requires no special privileges, and delivers full code execution. In environments where picklescan is part of the security architecture for ML models, data processing, or untrusted input handling, this should be treated as a critical security gap.
Risk score, explained
The CVSS 3.1 score of 8.1 (HIGH) reflects: (1) network-accessible attack vector—malicious pickle files can be delivered remotely; (2) low attack complexity—no special conditions required; (3) no privilege escalation needed; (4) high impact on confidentiality and integrity (attacker gains code execution); and (5) no direct impact on availability, hence the absence of the A parameter. The score accounts for required user interaction (opening the file), which prevents it from reaching CRITICAL status. However, in practical scenarios where pickle deserialization is automated or routine, the user interaction requirement becomes a minor barrier.
Frequently asked questions
Does this vulnerability affect all Python applications, or only those using picklescan?
Only applications using picklescan are directly affected by the detection gap. However, any application that deserializes untrusted pickle files without additional security controls faces the underlying deserialization risk that picklescan was meant to mitigate. If picklescan is your primary defense and you upgrade, the vulnerability is patched. If you do not use picklescan, you should employ alternative protections such as sandboxing, using safer serialization formats (JSON, Protocol Buffers), or restricting pickle to trusted sources.
What is the risk if we have picklescan in place but have not yet upgraded to 0.0.29?
Your current security posture has a critical gap: picklescan is not detecting the trace.Trace.run attack vector. Any malicious pickle file crafted with this specific technique will pass your picklescan inspection and execute arbitrary code when deserialized. We strongly recommend upgrading to 0.0.29 as soon as possible, and consider implementing an interim control such as restricting pickle file sources or adding sandboxing while you plan the upgrade.
Can picklescan be used in production environments to gate deserialization, or is it only suitable for development?
picklescan can be deployed in production pipelines, but it is most effective as one layer in a defense-in-depth strategy. It is suitable for rejecting pickle files with obvious dangerous operations before they enter critical systems. However, picklescan should not be your sole control for untrusted data, especially given this vulnerability history. Combine it with sandboxing, input validation, and architectural decisions to minimize reliance on pickle deserialization for external data.
How do I know if our organization is affected by this vulnerability?
Search your codebase and dependencies for imports of picklescan and check the version. Run pip show picklescan or check your requirements.txt and lock files. If picklescan is present and the version is below 0.0.29, you are affected. Additionally, audit which systems use picklescan and what data sources feed into them—if untrusted or external pickle files reach picklescan-protected deserialization points, your exposure is active.
This analysis is based on publicly available information as of the publication date. Exploit details and attack scenarios described are illustrative and based on technical assessment of the vulnerability; no working exploit has been validated by SEC.co. Organizations should verify patch availability and compatibility with their specific picklescan deployment and Python versions before upgrading. This information is provided for security awareness and incident response planning and should not be considered legal or compliance advice. Always test patches in non-production environments before broad deployment. Source: NVD (public-domain), retrieved 2026-08-09. 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-71340HIGHPicklescan Evasion via idlelib.pyshell.ModifiedInterpreter
- CVE-2025-71341HIGHPicklescan Bypass Enables Remote Code Execution via profile.Profile.runctx
- CVE-2025-71342HIGHPicklescan Evasion Enables Remote Code Execution in PyTorch Models
- CVE-2025-71343HIGHpicklescan Detection Bypass Allows Remote Code Execution