MLflow Command Injection vulnerability
MLflow's model serving container initialization directly interpolates dependency specifications from a model artifact's python_env.yaml into a shell command without sanitisation. An attacker who supplies a malicious model artifact could achieve arbitrary command execution on systems that deploy the model.
mlflow/mlflow
Originally disclosed on huntr
A command injection vulnerability exists in MLflow's model serving container initialization code, specifically in the _install_model_dependencies_to_env() function. When deploying a model with env_manager=LOCAL, MLflow reads dependency specifications from the model artifact's python_env.yaml file and directly interpolates them into a shell command without sanitization. This allows an attacker to supply a malicious model artifact and achieve arbitrary command execution on systems that deploy the model. The vulnerability affects versions 3.8.0 and is fixed in version 3.8.1.
From the GitHub Advisory Database (GHSA-r23q-823p-vmf7, CC BY 4.0).
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Impact
An attacker who can supply a malicious model artifact could execute arbitrary commands on systems that deploy the model with env_manager=LOCAL.
What the attacker needed
Ability to supply a malicious model artifact; deployment uses env_manager=LOCAL
The fix
The vulnerability was fixed in version 3.8.1.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
When MLflow deploys a model, it reads a file called python_env.yaml that lists software dependencies. The code takes those dependency names and puts them straight into a command that runs in the operating system's shell. Because the names are not checked, someone who can provide the model file can include special characters that make the shell run extra commands of their choosing.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.