/

CVE-2025-71363

Severity:

HIGH RISK

(8.1)

Unsafe Deserialization (CWE-502) via picklescan Bypass

CVE-2025-71363

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 prior to version 0.0.30 allows malicious pickle payloads using cProfile.run to evade detection.

When such crafted pickle files are deserialized, remote attackers can execute arbitrary code on the system that processes them, making any workflow that relies on picklescan for safety particularly risky.

Affected context

This vulnerability appears in environments that rely on picklescan (before 0.0.30) to vet untrusted or semi-trusted pickle data before deserialization.

It is most relevant where:

  • Python pickle is used to load data from external or user-controlled sources
  • Security controls assume picklescan will detect dangerous reducer methods
  • Deserialization occurs automatically in batch jobs, APIs, or data pipelines without additional validation

Exploit preconditions

  • Attack surface: Any interface, service, or pipeline that accepts pickle data and uses picklescan for screening.
  • Required access: Ability to provide or influence serialized pickle content (e.g., upload, API parameter, message queue item).
  • Trigger point: Deserialization of a malicious pickle object after it has passed picklescan checks.
  • Why exploitation is possible: picklescan fails to recognize cProfile.run calls embedded in reduce methods as dangerous, allowing attacker-controlled code paths to be executed during unpickling.

Why this happens

The underlying issue is incomplete coverage in the unsafe deserialization detection logic of picklescan.

The tool's analysis of pickle reduce methods does not treat cProfile.run invocations as potentially executable attacker-controlled code, so these payloads are not flagged as suspicious.

This maps directly to CWE-502: Unsafe Deserialization, where applications trust serialized data and rely on insufficient safeguards, allowing logic or code execution during object reconstruction.

Potential impact

  • Remote execution of arbitrary Python code during pickle deserialization
  • Compromise of the application process handling the pickle data
  • Unauthorized access to local files, environment variables, and secrets
  • Pivoting to other internal systems reachable from the compromised host
  • Tampering with data processed or produced by vulnerable pipelines

General mitigation guidance

Mitigation should focus on reducing trust in pickle-based data and hardening deserialization flows rather than relying solely on detection tools.

Common defensive patterns include:

  • Avoiding pickle for untrusted or external data in favor of safer, schema-based formats.
  • Isolating deserialization logic in tightly constrained, low-privilege execution environments.
  • Applying explicit allowlists for callable targets and reducer methods during object reconstruction.
  • Implementing layered validation and authorization checks before acting on deserialized content.
  • Treating security scanning utilities like picklescan as one control among several, not a standalone gate.

How teams detect issues like this

Effective detection typically combines static and dynamic perspectives:

  • Static analysis rules that flag use of pickle, cPickle, or custom reducers handling external input.
  • Code review practices that scrutinize any deserialization of data originating outside the trust boundary.
  • Policy-based checks in CI pipelines to discourage unsafe serialization formats for user-controlled data.
  • Monitoring for unexpected cProfile.run usage or unusual execution paths during deserialization in runtime telemetry.

Automated security review tools can help surface unsafe deserialization patterns but should be complemented by manual review and architectural controls.

Sources

SourceLink
github.comgithub.com/mmaitre314/picklescan/security/advisories/GHSA-49gj-c84q-6qm9
vulncheck.comvulncheck.com/advisories/picklescan-arbitrary-code-execution-via-undetected-cprofile-run-in-pickle-deserialization

Frequently asked

questions

Yes, if an attacker can supply pickle data to a system that uses picklescan for screening and then deserializes that data, they may achieve remote code execution.

The attacker needs the ability to influence or provide serialized pickle content to the vulnerable application—such as sending files, API payloads, or messages that the system subsequently deserializes.

The most robust fix pattern is to avoid using pickle for any data originating outside a tightly controlled trust boundary, and to replace it with safer, schema-driven serialization formats while enforcing strict validation before processing.

Design systems to minimize or eliminate unsafe deserialization, enforce architectural guidelines against using pickle for untrusted input, combine multiple security controls (validation, isolation, monitoring), and regularly review detection tools for coverage gaps.

Find out what's already
exploitable in your codebase.