MLflow statsmodels flavor bypasses pickle deserialization security control

HighSE Fix-First Score 43/100GHSA-gqvg-gmmx-x4hmSE-AIV-00699Unsafe loading of model or data filesAI data and pipelinesPublished 1 Sep 2026

Download as PDF

What this means

An attacker can upload a malicious model file to an artifact store that MLflow uses. When someone loads that model using MLflow's model loading function, arbitrary code runs with the privileges of the person or service doing the loading. This bypasses the security setting that is supposed to block this attack.

SecurityElites Manager Brief: the decision in one minute

MLflow has a security setting to block dangerous pickle file loading, but the statsmodels part of MLflow ignores this setting. An attacker who can write to a model storage location can run code on any server that loads models from MLflow, even if the security setting is turned on. Update MLflow to block this.

SecurityElites Fix-First Score43 of 100
Our own ranking of what to fix first. Real attacks count most, then the chance of attack, then severity.
SecurityElites fix windowWithin 30 days
High severity. This is our suggestion from common practice; your own policy comes first.
Who should own the fixPlatform or ML infrastructure team (whoever manages MLflow and model deployment).
Likely effortAbout 15 minutes per server: download and install the fixed version, then restart any service that uses MLflow to load models. Identifying which services are affected may take longer if you have many deployments.

Questions to ask your team or supplier

  • Do we have a process to review who can upload models to our artifact store? Can we restrict it to trusted accounts only?
  • Do we have an inventory of all statsmodels models currently in our artifact stores, and can we verify that each one came from a trusted source?

Message you can forward to the owning team

Security notice: MLflow statsmodels flavor bypasses pickle deserialization security control (GHSA-gqvg-gmmx-x4hm)

Severity: High
SecurityElites Fix-First Score: 43 of 100
SecurityElites fix window: Within 30 days
Action: upgrade to mlflow 3.15.0 or later.
What we need from you: confirm whether we run this software, who owns it, and the date it will be fixed.
Full guide: https://securityelites.com/ai-vulnerabilities/ghsa-gqvg-gmmx-x4hm-mlflow-statsmodels-flavor-bypasses-pickle-deserialization-security-con/
Source: SecurityElites AI Vulnerabilities Database, record SE-AIV-00699

What is at stake in your AI setup

  • Model files: attackers can replace or poison statsmodels model files in the artifact store, affecting any downstream ML pipeline or inference service that loads them.
  • Compute resources: code execution during model loading can consume CPU, memory, or cloud credits to run attacker-controlled workloads.
  • Keys and credentials: if model loading happens on a server with access to API keys, database passwords, or cloud provider credentials, those could be stolen and used to access other systems.
  • Data: if the process loading the model has access to training data, test data, or logs, those could be exfiltrated by malicious code run during model deserialization.

Map where your company uses AI

Who is exposed

  • Teams running MLflow 2.1.0 through 3.14.x that have set MLFLOW_ALLOW_PICKLE_DESERIALIZATION=False expecting protection.
  • Services that load statsmodels format models from shared or cloud artifact stores.
  • Any MLflow deployment where multiple users or services can upload model files.
  • Databricks users are not affected if they run on a Databricks-managed MLflow instance.

Upgrades you need

SoftwareAffected versionsMove to
mlflow
PyPI
2.1.0 up to, but not including, 3.15.03.15.0 or later

Am I affected?

Enter the version you run. Nothing you type is stored.

SecurityElites Developer Brief: the technical picture

Kind of coding mistake

  • CWE-502: untrusted data is loaded as objects

Where it sits in the standards

OWASP Top 10 for LLM Applications 2025: LLM03 Supply Chain (unsafe model and data files)

If you cannot upgrade today

  • Immediately restrict who can upload models to your artifact store. Use access controls to allow only trusted data science accounts.
  • Remove or move all statsmodels models from shared artifact stores to a secure, restricted location until MLflow is upgraded.
  • If you cannot upgrade yet, manually inspect every statsmodels MLmodel YAML file in your artifact store and verify you trust the source and the `.pkl` file. Remove any you do not recognize.

Signs it may already have been used against you

  • Artifact store logs: look for uploads or writes to files named `MLmodel` with `loader_module: mlflow.statsmodels` from accounts or IP addresses you do not recognize.
  • MLflow tracking server logs: search for successful loads of statsmodels format models (URIs matching `models:/.../` with statsmodels flavor). Filter for loads that do not match normal data science or batch job patterns.
  • System or service logs on servers running MLflow: search for errors about pickle deserialization being blocked, or unexpected child processes spawned by the MLflow process (sign of code execution).
  • File system: check modification times on `.pkl` files in statsmodels model directories for unexpected recent changes.

