CVE-2025-71374: picklescan Gadget Chain Bypass Allows Arbitrary Code Execution
picklescan is a security tool designed to scan Python pickle files for dangerous code before they are deserialized. Prior to version 0.0.29, picklescan had a detection gap: it failed to identify when the built-in Python profile.Profile.run function was used within pickle reduce methods. An attacker can exploit this gap by crafting a malicious pickle file that uses this undetected function to execute arbitrary code when the file is deserialized, even after passing through picklescan's security checks.
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 python profile.Profile.run function when used in pickle reduce methods, allowing attackers to execute arbitrary code. Remote attackers can craft malicious pickle files that bypass picklescan detection and achieve code execution upon deserialization.
3 reference(s) · View on NVD →
SEC.co analysis · AI-assisted, reviewed against source
Technical summary
CVE-2025-71374 stems from incomplete opcode validation in picklescan's pickle scanning logic. The vulnerability exploits the REDUCE opcode in combination with the profile.Profile.run callable. When pickle deserializes a reduce operation, it instantiates the specified callable with provided arguments. picklescan's detection signatures did not account for profile.Profile.run as a dangerous gadget chain, allowing it to slip through validation. An attacker can weaponize this by embedding the function reference in a crafted pickle payload that executes arbitrary Python code during deserialization—a classic unsafe deserialization vulnerability (CWE-502). The attack requires network delivery of the malicious pickle file and user interaction to trigger deserialization.
Business impact
Organizations that rely on picklescan as a gating mechanism for untrusted pickle data are exposed to remote code execution (RCE). If picklescan is deployed as a safety layer in workflows that process externally sourced pickled objects—such as machine learning model serialization, inter-service communication, or data pipelines—a bypass means malicious payloads can reach the deserialization step undetected. The impact is code execution with the privileges of the Python process, potentially leading to data theft, lateral movement, or service compromise. The effective security control has failed, leaving downstream systems vulnerable.
Affected systems
picklescan versions prior to 0.0.29 are affected. The vulnerability manifests when those versions scan pickle files that contain the profile.Profile.run gadget. Any deployment using an older picklescan release as a defensive layer faces the exposure. Downstream Python applications that deserialize pickles presumed safe by a vulnerable picklescan release are at risk.
Exploitability
Exploitability is moderate to high. The attack requires an attacker to craft a pickle file (a standardized binary format) and deliver it to a target system where it will be deserialized. User interaction is required—someone must trigger the deserialization process. However, no special privileges are needed to craft the payload, the network vector is open, and the exploitation technique (gadget chain construction) is feasible for a skilled attacker. Once delivered, code execution is reliable if picklescan fails to block it.
Remediation
Update picklescan to version 0.0.29 or later. This release includes enhanced detection logic that recognizes profile.Profile.run in reduce operations and flags it as dangerous. After updating, re-scan any historically processed pickle files or validate that your pickle ingestion pipeline is not relying on older picklescan versions. If picklescan is used as part of a defense-in-depth strategy, ensure it remains current alongside other mitigations such as avoiding pickle deserialization of untrusted data and using safer serialization formats where feasible.
Patch guidance
1. Identify all systems and applications using picklescan. 2. Check the installed version (picklescan --version or via package managers). 3. Upgrade to 0.0.29 or later using your package manager (e.g., pip install --upgrade picklescan). 4. Verify the upgrade by confirming the version. 5. Test pickle scanning on sample payloads to ensure the patched version blocks profile.Profile.run gadgets. 6. Review any CI/CD pipelines or automated scanning jobs that invoke picklescan to ensure they are using the updated binary. 7. If pickle files are cached or stored, consider re-scanning them with the patched version.
Detection guidance
Monitor for pickle deserialization errors or unexpected code execution in Python processes handling pickled data. If you are running an older picklescan, manually test it against pickle samples containing profile.Profile.run (e.g., using pickle.dumps with a reduce operation) to confirm the gap. In production, intrusion detection signatures for pickle gadget chain execution (such as unusual process spawning from Python interpreters) may catch exploitation attempts. Log all picklescan invocations and their results, flagging any files that are processed and later found to be malicious.
Why prioritize this
This is a HIGH-severity vulnerability affecting a security-critical tool. picklescan's purpose is to prevent exactly this class of attack—unsafe deserialization of untrusted pickle data. A bypass in a security scanning tool is particularly dangerous because it erodes trust in a control that defenders rely on. The CVSS score of 8.1 reflects high confidentiality and integrity impact via a low-complexity network attack with user interaction. Organizations using picklescan to gate untrusted pickle processing should prioritize the upgrade immediately. For those not using picklescan, this highlights the inherent risks of pickle deserialization and reinforces the need to avoid it or use alternative serialization formats.
Risk score, explained
The CVSS 3.1 score of 8.1 (HIGH) is assigned as follows: Attack Vector (Network) indicates the payload is deliverable over the network. Attack Complexity (Low) means the exploit requires standard pickle crafting techniques. Privileges Required (None) reflects that no special access is needed. User Interaction (Required) accounts for the need for someone to deserialize the pickle. Scope (Unchanged) indicates the impact is limited to the target application. Confidentiality (High) and Integrity (High) reflect code execution capability—an attacker can read sensitive data and modify system state. Availability (None) is scored as Not Applicable because denial of service is not the primary concern. The score reflects a serious breach of a security tool's intended function, justifying the HIGH severity rating.
Frequently asked questions
Does this vulnerability affect applications that do not use picklescan?
No directly, but it underscores a broader risk: picklescan is a detection tool, not a prevention tool. Applications that deserialize untrusted pickle data are inherently at risk of unsafe deserialization attacks, whether or not picklescan is in use. The best defense is to avoid pickle deserialization of untrusted sources altogether or use safer formats like JSON or Protocol Buffers.
Can I safely continue using picklescan version 0.0.28 if I only process internally sourced pickle files?
If your pickle files originate exclusively from trusted, internal sources and are not exposed to external input or modification, the risk is lower. However, best practice is still to upgrade. picklescan has fixed a detection gap; newer versions are strictly more secure. There is no downside to updating.
What is the profile.Profile.run function and why does it enable code execution?
profile.Profile is a Python standard library module for performance profiling. The run method executes a string of Python code within a profiling context. When embedded in a pickle reduce operation, it becomes a gadget that allows arbitrary code execution during deserialization. The vulnerability exists because picklescan did not recognize this as a dangerous pattern and flag it during scanning.
If picklescan detects a malicious pickle with version 0.0.29, does it block deserialization?
picklescan is a scanner and alerting tool—it identifies suspicious pickles and reports them. It is up to your application to enforce the scanning result (e.g., refuse to deserialize flagged files). The patched version will now correctly identify profile.Profile.run gadgets as suspicious. Whether the pickle is actually deserialized depends on your application logic and policy.
This analysis is provided for informational purposes to help security teams understand and respond to CVE-2025-71374. It is not a substitute for vendor advisories or your organization's security policies. Always verify patch availability and compatibility in your environment before deploying updates. No exploit code or weaponizable proof-of-concept is provided. For the most current and authoritative information, consult the official picklescan project repository and security advisories. 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