Описание
Picklescan has Incomplete List of Disallowed Inputs
Summary
Currently picklescanner only blocks some specific functions of the pydoc and operator modules. Attackers can use other functions within these allowed modules to go through undetected and achieve RCE on the final user. Particularly
- pydoc.locate: Can dynamically resolve and import arbitrary modules (e.g., resolving the string "os" to the actual os module).
- operator.methodcaller: Allows executing a method on an object. When combined with a resolved module object, it can execute functions like system.
Since locate and methodcaller are not explicitly listed in the deny-list, picklescan treats them as "Safe" or "Suspicious" (depending on configuration) but does not flag them as "Dangerous", allowing the malicious file to bypass the security check.
PoC
use the provided script to create a malicious pickle file
The generated payload will not be flagged as dangerous by picklescan but is actually malicious.
Script to open the pickle file, demonstrating impact
Remediation
The deny-list for these modules must be upgraded from specific functions to a wildcard (*), indicating that any use of these modules is dangerous.
Пакеты
picklescan
< 0.0.33
0.0.33
8.9 High
CVSS4
Дефекты
8.9 High
CVSS4