NewApp Monitoring is liveSign up free
AgentbeamBeta
AI agent vulnerability · MLflow

CVE-2026-4035: MLflow: Environment variable injection in AI Gateway secrets enables server-side credential exfiltration

criticalCVSS 3.0 9.1GHSA-g35p-px32-whv6

MLflow before 3.11.0 resolves `$ENV_VAR` references in the `api_key` field of AI Gateway secrets against the server's own environment, then sends the value to an attacker-chosen `api_base`. That leaks server credentials such as AWS keys. Default deployments without basic-auth need no login. Upgrade to mlflow 3.11.0.

Published Jun 3, 2026 · Updated Jul 10, 2026 · Analysis Oct 26, 2026

What an attacker can do

AI Gateway secrets hold the provider key MLflow uses to call an upstream model. The api_key field accepts a value like $AWS_SECRET_ACCESS_KEY. At request time MLflow replaces that reference with the matching variable from the MLflow server's environment. It then sends the result in the provider's authentication headers to the configured api_base (CWE-201).

An attacker creates a gateway secret whose api_key points at a sensitive variable and whose api_base points to a host they control. When the gateway makes a call, the server's credential arrives at that host in the auth header.

Who can do it: a low-privileged authenticated user when basic-auth is on, or anyone with network access in a default deployment without basic-auth. The advisory names cloud artifact credentials (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY) as the prize. With them an attacker can poison model artifacts in the store. That can lead to code execution in downstream environments that load those artifacts. The scope-changed CVSS vector reflects that the damage lands outside MLflow itself.

Who is affected

The mlflow package on PyPI, all versions before 3.11.0, where the AI Gateway is used and the server process holds secrets in its environment. Deployments without basic-auth are exposed to unauthenticated users. Check the version:

pip show mlflow

Also list which credentials your server process holds, since those are what a leak would expose:

printenv | grep -E 'AWS|AZURE|GOOGLE|OPENAI'

Run that in the server's own environment, not your shell.

mlflow

Ecosystem
PyPI
Affected
< 3.11.0
Fixed in
3.11.0
Check
pip show mlflow

How to fix it

Upgrade to mlflow 3.11.0:

pip install --upgrade 'mlflow>=3.11.0'

The fix (commit 4a3f2f7, PR 21544) adds the environment variable MLFLOW_GATEWAY_RESOLVE_API_KEY_FROM_ENV, which defaults to false. With it off, _resolve_api_key_from_input in mlflow/gateway/config.py returns a $-prefixed value as a plain string. The legacy YAML gateway path (mlflow gateway start) switches the flag on itself, so those configs keep working. Any $VAR reference used outside that path now stays literal unless you set the flag.

If you may have been exposed, rotate the AWS and provider keys in the server's environment. The sources give no other workaround; enabling basic-auth reduces the audience but does not remove the flaw.

How to tell if you were hit

The sources give no log signatures. Review existing AI Gateway secrets for an api_key that starts with $, and for any api_base that is not your real provider. Check outbound connections from the MLflow server to unknown hosts. Check cloud audit logs (such as AWS CloudTrail) for use of the server's access key from unfamiliar IP addresses. Look for unexpected changes to artifacts in the store.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

A vulnerability in mlflow/mlflow versions prior to 3.11.0 allows for the resolution of environment variables in AI Gateway secrets, which can be exploited to exfiltrate sensitive server-side environment credentials to an attacker-controlled endpoint. This issue arises because the api_key field in gateway secrets can accept $ENV_VAR references, which are resolved against the MLflow server's environment during runtime. The resolved secrets are then sent in provider authentication headers to the configured upstream api_base. This vulnerability can be exploited by low-privileged authenticated users in basic-auth deployments or by unauthenticated users in default deployments without basic-auth. The impact includes potential leakage of sensitive credentials such as cloud artifact credentials (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY), which could lead to artifact poisoning and cross-boundary code execution in downstream environments. The issue is fixed in version 3.11.0.

Questions

Does CVE-2026-4035 need authentication?

Per the advisory, a low-privileged authenticated user can exploit it when basic-auth is enabled. In default deployments without basic-auth, an unauthenticated user can.

Which version fixes it?

mlflow 3.11.0. All earlier versions are affected.

Which credentials can leak?

Any environment variable the MLflow server process holds. The advisory names AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY for artifact storage.

Is it exploited in the wild?

The sources do not say so, and the entry has no CISA KEV flag. The EPSS score is low, at 0.0052.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology

More MLflow vulnerabilities

All MLflow entries