MLflow unsafe deserialization in scikit-learn model loading enables arbitrary code execution

Note: This data is for reference and cybersecurity research purposes only.CyStack advises users not to use this information for unlawful purposes.

What is CVE-2024-37052?

CVE-2024-37052 is a vulnerability classified as Deserialization of Untrusted Data, affecting MLflow (affected versions: 1.1.0). This vulnerability is rated High, with a CVSS score of 8.8. Public exploit code or evidence is available for this vulnerability, but that does not confirm exploitation in the wild.

Overview

Original source data

Deserialization of untrusted data can occur in versions of the MLflow platform running version 1.1.0 or newer, enabling a maliciously uploaded scikit-learn model to run arbitrary code on an end user’s system when interacted with.

Affected products and scope

  • MLflow package mlflow: the CNA marks the package affected starting at 1.1.0, with lessThanOrEqual: * under semver. The CNA description expresses this as version 1.1.0 or newer.
  • A separate NVD/CISA-ADP affected entry names 1.1.0 only. Because the CNA explicitly supplies the broader range, this entry follows the CNA range and does not infer a narrower exception for later branches.
  • No specific unaffected later branch, fixed release, or patch boundary is identified in the supplied evidence.

Technical details

The affected path is in sklearn/__init__.py, specifically _load_model_from_local_file, which is reached by mlflow.sklearn.load_model. When the stored artifact uses the relevant serialization format, the loader invokes pickle.load or cloudpickle.load on model data. An attacker can place a malicious pickle object in a scikit-learn model, serialize it through mlflow.sklearn.log_model, and log the resulting model to the tracking server. A victim who loads that model causes the object to be deserialized, which executes attacker-controlled code on the victim's system. This is CWE-502, and the available evidence does not establish a separate server-side execution path from upload alone.

Exploitability

An attacker can reach the vulnerable workflow over the network by getting a malicious scikit-learn model into an MLflow tracking workflow. No attacker privileges are required, attack complexity is low, and user interaction is required because a victim must open, interact with, or load the model. The normalized record flags a public exploit, but it does not identify an exploit name, exploit artifact, campaign, victim, or weaponized procedure. A separate CISA ADP enrichment records exploitation as none at its decision point, so the available evidence does not establish active exploitation and should not be read as proving that no public exploit exists.

Technical impact

At technical level, the outcome is arbitrary code execution in the context of the process that loads the model. Because the attack reaches a user's system through a model artifact, an affected deployment could lose confidentiality, integrity, and availability of resources accessible to that process. The network path and required user interaction limit this to cases where a victim can be induced to load or interact with the malicious model. The evidence does not define the victim's operating-system privileges, container isolation, or whether the MLflow service itself is executed, so the maximum organisational consequence depends on deployment controls.

Business impact

Successful exploitation can give attacker-supplied code execution on the end user's system during model loading. Depending on permissions and environment, that could expose data available to the loading process, alter local files or software, or disrupt workloads. The record supports confidentiality, integrity, and availability consequences for the affected end-user system, but does not document a specific breach, victim, campaign, or server-side compromise. The principal operational risk is unsafe consumption of a model artifact, not simply the model's presence in inventory.

Remediation

  1. Prevent untrusted scikit-learn model artifacts from being loaded by affected MLflow deployments. Restrict model registration and retrieval to trusted sources, and require review before a model enters a workflow that calls the scikit-learn loader.
  2. Inventory mlflow deployments and compare their installed versions with the affected range above. Prioritize systems where users can upload, register, or load models from external sources.
  3. Run model loading in a strongly isolated, least-privileged environment as defense in depth. Minimize the loader's access to sensitive data and unnecessary network services.
  4. No exact fixed release or vendor patch is identified in the supplied evidence. Apply a vendor-confirmed fixed release when one is documented, and do not infer that a branch is safe from the existence of an advisory alone.

Detection

  1. Inventory all MLflow installations and record package versions, especially the mlflow.sklearn integration.
  2. Identify code paths and jobs that call mlflow.sklearn.load_model, and identify tracking servers or registries from which those jobs retrieve model artifacts.
  3. Review model provenance and registration history for scikit-learn artifacts uploaded by untrusted or unexpected principals. This is a review control, not a confirmed indicator of compromise.
  4. In an isolated test environment, check whether model loading passes through pickle.load or cloudpickle.load in the affected path. Do not load untrusted artifacts on a production host.
  5. As a precaution, monitor model-loading processes for unexpected file, process, or network activity. No specific log event or IOC is established by the available evidence, and absence of such activity does not prove safety.
Sources (15)
Learn more

Run an in-depth assessment with complete web risk management

CyStack VulnScan continuously discovers assets, validates vulnerabilities, and helps security teams prioritize remediation across the organization.