ModelScan Bypass PoC: operator.methodcaller + importlib.import_module
โ ๏ธ SECURITY RESEARCH ONLY โ This repository contains a proof-of-concept for a modelscan scanner bypass.
Vulnerability
modelscan v0.8.8 fails to detect malicious pickle payloads that use:
importlib.import_module()to dynamically load blocked modulesoperator.methodcaller()to invoke methods on imported modules
Both references pass the scanner's blocklist check, resulting in 0 issues reported while the payload achieves arbitrary command execution.
Files
create_poc.pyโ Script to generate the malicious model filespytorch_model.binโ PyTorch-format PoC (passes modelscan, executes with torch.load)
Reproduction
# Install modelscan
pip install modelscan
# Scan the model file โ reports "No issues found"
modelscan scan -p pytorch_model.bin
# Load with torch โ executes arbitrary command
python3 -c "import torch; torch.load('pytorch_model.bin', weights_only=False)"
Disclosure
Submitted to ProtectAI via Huntr responsible disclosure program.
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐ Ask for provider support