HIGH 8.1

CVE-2025-71369: picklescan RCE via Undetected Torch Utility Bypass

picklescan is a security tool designed to inspect Python pickle files and detect malicious payloads before they are deserialized. A flaw in versions before 0.0.28 allows attackers to craft pickle files that evade picklescan's detection by leveraging a specific PyTorch utility (torch.utils.data.datapipes.utils.decoder.basichandlers) within reduce methods. When a user or system trusts picklescan's clearance and deserializes such a file, the embedded malicious code executes with full privileges, potentially compromising the affected system.

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 use torch.utils.data.datapipes.utils.decoder.basichandlers in reduce methods, allowing attackers to bypass safety checks. Remote attackers can embed undetected malicious code in pickle files that executes during deserialization, enabling remote code execution.

3 reference(s) · View on NVD →

SEC.co analysis · AI-assisted, reviewed against source

Technical summary

CVE-2025-71369 is an improper input validation vulnerability in picklescan's deserialization safety analysis. The vulnerability exists in picklescan versions prior to 0.0.28. Attackers exploit a gap in the tool's inspection logic by embedding malicious reduce methods that reference torch.utils.data.datapipes.utils.decoder.basichandlers. Reduce methods are a serialization mechanism in Python pickle that allow custom deserialization behavior; picklescan's detection patterns fail to flag this specific PyTorch-based construct as dangerous. Upon deserialization by a target application, the arbitrary code embedded in these methods executes without restriction, leading to remote code execution (RCE). This is classified under CWE-502 (Deserialization of Untrusted Data), a well-known attack surface in Python environments.

Business impact

Organizations using picklescan as a trust boundary for untrusted pickle data face a critical gap in their defense. If picklescan is deployed in a pipeline to pre-validate pickle files from external sources—such as model weights, cached datasets, or user uploads—an attacker can bypass that validation and execute arbitrary code on the server or processing system. This could lead to data exfiltration, lateral movement, malware installation, or denial of service. The risk is elevated in machine learning and data engineering workflows where pickle deserialization is common.

Affected systems

picklescan versions before 0.0.28 are vulnerable. Any deployment of picklescan used to vet untrusted pickle files is at risk, particularly in data science platforms, machine learning model repositories, and data pipeline systems that accept external pickle inputs. PyTorch users who rely on picklescan to validate pickle files containing torch.utils.data.datapipes components are especially exposed. Systems that do not use picklescan or that apply additional layers of validation (e.g., sandboxing) may be unaffected.

Exploitability

Exploitation is straightforward from an attacker's perspective. An attacker with the ability to create or modify pickle files can embed malicious code using the undetected torch utility pattern and distribute the file via any channel—email, a model registry, a public dataset, or a compromised repository. The attack requires user interaction only in the sense that someone must deserialize the file; no authentication is required, and the network attack surface is broad (AV:N). Once the pickle is deserialized, code execution is immediate. The CVSS score of 8.1 reflects high confidentiality and integrity impact with no availability component, appropriate for this attack profile.

Remediation

Upgrade picklescan to version 0.0.28 or later. This release includes improved detection patterns that correctly identify malicious reduce methods using torch.utils.data.datapipes.utils.decoder.basichandlers and similar evasion techniques. Organizations should prioritize this update for any system that uses picklescan as a validation gate for untrusted pickle files. Beyond patching, consider supplementary defenses: restrict pickle deserialization to sandboxed environments, run deserialization in isolated processes with minimal privileges, avoid deserializing pickle files from untrusted sources without additional verification, and monitor for unusual unpickling operations.

Patch guidance

Update picklescan to 0.0.28 or later. Verify the update against the official picklescan repository and release notes to confirm the patch addresses CWE-502 detection gaps. If your environment uses picklescan as a library in a larger data pipeline, test the update in a staging environment to ensure no breaking changes to validation rules or output formats. Document the upgrade in your vulnerability remediation tracking system and mark pre-0.0.28 instances as no longer approved for security-critical roles.

Detection guidance

Monitor for deployments of picklescan versions prior to 0.0.28 using software inventory and dependency scanning tools (e.g., pip show, Software Composition Analysis). Check your project requirements.txt, pyproject.toml, or Pipenv lock files for picklescan pinned to an old version. In runtime environments, log all pickle deserialization operations and flag cases where picklescan is used but the version cannot be confirmed as 0.0.28 or later. If possible, enable audit logging on any system that processes untrusted pickle files to detect attempted evasion or suspicious deserialization patterns.

Why prioritize this

This vulnerability should be prioritized if your organization uses picklescan as a trust boundary for untrusted pickle data. The CVSS score of 8.1 and the ease of exploitation (network-accessible, no authentication) make this a high-priority fix. Machine learning teams, data engineering platforms, and model repositories that accept external pickle files should patch immediately. For organizations that do not rely on picklescan or do not deserialize untrusted pickles, the risk is lower but should still be assessed.

Risk score, explained

The CVSS 3.1 score of 8.1 (HIGH) is driven by the network attack vector (AV:N), low attack complexity (AC:L), no privilege requirement (PR:N), and user interaction only in the weak sense of 'someone must deserialize the file' (UI:R). The vulnerability grants high confidentiality and integrity impact (C:H, I:H) as arbitrary code execution is possible, but does not directly cause availability loss (A:N). The score does not account for the fact that this vulnerability defeats a security tool's purpose, which amplifies real-world risk beyond the numerical rating.

Frequently asked questions

Do I need to update picklescan immediately if I'm not currently deserializing untrusted pickle files?

No, immediate patching is not critical if your environment exclusively handles pickle files from trusted internal sources or if you have already implemented additional safeguards (e.g., sandboxing, file signature verification). However, you should plan to update within your standard patch cycle to avoid the vulnerability if your usage patterns change or if untrusted pickles are introduced in the future.

Does this vulnerability affect my system if I use PyTorch but not picklescan?

No. picklescan is a standalone inspection tool. If you do not use picklescan to validate pickle files before deserialization, this CVE does not directly impact you. However, if you deserialize untrusted pickle files at all—picklescan or not—you remain vulnerable to malicious pickle attacks in general and should implement other security controls such as sandboxing or strict file-type restrictions.

Can I work around this vulnerability without upgrading?

Yes, but it requires strong compensating controls. Use sandboxing or containerization to isolate pickle deserialization, run deserialization in a subprocess with minimal filesystem and network access, or restrict pickle imports to a whitelist of known-safe classes. These measures are more labor-intensive than upgrading and may impact performance; they are best treated as temporary measures while you plan the upgrade to 0.0.28 or later.

Why does picklescan fail to detect this malicious pattern?

picklescan uses a pattern-matching approach to identify dangerous reduce methods and callable references in pickle bytecode. The vulnerability exists because the tool's patterns did not include the specific torch.utils.data.datapipes.utils.decoder.basichandlers reference as a known-malicious construct. This is a gap in the detection rules, not a fundamental limitation of pickle inspection; version 0.0.28 adds rules to close this gap and similar evasion techniques.

This analysis is based on the CVE record and vendor information available as of the publication date. Exploit details and proof-of-concept code are not provided. Organizations should verify patch availability and compatibility with their specific environment before deploying updates. If you are unsure whether your systems are affected, consult your security team or the picklescan project maintainers. SEC.co makes no warranty regarding the accuracy, completeness, or timeliness of this information and disclaims liability for any direct or indirect damages resulting from its use or misuse. Source: NVD (public-domain), retrieved 2026-08-12. Analysis generated by SEC.co (claude-haiku-4-5).