GluonCV Arbitrary File Write via TarSlip
The ImageClassificationDataset.from_csv() API in GluonCV downloads and extracts tar.gz files without sanitising paths, allowing a malicious archive to write files outside the intended directory. An attacker could overwrite arbitrary files on the victim's system via path traversal or faked symlinks.
dmlc/gluon-cv
Originally disclosed on huntr
A vulnerability in the ImageClassificationDataset.from_csv() API of the dmlc/gluon-cv repository, version 0.10.0, allows for arbitrary file write. The function downloads and extracts tar.gz files from URLs without proper sanitization, making it susceptible to a TarSlip vulnerability. Attackers can exploit this by crafting malicious tar files that, when extracted, can overwrite files on the victim's system via path traversal or faked symlinks.
From the GitHub Advisory Database (GHSA-m724-hqmc-ggpx, 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 extraction routine trusted the paths and symlinks inside the downloaded tar.gz archive and did not verify that each extracted file stayed within the intended destination directory.
Impact
An attacker could overwrite arbitrary files on the victim's system, which may lead to code execution or data loss depending on what files are replaced.
What the attacker needed
Victim calls from_csv() with attacker URL; attacker hosts a malicious tar.gz
The fix
The extraction should validate each archive member's resolved path and reject symlinks or entries that escape the destination 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 an archive, it should only write files inside the folder it created for that purpose. Here it did not check the file paths inside the archive, so a crafted archive could contain entries that point to other places on the disk. This lets an attacker replace or create files anywhere the program is allowed to write.
What is Path traversal?
Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.