CVE-2024-0520 Remote Code Execution due to Full Controlled File Write in mlflow/mlflow
Attackers can achieve remote code execution via arbitrary file write in MLflow by exploiting path traversal in dataset loading.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2024-0520?
CVE-2024-0520 is a critical path traversal vulnerability in Lfprojects Mlflow, published on 6 Jun 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
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.
Weakness: CWE-22
Which versions are affected by CVE-2024-0520?
4 open source packages ship an affected version, including mlflow. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
mlflow Bitnami | All versions | 2.9.1 |
mlflow PyPI | All versions | 2.9.0 |
mlflow PyPI | All versions | 2.9.0 |
mlflow PyPI | All versions | 2.9.0 |
Products include Lfprojects Mlflow.
How do I fix CVE-2024-0520?
Upgrade mlflow to a fixed version for your release line: 2.9.1 or 2.9.0.
Upgrade, and resolve every user-supplied path against an allowed base folder before opening it. More about Path traversal.
Is CVE-2024-0520 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-0520 exists.
Public exploit code: 1 proofs of concept on GitHub.
Other vulnerabilities in Lfprojects Mlflow
Sources
Also known as BIT-mlflow-2024-0520, GHSA-5q6c-ffvg-xcm9, PYSEC-2024-239.