Summary
An input validation flaw in MLflow's _create_model_version() and get_model_version_artifact_handler() handlers allows remote, unauthenticated attackers to register arbitrary filesystem paths as model version sources.
When the special mlflow.prompt.is_prompt tag is present, normal source path validation is bypassed, enabling attackers to later read arbitrary files from the server's filesystem through the artifact serving endpoint.
Affected context
This vulnerability affects MLflow deployments that expose the model registry and artifact-serving HTTP endpoints, particularly where the MLflow server is reachable over a network (intra-org or internet-facing).
It manifests in environments where:
- Unauthenticated or broadly authenticated users can issue
CreateModelVersionrequests - The server runs with read access to sensitive data (e.g., configuration files, credentials, SSH keys, or other tenants' artifacts)
- Model version sources are assumed to be trusted local paths or controlled storage locations
Under these conditions, an attacker can leverage the model registry API to register arbitrary local paths and subsequently retrieve files via the artifact-serving handler.
Exploit preconditions
- Attack surface: MLflow model registry and artifact-serving HTTP endpoints
- Required access: Network access to the MLflow server; no authentication required where anonymous model creation is allowed
- Trigger point (phase 1): A
CreateModelVersionrequest that includes the tagmlflow.prompt.is_promptand supplies an arbitrary local filesystem path as the model versionsource - Trigger point (phase 2): A follow-up request to
get_model_version_artifact_handler()to retrieve files from the previously registered source path - Why exploitation is possible:
- The presence of
mlflow.prompt.is_promptcauses the_create_model_version()handler to bypass normal source path validation, allowing attacker-controlled absolute or sensitive local paths to be stored. - The
get_model_version_artifact_handler()later trusts the storedsourcevalue without re-checking whether it is a prompt model or validating that it points to a safe, expected location. - As a result, arbitrary local files readable by the MLflow server process can be served back to the attacker.
Why this happens
The underlying issue is a breakdown of path validation and trust boundaries between two linked handlers in the model registry workflow.
Specifically, _create_model_version() contains a conditional code path keyed off the mlflow.prompt.is_prompt tag that bypasses or relaxes normal validation of the source field.
This means untrusted client input can directly influence which local paths are recorded as model version sources.
Later, get_model_version_artifact_handler() assumes those stored sources are trusted and uses them to read and serve files without enforcing constraints on where the path points (e.g., specific artifact directories or storage backends).
This behavior aligns with CWE-22: Improper Limitation of a Pathname to a Restricted Directory, where user-controlled path data is insufficiently constrained, enabling access to resources outside the intended directory or logical scope.
Potential impact
- Read access to arbitrary files on the MLflow server filesystem that are accessible to the server process
- Exposure of application configuration files containing database credentials, API keys, or cloud access tokens
- Disclosure of other tenants' or teams' ML artifacts, datasets, or model binaries in multi-tenant environments
- Leakage of operating system files that may aid in further attacks (e.g., user account data, service configuration)
- Potential pivot to broader infrastructure compromise if sensitive credentials or internal network details are exposed
General mitigation guidance
Effective mitigation focuses on tightening path handling, reinforcing trust boundaries, and reducing the attack surface of the MLflow server:
- Constrain model sources:
- Ensure model version
sourcevalues are always validated against a known set of storage backends or rooted directories. - Avoid special-case tags or flags (such as prompt-related tags) that skip or weaken validation paths.
- Normalize and restrict paths:
- Normalize any filesystem path before use and verify it resides within an allowed directory tree.
- Reject absolute paths or paths containing traversal patterns, and do not rely solely on string checks.
- Separate prompt-specific logic from core path handling:
- Treat prompt-related metadata as orthogonal to path validation.
- Apply the same validation requirements for all model types, including prompt models, to avoid privilege "short-circuits."
- Apply least privilege and data minimization:
- Run the MLflow server under an account with minimal filesystem access, limiting the value of arbitrary file reads.
- Store sensitive configuration and secrets outside of directories that the MLflow process can read or that are likely to be exposed via artifact APIs.
- Harden network and API exposure:
- Restrict access to the model registry and artifact endpoints to trusted networks or authenticated users whenever possible.
- Apply API gateways, authentication, and authorization controls to reduce unauthenticated interaction with MLflow management APIs.
How teams detect issues like this
Detection can be approached at both the code and operational levels:
- Static analysis and code review:
- Flag any request handlers that:
- Use client-supplied path values without enforcing that they live under a configured artifact root or storage backend.
- Include conditional branches (e.g., based on tags or flags) that bypass shared validation logic.
- Review uses of model version
sourcefields, ensuring they are treated as untrusted input whenever they are read from storage. - Configuration and policy enforcement:
- Enforce coding standards that require all file access to go through a centralized path resolution/validation utility.
- Prohibit the introduction of "trusted shortcuts" for certain tags or model types that exempt them from validation.
- Runtime monitoring and logging:
- Enable detailed access logs for model registry and artifact-serving endpoints, including the requested model name, version, and artifact path.
- Alert on requests that:
- Reference unexpected or sensitive directory structures.
- Access unusually named models or versions from suspicious clients or IPs.
- Integrate logs with SIEM solutions to spot patterns of systematic file probing or enumeration.

