HIGH 8.1

CVE-2025-71357: Picklescan Evasion via idlelib.pyshell.ModifiedInterpreter

Picklescan, a Python library designed to detect malicious pickle files, has a detection bypass vulnerability in versions before 0.0.30. Attackers can craft pickle files that leverage Python's idlelib.pyshell.ModifiedInterpreter.runcommand function within reduce methods to execute arbitrary remote commands on systems that load the file. The vulnerability exists because picklescan fails to recognize this specific code execution path as dangerous, allowing malicious payloads to slip through security checks.

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
1 configuration(s)
Published / Modified
2026-06-21 / 2026-06-26

NVD description (verbatim)

picklescan before 0.0.30 fails to detect malicious pickle files using idlelib.pyshell.ModifiedInterpreter.runcommand in reduce methods. Attackers can embed undetected code in pickle files that executes remote commands when loaded by victims.

3 reference(s) · View on NVD →

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

Technical summary

CVE-2025-71357 is a deserialization detection evasion vulnerability in picklescan that results from incomplete validation of pickle gadget chains. Specifically, the library does not block or flag the use of idlelib.pyshell.ModifiedInterpreter.runcommand as a reduce method target. Pickle's reduce protocol allows objects to specify custom unpickling behavior; attackers exploit this by constructing reduce chains that invoke ModifiedInterpreter.runcommand, which can execute shell commands. This gadget chain bypasses picklescan's validation logic, enabling remote code execution when untrusted pickle data is deserialized. The vulnerability affects all versions prior to 0.0.30.

Business impact

Organizations relying on picklescan to validate untrusted pickle files before deserialization are exposed to remote code execution attacks. This is particularly critical in data processing pipelines, machine learning model loading workflows, and any environment where pickled objects from external sources are consumed. A successful exploit allows attackers to execute arbitrary commands with the privileges of the process, potentially leading to full system compromise, data exfiltration, or lateral movement within a network.

Affected systems

Picklescan versions before 0.0.30 are vulnerable. Any system or application that uses picklescan as a security layer to validate pickle files before deserialization is at risk. This includes data science workflows, MLOps platforms, and applications that accept serialized Python objects from untrusted sources.

Exploitability

Exploitation requires network access and user interaction—specifically, the victim must load a malicious pickle file (CVSS AV:N, UI:R). The attack has low complexity and requires no privileges (AC:L, PR:N). Once a victim loads a crafted pickle file, remote command execution occurs automatically. The barrier to exploitation is moderate: attackers must understand pickle serialization and the ModifiedInterpreter gadget, but no zero-click delivery mechanism is present in the vulnerability itself.

Remediation

Upgrade picklescan to version 0.0.30 or later, which addresses the detection bypass by adding validation for the idlelib.pyshell.ModifiedInterpreter.runcommand gadget chain. Verify the upgrade by testing with known malicious pickle samples. As a compensating control, implement strict input validation, restrict pickle deserialization to trusted sources only, and consider using alternative serialization formats (JSON, Protocol Buffers) where feasible.

Patch guidance

Apply picklescan version 0.0.30 or newer across all affected environments. Verify the upgrade does not break existing pickle validation workflows by running regression tests with your organization's typical pickle datasets. Check the picklescan project repository and release notes to confirm the fix addresses the idlelib.pyshell.ModifiedInterpreter gadget path before deploying to production.

Detection guidance

Search logs and code repositories for any pickle deserialization operations, particularly those that process untrusted input or rely on picklescan for validation. Monitor for unexpected child processes spawning from Python interpreters processing pickle data. Examine pickle files for the presence of idlelib.pyshell.ModifiedInterpreter references in reduce methods using a pickle inspector or hex editor. Implement logging around pickle.loads() and picklescan.scan() calls to capture validation bypass attempts.

Why prioritize this

This vulnerability should be prioritized because it directly undermines a security control (picklescan) designed to prevent pickle-based RCE. Organizations may have assumed they were protected from malicious pickle files by running them through picklescan, creating a false sense of security. The HIGH CVSS score (8.1) reflects the severity of unauthenticated remote code execution with user interaction. Any system actively using picklescan for validation should patch immediately.

Risk score, explained

The CVSS v3.1 score of 8.1 (HIGH) reflects: network-accessible attack vector (AV:N), low attack complexity with no special privileges required (AC:L, PR:N), high impact to confidentiality and integrity of the target system (C:H, I:H), and no availability impact (A:N). User interaction is required to load the malicious pickle (UI:R), which prevents a higher critical rating but does not materially reduce risk in pipelines where pickle loading is automated or routine.

Frequently asked questions

If we use picklescan, are we protected from all malicious pickle files?

No. This vulnerability demonstrates that picklescan before version 0.0.30 can be evaded by crafting reduce methods that invoke idlelib.pyshell.ModifiedInterpreter.runcommand. Upgrade to 0.0.30+ for improved detection, but treat picklescan as one layer of defense, not a complete guarantee. Never load pickle files from untrusted sources without additional validation.

What is the idlelib.pyshell.ModifiedInterpreter gadget?

It is a Python standard library component that, when invoked via pickle's reduce protocol, can execute shell commands. Attackers leverage it to create a code execution path that earlier versions of picklescan did not recognize as dangerous.

Do we need to patch if we don't use picklescan?

No. This CVE is specific to picklescan. However, if your organization deserializes untrusted pickle files using standard Python pickle without any validation layer, you are exposed to broader pickle deserialization risks (CWE-502). Consider adopting picklescan or moving to safer serialization formats.

How do we verify that a picklescan upgrade actually fixes this issue?

Test the updated version against a malicious pickle sample that includes idlelib.pyshell.ModifiedInterpreter.runcommand in a reduce method. Verify that picklescan now flags or blocks the file. Review the fix in the picklescan source code or release notes to confirm the idlelib.pyshell path is explicitly handled.

This analysis is provided for informational purposes to help security teams understand and remediate CVE-2025-71357. It is not a substitute for vendor advisories or professional security assessment. Verify all patch versions, affected products, and remediation steps against official vendor documentation before deploying changes to production systems. SEC.co makes no warranty regarding the completeness or accuracy of this summary relative to future disclosures or vendor updates. Source: NVD (public-domain), retrieved 2026-07-28. Analysis generated by SEC.co (claude-haiku-4-5).