/

CVE-2025-71364

Severity:

HIGH RISK

(8.1)

RCE via Undetected Unsafe Pickle (CWE-502) in picklescan

CVE-2025-71364

Deferred

Vulnerability type

Category:

Unsafe Deserialization

CWE:

CWE-502

Impact:

Remote Code Execution

Severity:

HIGH RISK

(8.1)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A detection gap in picklescan allows malicious pickle files to embed the asyncio.unix_events._UnixSubprocessTransport._start function in reduce methods without being flagged.

When such pickles are loaded by an application that relies on picklescan for safety checks, attackers can execute arbitrary commands, turning otherwise trusted deserialization into a remote code execution risk.

Affected context

This vulnerability affects environments where Python pickle files are used for data exchange, caching, or serialization and are scanned with vulnerable versions of picklescan.

It is most relevant when applications treat pickles as safe after passing picklescan checks, especially in services that deserialize data from external or semi-trusted sources.

The risk exists whenever untrusted or user-controlled pickle payloads are accepted and loaded under the assumption that picklescan will reliably detect dangerous reduce functions.

Exploit preconditions

  • Attack surface: Any component that deserializes pickle data and relies on picklescan for pre-load safety validation
  • Required access: Ability to supply or influence pickle payloads (e.g., file uploads, API inputs, message queues)
  • Trigger point: Application calls pickle.load / pickle.loads or equivalent on a malicious payload that previously passed picklescan checks
  • Why exploitation is possible: picklescan before 0.0.30 does not recognize asyncio.unix_events._UnixSubprocessTransport._start as a dangerous callable in pickle reduce methods, allowing attacker-controlled code paths to run on deserialization

Why this happens

The core issue maps to CWE-502: Unsafe Deserialization, where untrusted serialized data influences program execution.

In this case, the bug is not in the pickle protocol itself but in the security tool's incomplete threat model: picklescan's detection logic omits the asyncio.unix_events._UnixSubprocessTransport._start function from its list of dangerous or executable constructs.

Because pickle reduce mechanisms can invoke arbitrary callables during reconstruction, any detection gap effectively becomes an execution primitive when applications treat "scanned" pickles as trusted.

Potential impact

  • Attackers may execute arbitrary OS commands under the privileges of the deserializing process.
  • Compromised services could expose sensitive data or credentials.
  • An attacker could pivot from the affected application to other internal systems.
  • Remote compromise of application integrity and availability, including deployment-wide impact if shared deserialization services are used.

General mitigation guidance

Mitigation typically centers on reducing trust in pickle-based data and limiting what deserialization can do:

  • Avoid using pickle for untrusted or external data when possible, favoring safer serialization formats (e.g., JSON) that do not execute code.
  • Treat safety scanners like picklescan as an additional layer, not a primary trust guarantee; maintain strict input validation and compartmentalize deserialization.
  • Constrain deserialization contexts using least-privilege execution, restricting filesystem, network, and process-spawning capabilities of components that handle pickles.
  • Implement allow-list–based deserialization patterns where only specific, benign classes and callables are reconstructable from serialized data.

How teams detect issues like this

High-level detection strategies focus on both code and behavior:

  • Static analysis rules can target usages of pickle.load / pickle.loads and identify paths where inputs may be influenced by external actors.
  • Code reviews should flag reliance on pickle scanning tools as a sole defense, and look for undocumented assumptions about "safe" serialized data.
  • Security policies can mandate non-executable serialization formats for cross-boundary data exchanges and restrict pickle usage to internal, tightly controlled contexts.
  • Runtime monitoring and alerting around unusual subprocess creation or command execution originating from deserialization routines can help uncover exploitation attempts.

Sources

SourceLink
github.comgithub.com/mmaitre314/picklescan/security/advisories/GHSA-q77w-mwjj-7mqx
vulncheck.comvulncheck.com/advisories/picklescan-arbitrary-code-execution-via-undetected-asyncio-unix-events-unixsubprocesstransport-start

Frequently asked

questions

Yes, if an attacker can provide pickle data to a service that deserializes it and relies on vulnerable picklescan checks, the issue can lead to remote code execution.

The attacker must be able to influence serialized pickle input—such as uploading files, sending API requests that carry pickled data, or injecting messages into queues consumed by a pickle-using service.

The most robust pattern is to avoid using pickle for any untrusted data, replacing it with non-executable serialization formats and treating security scanners as supplementary rather than foundational controls.

Design systems so that deserialization never implies code execution, maintain explicit allow-lists for reconstructable types, apply least privilege to components handling serialized data, and integrate security reviews that question assumptions about "safe" data validated by tools.

Find out what's already
exploitable in your codebase.