CVE-2025-71353: Picklescan Detection Bypass Enables Arbitrary Code Execution
Picklescan, a Python security tool designed to scan pickle files for malicious content, contains a detection bypass vulnerability in versions before 0.0.28. Attackers can craft specially designed pickle files that exploit a specific function in PyTorch's torch._dynamo.guards.GuardBuilder to hide malicious code. When these files are loaded by applications relying on picklescan for protection, the malicious payload executes despite the tool's screening, potentially giving attackers full command execution on affected systems.
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-07-04 / 2026-07-06
NVD description (verbatim)
picklescan before 0.0.28 fails to detect malicious pickle files that exploit torch._dynamo.guards.GuardBuilder.get function in reduce methods. Attackers can craft pickle files with embedded code that evades picklescan detection and executes arbitrary commands when loaded.
3 reference(s) · View on NVD →
SEC.co analysis · AI-assisted, reviewed against source
Technical summary
CVE-2025-71353 is an unsafe deserialization detection evasion in picklescan that allows attackers to bypass security controls through a reduce method exploit leveraging torch._dynamo.guards.GuardBuilder.get. Pickle's reduce protocol enables custom object reconstruction; attackers craft payloads that exploit this mechanism in a way picklescan's static analysis fails to identify. The vulnerability stems from incomplete pattern matching or insufficient coverage of guard-builder-based gadget chains. This creates a dangerous false sense of security: applications using picklescan to validate untrusted pickle data may inadvertently load and execute attacker-controlled code.
Business impact
Organizations using picklescan to validate pickle files before deserialization face a critical trust boundary failure. If an application ingests pickle data from untrusted sources—including uploaded model files, cached data, or remote repositories—an attacker can bypass picklescan validation and achieve arbitrary code execution. This undermines the security assumption that picklescan provides, potentially affecting machine learning pipelines, data processing workflows, and any system that deserializes pickle objects. The reputational and operational impact extends beyond the immediate host to any downstream systems the compromised process interacts with.
Affected systems
Picklescan versions prior to 0.0.28 are vulnerable. Any application or pipeline that uses picklescan to validate pickle files before loading them is at risk if that validation is treated as a security boundary. This includes machine learning frameworks integrating picklescan, data science platforms, and custom applications that deserialize pickle data. PyTorch users are particularly relevant given the exploit chain involves torch._dynamo.guards, though the vulnerability is in picklescan's detection logic rather than PyTorch itself.
Exploitability
The vulnerability requires user interaction (loading a pickle file) but is otherwise straightforward to exploit. An attacker crafts a malicious pickle file using the torch._dynamo.guards.GuardBuilder.get gadget and delivers it to a target—via upload, model sharing, repository hosting, or supply chain compromise. The file passes picklescan inspection because the tool does not recognize this particular evasion technique. Exploitation is reliable once the victim loads the file; no additional user actions or system misconfigurations are required. The network attack vector and lack of authentication requirements elevate severity.
Remediation
Immediately upgrade picklescan to version 0.0.28 or later, which patches the detection gap. Review any pickle files that were validated using vulnerable versions—they may contain undetected malicious payloads. In parallel, implement defense-in-depth: run picklescan-validated pickle loading in isolated environments or containers with minimal privileges, restrict network access, use code signing or integrity verification for trusted pickle sources, and monitor for unexpected process spawning or network activity during deserialization. Do not rely solely on picklescan for security; treat it as one layer in a broader validation strategy.
Patch guidance
Upgrade picklescan to version 0.0.28 or later. This patch enhances detection logic to recognize and block reduce methods exploiting torch._dynamo.guards.GuardBuilder.get. After patching, re-scan any pickle files processed during the vulnerability window to ensure they do not contain malicious payloads. Coordinate the patch rollout with dependent applications and workflows to avoid disruption; consider lab testing with real pickle files from your pipeline before production deployment. Verify the upgrade in your environment by confirming picklescan version and testing against known-malicious samples if available.
Detection guidance
Monitor for pickle deserialization operations, particularly from untrusted or user-supplied sources. Use file integrity monitoring or hashing to detect unauthorized modifications to pickle caches or model repositories. During incident investigation, examine pickle files for reduce method calls involving torch._dynamo.guards.GuardBuilder.get or similar guard-based constructs using pickle analysis tools (e.g., pickletools.dis). Check process logs and system calls for unexpected child process spawning, network connections, or file writes immediately after pickle loading. If picklescan was used as a validation gate, flag all pickle files it processed prior to patching as requiring re-evaluation.
Why prioritize this
This vulnerability merits immediate attention due to its HIGH CVSS score (8.1) driven by high confidentiality and integrity impact and easy exploitability. The core threat—a security tool bypass that enables arbitrary code execution—is particularly dangerous because it inverts trust assumptions: systems relying on picklescan for protection become more vulnerable if they lower their guard after validation. The network attack surface and lack of user prerequisites (beyond standard interaction of loading a file) make it practical to exploit at scale. Machine learning and data-heavy organizations should prioritize this patch urgently.
Risk score, explained
CVSS 3.1 score of 8.1 (HIGH) reflects: (1) network-accessible attack vector—pickle files can be delivered remotely; (2) low complexity, no privileges required; (3) user interaction limited to loading a file (a normal operation); (4) high impact on confidentiality and integrity (arbitrary code execution); (5) no impact on availability. The score appropriately captures the severity of arbitrary code execution enabled by a detection bypass in a widely-used validation tool.
Frequently asked questions
Does this affect PyTorch or other torch libraries directly?
No. The vulnerability is in picklescan's detection logic, not PyTorch itself. However, the exploit technique leverages a PyTorch function (torch._dynamo.guards.GuardBuilder.get) as a gadget. PyTorch users are a relevant audience for this advisory because their pickle files are a likely attack surface, but the root cause is picklescan's incomplete scanning.
If we don't use picklescan, are we affected?
This CVE does not directly affect you, but it underscores the broader risk of unsafe pickle deserialization. If your organization loads pickle files from untrusted sources without any validation layer, you face the same underlying threat (code execution via malicious pickle). Consider deploying picklescan (after patching) or alternative validation strategies, and always deserialize in isolated environments.
What if we've already processed pickle files with an older picklescan version?
You should assume any pickle files validated by picklescan < 0.0.28 may contain undetected malicious payloads. Conduct a retrospective review: re-scan them with the patched version, audit their origins and authenticity, and check systems that loaded them for indicators of compromise (unexpected processes, network anomalies, file modifications).
Can we detect if our pickle files have been exploited?
Detection is indirect: look for signs of code execution following pickle deserialization (process spawn, network connections, file writes). If no suspicious activity is observed around the time of loading, exploitation may not have occurred. However, an attacker could craft payloads with delayed or silent behavior. The most reliable remediation is patching picklescan and re-validating all pickle sources.
This analysis is provided for informational purposes to support vulnerability management and security decision-making. The technical details and remediation guidance are based on the CVE description and CVSS assessment; organizations should verify patch availability, compatibility, and testing procedures with picklescan maintainers and their vendors before deploying changes. No liability is assumed for the accuracy of patch version numbers or deployment outcomes. Always implement changes in a controlled environment and maintain comprehensive backups. Source: NVD (public-domain), retrieved 2026-08-12. 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