Log searches to start from

Find loads of statsmodels models when pickle deserialization should be blockedSplunk

source="mlflow" (loader_module="mlflow.statsmodels" OR flavor="statsmodels") | search NOT error

Find unexpected uploads to artifact store in statsmodels model directoriesElastic

event.action:write AND path:*statsmodels* AND path:*MLmodel*

Written with AI as a starting point. Review them and change the index and field names to match your own logs before you rely on the result.

SecurityElites Fix Guide: step by step

  1. Find where MLflow is installedCheck all servers, containers, and virtual environments where MLflow is used to load models. Look for MLflow in Python package lists (`pip list` or `pip freeze`) and check the version.
  2. Check if MLFLOW_ALLOW_PICKLE_DESERIALIZATION is setOn each server or service, check environment variables for `MLFLOW_ALLOW_PICKLE_DESERIALIZATION`. If it is set to `False`, this server believes it is protected and is affected by this bypass.
  3. List all statsmodels models in your artifact storesSearch your MLflow artifact store (file system, S3, cloud storage, or database) for MLmodel files that have `loader_module: mlflow.statsmodels` in the YAML. Each one is a potential attack point.
  4. Check access logs for suspicious model uploads or loadsReview artifact store logs and MLflow tracking server logs for the past 30 days. Look for uploads of statsmodels models from unknown sources or by unexpected accounts, and loads of those models by services or users that do not normally use them.
  5. Back up or isolate untrusted modelsIf you do not own or trust the source of a statsmodels model in your artifact store, move it to a quarantine location or restrict access to it immediately. This prevents accidental loading.
  6. Upgrade MLflow to version 3.15.0 or laterInstall MLflow 3.15.0 or higher on all servers, in all containers, and in all virtual environments. The fixed version adds the missing security check to the statsmodels flavor.
  7. Restart services that use MLflowRestart any application, service, or background job that loads models using MLflow. This ensures the new code is running.
  8. Verify the fix is in placeOn a test server, set `MLFLOW_ALLOW_PICKLE_DESERIALIZATION=False` and try to load a statsmodels model from your artifact store. It should fail with an error message about pickle deserialization being disallowed. Verify the error occurs instead of the model loading.

How to confirm it is fixed: Set MLFLOW_ALLOW_PICKLE_DESERIALIZATION=False on a test server with MLflow 3.15.0 or later installed, then attempt to load a statsmodels model; it should fail with an error about pickle deserialization being disallowed instead of loading the model.

SecurityElites Quick Fixes: copy and paste

Upgrade mlflow with pipupgrade

pip install --upgrade "mlflow>=3.15.0"
pip show mlflow | grep Version

Pin it in requirements.txtupgrade

mlflow>=3.15.0

Check MLflow version installedfor this issue

python -c "import mlflow; print(mlflow.__version__)"

Search for statsmodels models in local artifact storefor this issue

grep -r "loader_module: mlflow.statsmodels" /path/to/artifact/store --include="MLmodel"

Check if MLFLOW_ALLOW_PICKLE_DESERIALIZATION is set in environmentfor this issue

echo $MLFLOW_ALLOW_PICKLE_DESERIALIZATION

Load PyTorch weights without running codegeneral hardening

import torch
state = torch.load("model.pt", weights_only=True)

Load safetensors weightsgeneral hardening

from safetensors.torch import load_file
state = load_file("model.safetensors")

Test in a non-production environment first. General hardening examples use placeholder names and ports; change them to match your setup.

Let your AI coding assistant do the upgrade

Paste this into the coding assistant you already use, inside the project. It checks first and asks before it changes anything.

Instruction for your coding assistant

You are helping me fix a security vulnerability (GHSA-gqvg-gmmx-x4hm) in this project.\n\n1. Search the whole repository, including lock files, container files and CI configuration, for these packages and list every place they are pinned or installed:\n   - mlflow (PyPI): must be 3.15.0 or later
2. Tell me which version we use now and whether it is affected. Stop and ask me before changing anything.
3. After I agree, raise each one to the safe version, update the lock files, and keep every other dependency as it is.
4. Run the tests and tell me what failed.
5. Give me a short summary of the files you changed that I can put in the pull request.

SecurityElites Incident Drill: could your team handle this?

Four questions to ask in your next team meeting. If any has no clear answer, that is the gap to close.

