NewApp Monitoring is liveSign up free
AgentbeamBeta
AI agent vulnerability · MLflow

CVE-2026-0596: Mlflow: Command Injection when serving models with enable_mlserver=True

criticalCVSS 3.0 9.6GHSA-rvhj-8chj-8v3c

MLflow before 3.9.0 has a command injection when a model is served with enable_mlserver=True. The model_uri goes unescaped into a bash -c command, so $() or backticks in it run attacker commands. Upgrade mlflow to 3.9.0.

Published Mar 31, 2026 · Updated May 20, 2026 · Analysis Oct 31, 2026

What an attacker can do

With enable_mlserver=True, MLflow builds a shell command for the MLServer runtime and runs it through bash -c. The model_uri is inserted into that string without sanitization. If the value holds shell metacharacters such as $() or backticks, the shell performs command substitution and runs whatever the attacker put there.

The attacker must control the model_uri value or the path it points to. The advisory gives a concrete case: a higher-privileged service serves models from a directory that lower-privileged users can write to. A low-privileged user then names a model directory with a payload and gains the privileges of the serving account. The CVSS 3.0 vector (adjacent network, no privileges, scope changed) scores 9.6. Any pipeline that takes model URIs from users, registries or shared storage is a candidate.

Who is affected

pip package mlflow, all versions before 3.9.0, when serving a model with enable_mlserver=True. Serving without MLServer does not use this code path. Check the version:

pip show mlflow

Then search your deployment scripts and service units for enable_mlserver and for model URIs that come from user input or shared directories.

mlflow

Ecosystem
PyPI
Affected
< 3.9.0
Fixed in
3.9.0
Check
pip show mlflow

How to fix it

Upgrade to mlflow 3.9.0:

pip install --upgrade mlflow==3.9.0

The fix (pull request 19738, in mlflow/pyfunc/mlserver.py) wraps the model_uri in shlex.quote() before it enters the bash -c command. The sources give no other workaround. Until you upgrade, do not enable MLServer on model URIs that untrusted users can influence.

How to tell if you were hit

Check the process tree for shell children started by the MLflow serving process. Look for model_uri values or model directory names containing $(, backticks, semicolons or similar. Review shell history and audit logs of the serving account for unexpected commands. Check shared model directories for entries created by lower-privileged users.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

A command injection vulnerability exists in Mlflow when serving a model with enable_mlserver=True. The model_uri is embedded directly into a shell command executed via bash -c without proper sanitization. If the model_uri contains shell metacharacters, such as $() or backticks, it allows for command substitution and execution of attacker-controlled commands. This vulnerability affects the latest version of mlflow/mlflow and can lead to privilege escalation if a higher-privileged service serves models from a directory writable by lower-privileged users.

Credited to ConnorCallison, rotemd-apiiro.

Questions

Is MLflow affected if I do not use enable_mlserver?

The advisory describes the flaw only for serving with enable_mlserver=True. Other serving paths are not named as affected.

How does privilege escalation happen here?

A higher-privileged service serves models from a directory writable by lower-privileged users. Those users plant a name with command substitution, and the service runs it with its own rights.

Which version fixes CVE-2026-0596?

mlflow 3.9.0. The change quotes the model_uri with shlex.quote().

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology

More MLflow vulnerabilities

All MLflow entries