CVE-2025-71351: Picklescan Remote Code Execution via timeit Library
Summary
CVE-2025-71351: Picklescan missing detection when calling built-in python library function timeit.timeit(). Affects picklescan versions < 0.0.25. Fixed in 0.0.25. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
Picklescan is a Python library designed to detect malicious pickle files, particularly in machine learning models. It aims to enhance security by scanning for unsafe deserialization practices that could lead to remote code execution. However, due to its reliance on a blacklist of unsafe globals, it may fail to detect certain vulnerabilities, such as those involving built-in Python library functions.
Vulnerability Detail
The vulnerability arises from Picklescan's inability to detect malicious payloads that utilize the built-in timeit.timeit() function during the deserialization process of pickle files. Attackers can exploit this by crafting a payload that calls timeit.timeit() within the reduce method of a class, allowing them to execute arbitrary OS commands undetected. This poses a significant risk as it enables remote code execution when a victim unknowingly loads a malicious pickle file.
How To Fix
Latest published version: 1.0.5 as of 22 Oct 2026
pip install --upgrade "picklescan==1.0.5"
Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.
If you need the minimum change
0.0.25
This is the first release that contains the fix.
pip install --upgrade "picklescan==0.0.25"
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
As a temporary workaround, users can manually check the contents of pickle files before loading them, or implement additional security measures such as using a custom deserialization method that restricts the execution of certain functions.
Conclusion
The vulnerability CVE-2025-71351 in the Picklescan library highlights a significant security risk associated with the deserialization of pickle files. By exploiting the timeit library, attackers can execute arbitrary code undetected. It is crucial for users to update to the patched version and consider additional security measures to mitigate this risk.
See every vulnerability recorded for picklescan →
FAQ
The vulnerability allows attackers to execute arbitrary code by exploiting the timeit.timeit() function during the deserialization of pickle files.
You can use Vulert's playground at Vulert Scanner to check if your application is affected without requiring signup.
If exploited, this vulnerability can lead to remote code execution, allowing attackers to run arbitrary commands on the victim's system.
Yes, updating to Picklescan version 0.0.25 or later addresses this vulnerability.
Consider implementing additional security measures or manually inspecting pickle files before loading them as a temporary workaround.
References
Related vulnerabilities
Recent vulnerabilities recorded for picklescan.