Modelscan Bypass PoC β shutil.which() Executable Discovery
Vulnerability
Modelscan 0.7.6 fails to detect malicious pickle files that use shutil.which for System reconnaissance β discovers installed executables, their paths, and system configuration. Useful for targeted follow-up attacks.
The shutil module is not in modelscan's unsafe_globals blocklist.
Chain
shutil.which(name)β not blocked\n2. Finds executable paths on the system (reconnaissance)
Reproduction
modelscan scan -p pytorch_model.bin
# Result: "No issues found"
python3 -c "import pickle; result = pickle.loads(open('pytorch_model.bin','rb').read()); print(result)"
# Result: Returns path to python3 executable
Impact
System reconnaissance β discovers installed executables, their paths, and system configuration. Useful for targeted follow-up attacks. Severity: MEDIUM.
Modelscan Version
0.7.6 (latest on PyPI as of 2026-04-09)
Inference Providers NEW
This model isn't deployed by any Inference Provider. π Ask for provider support