Modelscan Bypass PoC β shutil.copy() File Copy
Vulnerability
Modelscan 0.7.6 fails to detect malicious pickle files that use shutil.copy for Arbitrary file copy β can exfiltrate sensitive files (/etc/passwd, SSH keys, configs) or overwrite system files.
The shutil module is not in modelscan's unsafe_globals blocklist.
Chain
shutil.copy(src, dst)β not blocked\n2. Copies any readable file to any writable location
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: Copies /etc/passwd to attacker-controlled path
Impact
Arbitrary file copy β can exfiltrate sensitive files (/etc/passwd, SSH keys, configs) or overwrite system files. Severity: HIGH.
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