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

CVE-2023-6709: Jinja2 template injection in mlflow

highCVSS 3.1 8.8GHSA-cxfr-5q3r-2rc2

MLflow before 2.9.2 renders recipe cards with a standard Jinja2 environment, so template syntax in card content is evaluated. An authenticated network attacker can turn that into code execution. MLflow 2.9.2 renders cards in a sandboxed environment.

Published Dec 12, 2023 · Updated Nov 22, 2024 · Analysis Nov 2, 2026

What an attacker can do

The to_html method in mlflow/recipes/cards/__init__.py renders a recipe card's Jinja2 template into HTML. Before the fix it built the template with a regular jinja2.Environment and the BaseLoader. Jinja2 expressions in the card could then reach Python internals, which is server-side template injection (CWE-1336). The fix commit, titled "Use SandboxedEnvironment when rendering cards (#10640)", switches the environment to SandboxedEnvironment and keeps the loader and render call as they were.

The CVSS vector shows network access and low privileges, with no user interaction. So the attacker needs an account or access that lets them place content into a card that the MLflow process renders. The advisory gives no more detail on how that content gets in.

If the injection works, commands run as the MLflow process. That gives the attacker the host's files, credentials in the environment, and access to other users' experiments and models. All three impacts are rated high. This is a separate template injection from the YAML renderer one fixed in the same 2.9.2 release.

Who is affected

The pip package mlflow below 2.9.2, in setups where untrusted or lower-privileged users can influence recipe card content. Check your version:

pip show mlflow

Shared tracking servers and multi-user notebook hosts have the most exposure.

mlflow

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

How to fix it

Upgrade to mlflow 2.9.2.

pip install -U "mlflow>=2.9.2"

The fix is commit 432b8cc, which makes card rendering use Jinja2's SandboxedEnvironment. The sources list no workaround. Until you upgrade, limit who can write recipe content to people you trust.

How to tell if you were hit

The advisory gives no indicators. Look in recipe card templates and the content that feeds them for Jinja2 syntax ({{ ... }}, {% ... %}) that touches __class__, __mro__, __globals__ or os. Check MLflow process logs and host process listings for unexpected child processes, outbound connections or new files created when cards render.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

Improper Neutralization of Special Elements Used in a Template Engine in GitHub repository mlflow/mlflow prior to 2.9.2.

Questions

Is this the same as CVE-2023-6940?

No. CVE-2023-6940 is in the YAML config renderer, render_and_merge_yaml. This one is in recipe card rendering, to_html. Both are Jinja2 injection fixed in 2.9.2.

Which version fixes CVE-2023-6709?

MLflow 2.9.2. Versions below it are affected.

Does the attacker need to be logged in?

The vector lists low privileges, so some access is needed, with no user interaction. The sources do not say how content reaches the card renderer.

Is it exploited in the wild?

No source I read says so, and the entry has no CISA KEV data.

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