Arbitrary file write via tar traversal in mlflow
MLflow's pyfunc extraction uses tarfile.extractall without validating archive entry paths, so a crafted tar.gz with traversal sequences or absolute paths can write files outside the intended directory. This could lead to arbitrary file overwrites and potentially remote code execution in multi-tenant or untrusted-artifact scenarios.
mlflow/mlflow
Originally disclosed on huntr
A vulnerability in MLflow's pyfunc extraction process allows for arbitrary file writes due to improper handling of tar archive entries. Specifically, the use of tarfile.extractall without path validation enables crafted tar.gz files containing .. or absolute paths to escape the intended extraction directory. This issue affects the latest version of MLflow and poses a high/critical risk in scenarios involving multi-tenant environments or ingestion of untrusted artifacts, as it can lead to arbitrary file overwrites and potential remote code execution.
From the GitHub Advisory Database (GHSA-fhff-qmm8-h2fp, CC BY 4.0).
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
The code called tarfile.extractall without validating that each archive member's path stayed within the intended extraction directory.
Impact
An attacker could overwrite arbitrary files the process can write to, potentially leading to remote code execution, with high or critical risk in multi-tenant environments or when ingesting untrusted artifacts.
What the attacker needed
Ability to supply a crafted tar.gz artifact; MLflow processes untrusted artifacts
The fix
The extraction should validate each archive member's path (or use a safe extraction filter) so that entries cannot escape the target directory.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
When a program unpacks a tar archive, it should only write files inside the folder it chose. Here it did not check the file names inside the archive, so a malicious archive could contain a name that points to a different location on the disk. That lets an attacker overwrite files the program can write to, which in some setups can be turned into running their own code.
What is Path traversal?
Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.