Executive brief
Picklescan is a security library used to validate pickle files before loading them—a critical safeguard in machine learning workflows where untrusted model files are common. This vulnerability allows attackers to craft pickle files containing hidden malicious code that passes Picklescan's safety checks but executes arbitrary commands when loaded. This is particularly dangerous in supply chain attacks targeting ML models, APIs, and saved Python objects.
Technical details
The vulnerability is a detection bypass in the deserialization safety checker (CWE-502). Picklescan fails to detect when a pickle file's reduce method calls idlelib.pyshell.ModifiedInterpreter.runcommand, a built-in Python function that can execute arbitrary code. An attacker constructs a malicious pickle object by overriding __reduce__ to invoke this function with a payload string (e.g., OS commands). When a victim uses Picklescan to validate the file and receives a clean verdict, they proceed to pickle.load() the file, triggering execution of the embedded payload. The attack requires user interaction (victim must load the pickle) but no authentication. Picklescan versions before 0.0.30 are affected; patching updates the detection rules to identify this gadget chain.
Affected products
- mmaitre314 picklescan < 0.0.30
Timeline
- 2026-06-21: disclosed: Advisory published to GitHub Advisory Database
- 2026-06-21: patched: Fix released in picklescan 0.0.30