Executive brief
picklescan is a security tool used to scan Python pickle files and machine learning models (like PyTorch) for malicious code. A vulnerability was discovered where the tool fails to detect certain types of hidden commands embedded within these files. If a user relies on this tool to verify a file and then opens it, an attacker could execute arbitrary commands on the user's system, potentially leading to a full system compromise or data theft.
Technical details
A deserialization bypass vulnerability exists in picklescan versions prior to 0.0.30. The scanner fails to identify malicious payloads that utilize the 'lib2to3.pgen2.pgen.ParserGenerator.make_label' function within a pickle's __reduce__ method. An attacker can craft a malicious pickle file that evades detection by picklescan but executes arbitrary Python code when processed by pickle.load(). This is achieved by embedding system commands within the label argument of the make_label function. The vulnerability is addressed in version 0.0.30.
Affected products
- picklescan picklescan < 0.0.30
Timeline
- 2025-08-26: advisory: GitHub Security Advisory published
- 2026-07-04: disclosed: NVD publication date
- 2025-08-26: patched: Version 0.0.30 released to address the bypass