Executive brief
Picklescan is a security tool used to detect malicious code hidden within Python "pickle" files, which are commonly used to store Machine Learning models like PyTorch. A vulnerability was found where certain specially crafted files could bypass these security checks by using a specific built-in Python function. If a user relies on Picklescan and then opens one of these undetected malicious files, an attacker could remotely execute code on their system, potentially leading to data theft or full system compromise.
Technical details
Picklescan versions prior to 0.0.29 contain a detection bypass vulnerability. The tool fails to identify malicious payloads that leverage the 'idlelib.debugobj.ObjectTreeItem.SetText' function within a pickle's __reduce__ method. An attacker can craft a malicious pickle file (such as a PyTorch model) that appears safe to Picklescan but executes arbitrary commands via the 'setfunction' parameter when loaded using 'pickle.load()'. This is a classic deserialization gadget bypass. The issue is resolved in version 0.0.29 by adding the missing function to the blocklist.
Affected products
- mmaitre314 picklescan < 0.0.29
Timeline
- 2025-08-26: disclosed
- 2025-08-26: advisory
- 2025-08-26: patched: Fixed in version 0.0.29