What is the difference between how MLflow's sklearn flavor and statsmodels flavor handle the MLFLOW_ALLOW_PICKLE_DESERIALIZATION setting?A good answer: The sklearn flavor checks the setting and raises an error if pickle deserialization is blocked; the statsmodels flavor does not check it at all and always allows pickle deserialization.
An attacker uploads a file called `MLmodel` with `loader_module: mlflow.statsmodels` to our artifact store. What happens when our service calls `mlflow.pyfunc.load_model()` on it?A good answer: MLflow dispatches the load to the statsmodels flavor, which loads and deserializes the pickle file without checking the security setting, allowing arbitrary code execution.
We set `MLFLOW_ALLOW_PICKLE_DESERIALIZATION=False` on all our model loading servers. Are we protected against statsmodels models?A good answer: No, this vulnerability allows the statsmodels flavor to bypass that setting, so you are still vulnerable until you upgrade MLflow to 3.15.0 or later.
What should we do if we find that a malicious statsmodels model was loaded on one of our servers before we could upgrade?A good answer: Immediately isolate that server, check system logs and network traffic for signs of data theft or further compromise, review access logs for all sensitive resources, rotate any credentials that may have been exposed, and perform a security

Run a full timed drill with your team

Ticket for your backlog

Paste into Jira, GitHub Issues or any tracker that reads Markdown.

Ready-made ticket

## MLflow statsmodels flavor bypasses pickle deserialization security control (GHSA-gqvg-gmmx-x4hm)

**Severity:** High  |  **SE Fix-First Score:** 43/100  |  **Fix window:** Within 30 days
**Record:** SE-AIV-00699 https://securityelites.com/ai-vulnerabilities/ghsa-gqvg-gmmx-x4hm-mlflow-statsmodels-flavor-bypasses-pickle-deserialization-security-con/

### Why this matters
An attacker can upload a malicious model file to an artifact store that MLflow uses. When someone loads that model using MLflow's model loading function, arbitrary code runs with the privileges of the person or service doing the loading. This bypasses the security setting that is supposed to block this attack.

### What to do
1. Find where MLflow is installed: Check all servers, containers, and virtual environments where MLflow is used to load models. Look for MLflow in Python package lists (`pip list` or `pip freeze`) and check the version.
2. Check if MLFLOW_ALLOW_PICKLE_DESERIALIZATION is set: On each server or service, check environment variables for `MLFLOW_ALLOW_PICKLE_DESERIALIZATION`. If it is set to `False`, this server believes it is protected and is affected by this bypass.
3. List all statsmodels models in your artifact stores: Search your MLflow artifact store (file system, S3, cloud storage, or database) for MLmodel files that have `loader_module: mlflow.statsmodels` in the YAML. Each one is a potential attack point.
4. Check access logs for suspicious model uploads or loads: Review artifact store logs and MLflow tracking server logs for the past 30 days. Look for uploads of statsmodels models from unknown sources or by unexpected accounts, and loads of those models by services or users that do not normally use them.
5. Back up or isolate untrusted models: If you do not own or trust the source of a statsmodels model in your artifact store, move it to a quarantine location or restrict access to it immediately. This prevents accidental loading.
6. Upgrade MLflow to version 3.15.0 or later: Install MLflow 3.15.0 or higher on all servers, in all containers, and in all virtual environments. The fixed version adds the missing security check to the statsmodels flavor.
7. Restart services that use MLflow: Restart any application, service, or background job that loads models using MLflow. This ensures the new code is running.
8. Verify the fix is in place: On a test server, set `MLFLOW_ALLOW_PICKLE_DESERIALIZATION=False` and try to load a statsmodels model from your artifact store. It should fail with an error message about pickle deserialization being disallowed. Verify the error occurs instead of the model loading.

### Done when
- [ ] mlflow is at 3.15.0 or later everywhere it is installed
- [ ] Lock files, container images and CI configuration are updated
- [ ] Set MLFLOW_ALLOW_PICKLE_DESERIALIZATION=False on a test server with MLflow 3.15.0 or later installed, then attempt to load a statsmodels model; it should fail with an error about pickle deserialization being disallowed instead of loading the model.
- [ ] Logs were checked for signs of earlier use

SecurityElites Fix Tracker

Record who owns this fix, the date it is due and when it is done, and see everything still open in one list. Free with a SecurityElites account.

Sign in to track this fix

Related vulnerabilities

In the same software

The same kind of mistake in other AI tools

Change history

  • 1 Sep 2026: Made public
  • 1 Dec 2026: Published

Official record

