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

CVE-2024-27134: MLflow's excessive directory permissions allow local privilege escalation

highCVSS 4.0 7.3 · 3.1 7.0GHSA-qpgc-w4mg-6v92

MLflow before 2.16.0 makes the temporary model download directory used by spark_udf() world-writable. A local user on the same machine can swap files in it in a time-of-check/time-of-use attack and gain the privileges of the account running the job. Only code that calls spark_udf() is exposed. Upgrade to 2.16.0.

Published Nov 25, 2024 · Analysis Nov 1, 2026

What an attacker can do

_create_model_downloading_tmp_dir() in mlflow/pyfunc/__init__.py creates the directory with tempfile.mkdtemp, which gives mode 0o700. The code then ran os.chmod(tmp_model_dir, 0o777) so that Spark workers could read the model. That lets every local user write into it.

A local attacker who can see the directory replaces the model files after MLflow downloads them but before the Spark UDF loads them. MLflow models can carry code, such as a Python pickle, so loading the swapped model runs the attacker's code as the user running the job. That is the privilege escalation.

The attacker needs a local account on the same host, and the attack depends on winning a race, hence the high complexity. The vector also lists user interaction: someone has to run spark_udf(). Shared Spark or Databricks-style hosts, shared notebook servers and multi-user clusters are the realistic risk. A single-user machine is not.

Who is affected

mlflow (pip) before 2.16.0, on hosts where untrusted local users exist and a workflow calls the spark_udf() API. Other MLflow features do not use this directory. Check the version:

pip show mlflow

Then search your jobs and notebooks for spark_udf( calls.

mlflow

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

How to fix it

Upgrade to mlflow 2.16.0:

pip install --upgrade "mlflow>=2.16.0"

The fix is commit 0b1d995d, which tightens the directory mode from 0o777 to 0o770, so only the owner and group can use it. If you cannot upgrade, avoid running spark_udf() on hosts shared with untrusted users.

How to tell if you were hit

On shared hosts, list the temporary model download directories under the MLflow model cache or temp path and look for ones with mode 777. Check them for files owned by users other than the job owner, or with modification times between download and load. Review the audit logs for unexpected processes started by the Spark job's account.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

Excessive directory permissions in MLflow leads to local privilege escalation when using spark_udf. This behavior can be exploited by a local attacker to gain elevated permissions by using a ToCToU attack. The issue is only relevant when the spark_udf() MLflow API is called.

Questions

Does CVE-2024-27134 affect all MLflow usage?

No. The advisory says the issue is only relevant when the spark_udf() API is called.

Can it be exploited remotely?

No. The CVSS vector is local. The attacker needs an account on the same machine and has to win a time-of-check/time-of-use race.

Which version fixes it?

MLflow 2.16.0. The fix narrows the directory permissions from 0o777 to 0o770.

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