AgentbeamBeta
AI agent vulnerability · MLflow

CVE-2024-0520: Remote code execution in mlflow

criticalCVSS 3.0 10.0GHSA-5q6c-ffvg-xcm9

MLflow before 2.9.0 lets a malicious web server write files anywhere the MLflow process can write. When MLflow loads a dataset from an HTTP URL, it trusts the filename from the Content-Disposition header, so path traversal gives arbitrary file write and, in turn, command execution. Upgrade to 2.9.0.

Published Jun 6, 2024 · Updated Apr 8, 2025 · Analysis Nov 17, 2026

What an attacker can do

The flaw is in mlflow/data/http_dataset_source.py. When load() fetches a dataset from an HTTP source, it takes the file name from the Content-Disposition header, or from the URL path, and joins it to the destination directory without sanitizing it. A name like ../../tmp/poc.txt or /tmp/poc.txt escapes the intended folder (CWE-22, CWE-23).

The attacker controls the server that hosts the dataset, or sits on the path to it. A user or pipeline must load a dataset from that URL, so the attacker needs the victim to point MLflow at a hostile or compromised source. No credentials on the victim side are needed.

The result is arbitrary file write with the privileges of the MLflow process. The advisory says this can lead to command execution, for example by overwriting a startup script, a cron file, a Python module or a config that the host later runs. That exposes data and model information held by the machine. CVSS scores it 10.0 because the scope changes and no privileges are required.

Who is affected

mlflow on PyPI before 2.9.0. The weak path is dataset loading from an HTTP or HTTPS source URL. The advisory text names version 8.2.1 in the description, which looks like a typo for 2.x, while the package range is below 2.9.0.

Check your install:

pip show mlflow

Also review code and pipelines that call dataset loaders on URLs you do not control.

mlflow

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

How to fix it

Upgrade to mlflow 2.9.0.

pip install --upgrade "mlflow>=2.9.0"

The fix commit adds a helper, _is_path, that returns true when the filename has any directory component, by comparing it with its basename. In load(), after the filename is read from Content-Disposition and its quotes are removed, a path-like name raises an MlflowException saying the header filename must be a file name, not a path. Absolute, ./, ../ and relative paths are all rejected. When the header has no filename, the basename of the URL path is still used.

The sources give no other workaround. Until you upgrade, load datasets only from sources you trust.

How to tell if you were hit

Look for files created outside the expected MLflow dataset cache directory around the time of a dataset load, especially in /tmp, home directories, startup or cron paths and Python site-packages. Check which URLs your jobs loaded datasets from, and look for responses whose Content-Disposition filename holds .. or begins with a slash. After the fix, such a response makes load() fail with the invalid-parameter error, so that message in logs on 2.9.0 or later marks an attempt.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

A vulnerability in mlflow/mlflow version 8.2.1 allows for remote code execution due to improper neutralization of special elements used in an OS command ('Command Injection') within the mlflow.data.http_dataset_source.py module. Specifically, when loading a dataset from a source URL with an HTTP scheme, the filename extracted from the Content-Disposition header or the URL path is used to generate the final file path without proper sanitization. This flaw enables an attacker to control the file path fully by utilizing path traversal or absolute path techniques, such as '../../tmp/poc.txt' or '/tmp/poc.txt', leading to arbitrary file write. Exploiting this vulnerability could allow a malicious user to execute commands on the vulnerable machine, potentially gaining access to data and model information. The issue is fixed in version 2.9.0.

Questions

Which MLflow version fixes CVE-2024-0520?

MLflow 2.9.0. Versions below it are vulnerable.

Does the attacker need access to my MLflow server?

No. They need to control or intercept the HTTP source the dataset is loaded from, and a user or job must load from it.

How does file write become code execution?

The attacker overwrites a file that something later runs, using traversal or an absolute path. The advisory says this can run commands on the machine.

Is it exploited in the wild?

The sources do not say so. It is not a CISA KEV entry.

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