## SummaryMLflow introduced `MLFLOW_ALLOW_PICKLE_DESERIALIZATION` as a security control to prevent unsafe `pickle.load` execution during model loading, in response to CVE-2024-37052 through CVE-2024-37060. When set to `False`, operators expect all pickle deserialization to be blocked. The most recent related fix (#21188) patched a bypass in the pyfunc flavor.However, the `mlflow.statsmodels` flavor completely omits this guard. An attacker who places a crafted MLmodel artifact into any accessible artifact store can trigger arbitrary code execution on any process that calls `mlflow.pyfunc.load_model()` against the malicious model — **even when `MLFLOW_ALLOW_PICKLE_DESERIALIZATION=False`**.This is a security control bypass. The operator believes pickle RCE is mitigated; the statsmodels flavor silently ignores the control.---## Root Cause`mlflow.pyfunc.load_model()` dispatches to flavor `_load_pyfunc` implementations via:``` # mlflow/pyfunc/__init__.py L1170-1172 model_impl = importlib.import_module(conf[MAIN])._load_pyfunc(data_path) ```The guarded pattern (from `mlflow/sklearn/__init__.py` L526-533, the reference implementation) is:``` if ( not MLFLOW_ALLOW_PICKLE_DESERIALIZATION.get() and not is_in_databricks_runtime() and not is_in_databricks_model_serving_environment() ): raise MlflowException("Deserializing model using pickle is disallowed...") ````mlflow/statsmodels/__init__.py` has **no such check**:``` # L307-320 — no guard anywhere in this file def _load_model(path): import statsmodels.iolib.api as smio return smio.load_pickle(path) # calls pickle.load() directlydef _load_pyfunc(path): return _StatsmodelsModelWrapper(_load_model(path)) ````statsmodels.iolib.api.load_pickle` is a thin wrapper around `pickle.load`. Its own docstring warns: *"Never unpickle data received from an untrusted or unauthenticated source."*---## TriggerAn attacker crafts an MLmodel YAML that specifies `mlflow.statsmodels` as the loader module:``` flavors: python_function: loader_module: mlflow.statsmodels data: model.pkl statsmodels: data: model.pkl statsmodels_version: 0.14.0 ```With a malicious `model.pkl` placed alongside it in the artifact store, any call to:``` os.environ["MLFLOW_ALLOW_PICKLE_DESERIALIZATION"] = "False" mlflow.pyfunc.load_model("models:/MaliciousModel/1") ```...deserializes the pickle file with **no guard check**, executing arbitrary code with the privileges of the calling process.On default MLflow deployments (no `--app-name basic-auth`), authentication is disabled, so artifact upload requires no credentials.---## Affected Code- `mlflow/statsmodels/__init__.py` L307-310: `_load_model` — calls `smio.load_pickle` without checking `MLFLOW_ALLOW_PICKLE_DESERIALIZATION` - `mlflow/statsmodels/__init__.py` L313-320: `_load_pyfunc` — dispatches to `_load_model` without checking the controlPermalink (commit `0b0c576c`): - https://github.com/mlflow/mlflow/blob/0b0c576c642b5b0d9496c829809c7d097403bc9f/mlflow/statsmodels/__init__.py#L307-L310 - https://github.com/mlflow/mlflow/blob/0b0c576c642b5b0d9496c829809c7d097403bc9f/mlflow/statsmodels/__init__.py#L313-L320---## Recommended FixAdd the missing guard to `mlflow/statsmodels/__init__.py`:``` from mlflow.environment_variables import MLFLOW_ALLOW_PICKLE_DESERIALIZATION from mlflow.utils.databricks_utils import ( is_in_databricks_model_serving_environment, is_in_databricks_runtime, )def _load_model(path): if ( not MLFLOW_ALLOW_PICKLE_DESERIALIZATION.get() and not is_in_databricks_runtime() and not is_in_databricks_model_serving_environment() ): raise MlflowException( "Deserializing model using pickle is disallowed, but this statsmodels " "model requires pickle deserialization. Set environment variable " "'MLFLOW_ALLOW_PICKLE_DESERIALIZATION' to 'true' to allow this." ) import statsmodel

Weakness type: CWE-502

Use this record in your own tools

Get this record as JSON

curl https://securityelites.com/wp-json/se-aivd/v1/vulns/GHSA-gqvg-gmmx-x4hm

For scanners and pipelines: OSV format · CycloneDX format · API guide · Email alerts · Fix tracker

The plain-language sections were written with AI from the official record, and the upgrade versions come directly from the official data. Last updated 1 Sep 2026. Read the vendor advisory before changing a production system.