VisiData VisiData unzip_http RemoteZipFile extract path traversal vulnerability
VisiData's custom HTTP zip reader extracts entries using the raw filename from the archive without sanitising path traversal sequences. An attacker who serves a crafted zip and persuades a user to extract it can write arbitrary files outside the intended directory.
Originally disclosed on Cisco Talos
A path traversal vulnerability exists in the unziphttp RemoteZipFile extract functionality of VisiData (version(s): dev (commit 38b21f78)). A specially crafted .zip file can lead to arbitrary file write.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
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 custom zip reader joins the extraction path with the raw entry filename using pathlib's '/' operator, which does not strip '..' sequences, and then writes to that unresolved path.
Impact
An attacker could write arbitrary content to any path writable by the victim's user, such as shell initialisation files or SSH authorised keys, but the victim must open the URL and trigger extraction.
What the attacker needed
Victim opens a malicious zip URL; victim triggers extraction
How it was found
- Open a remote URL ending in .zip in VisiData.
- VisiData fetches the zip central directory and lists entries.
- Select entries and press x or gx to extract.
- The raw filename is joined to the extraction path and written without sanitisation.
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 you open a zip file, each entry has a name. Some names can contain '..' which means 'go up one folder'. VisiData used these names directly when saving files, so a malicious zip could make it save files outside the folder you expected, potentially overwriting important files.
What is Path traversal?
Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.