ZenML is vulnerable to Path Traversal through its `PathMaterializer` class
The PathMaterializer class in ZenML 0.83.1 uses an insufficient path validation check during extraction of data.tar.gz, which fails to detect symbolic and hard links. An attacker could exploit this to write arbitrary files, potentially leading to command execution if critical files are overwritten.
zenml-io/zenml
Originally disclosed on huntr
ZenML version 0.83.1 is affected by a path traversal vulnerability in the PathMaterializer class. The load function uses is_path_within_directory to validate files during data.tar.gz extraction, which fails to effectively detect symbolic and hard links. This vulnerability can lead to arbitrary file writes, potentially resulting in arbitrary command execution if critical files are overwritten.
From the GitHub Advisory Database (GHSA-q92x-2x5g-h365, 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
Likely the path validation function `is_path_within_directory` does not resolve or reject symbolic and hard links, allowing extraction to write outside the intended directory.
Impact
An attacker could write arbitrary files, potentially leading to arbitrary command execution if critical files are overwritten.
What the attacker needed
Ability to supply a crafted data.tar.gz
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.
A path traversal flaw lets someone trick a program into accessing files outside the intended folder. Here, when ZenML unpacks a compressed file, it doesn't properly check for special links that can point to other locations, so an attacker could overwrite important files on the system. This could let them run their own commands if they replace a file the system later executes.
What is Path traversal?
Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.