/

CVE-2025-71361

Severity:

HIGH RISK

(8.1)

Code Injection (CWE-95) via Python pickle payloads

CVE-2025-71361

Deferred

Vulnerability type

Category:

Code Injection

CWE:

CWE-95

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 code injection weakness in picklescan before version 0.0.29 fails to recognize malicious idlelib.calltip.Calltip.fetch_tip usage inside Python pickle payloads.

If an application relies on vulnerable picklescan to vet untrusted pickle files, attackers can smuggle payloads that execute arbitrary code when processed with pickle.load().

Affected context

This vulnerability appears in environments that:

  • Use Python pickle serialization to load data structures
  • Depend on picklescan (pre-0.0.29) to detect dangerous constructs in pickle files
  • Accept or process pickle data from sources that are not fully trusted

Under these conditions, malicious pickle content can bypass scanning and execute at load time.

Exploit preconditions

  • Attack surface: Any component that runs pickle.load() on data assumed safe after picklescan analysis
  • Required access: Ability to supply or influence pickle files consumed by the application (e.g., uploaded files, API inputs, shared storage)
  • Trigger point: Invocation of pickle.load() (or equivalent) on a crafted pickle containing idlelib.calltip.Calltip.fetch_tip or similar constructs
  • Why exploitation is possible: The scanner's rules do not flag this callable chain as dangerous, allowing attacker-controlled code paths to be invoked during object reconstruction

Why this happens

The core issue is incomplete detection logic within the picklescan tool that underestimates the attack surface of Python's pickle protocol.

Specifically, picklescan before 0.0.29 does not treat idlelib.calltip.Calltip.fetch_tip and related behaviors as dangerous, enabling adversaries to embed executable flows within serialized objects that appear benign to the scanner.

This aligns with CWE-95: Improper Neutralization of Directives in Dynamically Evaluated Code (Code Injection) because attacker-controlled data steers execution when the pickle is deserialized.

Potential impact

  • Remote execution of arbitrary Python code under the permissions of the deserializing process
  • Full compromise of the affected application or service
  • Unauthorized access to sensitive data loaded in the same runtime
  • Further lateral movement or deployment of additional malicious components

General mitigation guidance

Effective mitigation strategies focus on reducing trust in pickle-based data and strengthening inspection practices:

  • Avoid using pickle for untrusted or semi-trusted data; prefer safer, schema-driven formats such as JSON or protocol buffers
  • Treat all pickle input as potentially dangerous, even if scanned, and minimize or remove the need for dynamic object reconstruction from external sources
  • Introduce strict allowlists for classes and callables that can be instantiated during deserialization, rejecting anything outside the approved set
  • Run deserialization in constrained environments with least privilege and strong isolation so that any unexpected execution is contained
  • Incorporate defense-in-depth checks, such as content validation and runtime guards, rather than relying solely on a scanning tool

How teams detect issues like this

Organizations can detect this class of risk through:

  • Static analysis rules that flag uses of pickle.load(), loads(), or similar APIs on data from external sources
  • Code review practices that question any dependence on pickle for inbound data and the assumption that scanners make it safe
  • Security policies that discourage dynamic code evaluation or deserialization of complex objects originating outside the trust boundary
  • Runtime monitoring to detect anomalous behavior patterns during pickle processing, such as unexpected imports, file access, or network calls
  • Periodic assessment of third-party security tools (like picklescan) to ensure their coverage matches current exploitation techniques

Sources

SourceLink
github.comgithub.com/mmaitre314/picklescan/security/advisories/GHSA-8r4j-24qv-fmq9
vulncheck.comvulncheck.com/advisories/picklescan-remote-code-execution-via-undetected-idlelib-calltip-calltip-fetch-tip

Frequently asked

questions

Yes, if an application exposes a network interface or API that accepts pickle data and relies on vulnerable picklescan to certify it as safe, an attacker can deliver malicious payloads remotely.

An attacker needs the ability to supply or modify pickle files that the target application will load. This could be through uploads, message queues, shared storage, or any integration that passes serialized objects.

The safest approach is to avoid using pickle for untrusted data altogether, replacing it with non-executable serialization formats. Where pickle is unavoidable, tightly restrict what can be deserialized and ensure that security checks do not rely solely on pattern-based scanners.

Establish architectural guidelines that ban or strictly control dynamic deserialization and code evaluation, use safer serialization mechanisms by default, and regularly review both application code and supporting tools for unsafe patterns. Integrate these rules into CI pipelines so that risky constructs are caught before deployment.

Find out what's already
exploitable in your codebase.