/

CVE-2025-71360

Severity:

HIGH RISK

(8.1)

Undetected Malicious Pickle (CWE-502) in picklescan

CVE-2025-71360

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 flaw in picklescan before version 0.0.29 allows malicious pickle payloads that leverage idlelib.calltip.get_entity in reduce methods to evade detection.

Attackers can hide code in crafted pickle files that will execute remote commands when loaded by victim applications that rely on picklescan for security screening.

Affected context

This vulnerability appears in environments that use picklescan as a security check for Python pickle files, particularly before version 0.0.29.

It is relevant where user-supplied or third-party pickle data is accepted and scanned, and application code assumes that picklescan will reliably flag dangerous deserialization behavior before unpickling occurs.

The risk is elevated in automated workflows, services, or tools that deserialize pickles from semi-trusted sources under the belief that picklescan has filtered malicious content.

Exploit preconditions

  • Attack surface: Any application or service that loads pickle files after scanning them with a vulnerable picklescan version.
  • Required access: Ability to supply or influence pickle data consumed by the victim (e.g., file upload, API input, shared artifact).
  • Trigger point: Deserialization of a crafted pickle object whose reduce method uses idlelib.calltip.get_entity, bypassing picklescan's detection logic.
  • Why exploitation is possible: The detection engine fails to recognize this specific code execution vector, allowing malicious constructors embedded in the pickle stream to remain unflagged and execute at unpickling time.

Why this happens

The underlying issue stems from incomplete coverage of execution primitives in the pickle detection logic, a classic unsafe deserialization pattern mapped to CWE-502.

picklescan's analysis fails to treat the idlelib.calltip.get_entity function in reduce methods as a dangerous call chain capable of invoking arbitrary code during unpickling.

As a result, attacker-controlled pickle data can reference this function to execute commands, while the security scanner incorrectly treats the payload as benign.

Potential impact

  • Remote execution of attacker-controlled commands on systems that deserialize the malicious pickle.
  • Compromise of application processes, including installation of backdoors or malware.
  • Unauthorized access to sensitive data handled by the deserializing application.
  • Lateral movement within the environment using the compromised application as a foothold.
  • Tampering with models, configuration objects, or other serialized artifacts used in production workflows.

General mitigation guidance

Effective mitigation centers on reducing trust in pickle data and tightening deserialization behavior.

Pattern-based defenses include:

  • Treating all pickle input as untrusted and avoiding deserialization in security-sensitive contexts where possible.
  • Applying strict allowlists for callable targets and modules that may be invoked via reduce or other pickle mechanisms.
  • Introducing sandboxing or process isolation for any required deserialization, limiting available commands and filesystem access.
  • Favoring safer serialization formats (e.g., JSON, msgpack, or protocol buffers) for data exchange between components.
  • Applying least privilege to processes that handle untrusted serialized data, minimizing the blast radius of a successful exploit.

How teams detect issues like this

Detection efforts can focus on both code and runtime behavior:

  • Static analysis rules that flag use of pickle, cPickle, or similar modules for untrusted data, especially with complex reduce implementations.
  • Code review practices that look for assumptions about the safety of scanners like picklescan and verify that deserialization is treated as high risk.
  • Runtime monitoring for unexpected subprocess creation, outbound network connections, or file modifications originating from deserialization routines.
  • Policy enforcement that restricts the use of dangerous modules or introspection functions such as those in idlelib in serialization logic.
  • Automated security testing that feeds crafted pickles into deserialization paths to confirm that scanners and guards properly detect or block them.

Sources

SourceLink
github.comgithub.com/mmaitre314/picklescan/security/advisories/GHSA-9xph-j2h6-g47v
vulncheck.comvulncheck.com/advisories/picklescan-remote-code-execution-via-undetected-idlelib-calltip-get-entity

Frequently asked

questions

Yes, if an attacker can deliver a malicious pickle file to a system that scans it with a vulnerable picklescan version and then deserializes it, remote command execution may occur.

The attacker needs the ability to influence or upload pickle data consumed by the victim application—such as file uploads, shared artifacts, or API parameters that are eventually unpickled.

The safest pattern is to avoid unpickling untrusted data entirely and to migrate to safer serialization formats. Where pickle must be used, constrain callable targets, isolate deserialization in a sandbox, and do not rely solely on scanners for safety.

Treat deserialization of complex formats as a high-risk operation, adopt secure-by-default serialization choices, implement robust code review policies around pickle usage, and use automated static and dynamic analysis to highlight risky deserialization patterns.

Find out what's already
exploitable in your codebase.