Summary
A directory traversal vulnerability in the MLflow Tracking Server's artifact handler allows attackers to control file paths used in server-side file operations without proper validation.
When exposed, this flaw can be abused to read or write arbitrary files and, under common deployment configurations, can be chained into remote code execution in the context of the MLflow service account.
Affected context
This issue arises in deployments of the MLflow Tracking Server where:
- The artifact handler accepts user-supplied paths to manage experiment artifacts
- These paths are used in file operations on the server's filesystem
- The Tracking Server is reachable over the network (intranet or internet)
- File paths are not strictly constrained to a dedicated artifact root directory
In such environments, an attacker can craft path values that escape the intended artifact directory and interact with sensitive files or writable locations.
Exploit preconditions
- Attack surface: MLflow Tracking Server HTTP interface that handles artifact upload, download, or management.
- Required access: No authentication required; an attacker only needs network access to the exposed Tracking Server.
- Trigger point: Submission of an artifact-related request containing a crafted file path or artifact location that includes traversal patterns (e.g., sequences intended to escape the artifact root).
- Why exploitation is possible: The server uses the user-supplied path directly in filesystem operations without normalizing, constraining, or validating it against an allowed base directory, enabling access to files outside the intended artifact scope and possible placement of attacker-controlled content in executable or configuration locations.
Why this happens
The root cause is insufficient validation and normalization of user-controlled file paths before they are used in filesystem operations on the server.
Instead of enforcing that all artifact paths remain within a constrained artifact root, the implementation trusts incoming path segments and constructs filesystem paths directly.
This matches CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where input is not checked to ensure it does not resolve outside the intended directory.
When combined with typical MLflow deployments that may dynamically load models or configurations from the filesystem, this arbitrary file access can be turned into code execution.
Potential impact
- Reading files that may contain configuration, secrets, or environment details accessible to the MLflow service account
- Overwriting or creating files in directories writable by the service account
- Injecting or modifying code, model files, or configuration that the service later loads, potentially leading to remote code execution
- Tampering with experiment artifacts, leading to integrity loss and data poisoning of ML workflows
- Facilitating lateral movement by planting malicious files used by other services or scheduled jobs
General mitigation guidance
Effective mitigation focuses on strictly constraining file paths and reducing trust in user-controlled artifact locations:
- Resolve and normalize all artifact paths and enforce that they remain within a single configured artifact root directory before performing any file operation.
- Use high-level APIs or helper functions that join paths safely (e.g., joining with a base directory and rejecting any result that escapes that base).
- Implement explicit allowlists for path patterns or object keys instead of passing raw user-supplied paths directly to the filesystem.
- Separate artifact storage from application or configuration directories, using dedicated, non-executable storage locations.
- Run the Tracking Server under a dedicated, least-privilege service account with no permission to modify application binaries, configuration files, or system-wide directories.
- Where possible, use external object storage (e.g., buckets) with restricted permissions rather than local shared filesystem storage for artifacts.
How teams detect issues like this
Detection typically combines code-level and runtime approaches:
- Static analysis and code review:
- Search for file operations (open, read, write, delete, list) that use values derived from HTTP parameters or request bodies without normalization or validation.
- Flag uses of path-joining logic that do not verify that the resulting path starts with an expected artifact root.
- Enforce review policies that require explicit checks against directory traversal (e.g., rejecting sequences that resolve outside the base directory).
- Configuration and infrastructure checks:
- Identify MLflow Tracking Servers exposed to untrusted networks without authentication.
- Verify that service accounts for MLflow have minimal filesystem privileges, and that artifact directories are isolated from executable and configuration paths.
- Runtime monitoring:
- Monitor server logs for suspicious artifact path patterns (e.g., repeated attempts with traversal-like segments).
- Use file integrity monitoring around directories that should never be modified by artifact-handling logic.
Automated security testing tools and SAST platforms can be configured with rules targeting CWE-22 patterns in Python and web service code to catch similar issues early in development.

