VisiData VisiData EmailSheet extract_parts path traversal vulnerability
VisiData's EmailSheet attachment extraction used the filename from an email part's Content-Disposition header without sanitising it, so a crafted .eml file could write files outside the chosen destination directory. An attacker who gets a victim to open the email and bulk-extract attachments could overwrite files the user can write, such as shell startup files or SSH authorised keys.
Originally disclosed on Cisco Talos
A path traversal vulnerability exists in the EmailSheet extractparts functionality of VisiData (version(s): dev (commit 38b21f78)). A specially crafted .eml 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 attachment filename from the Content-Disposition header was joined to the destination path without sanitising path traversal sequences, and pathlib does not strip them.
Impact
An attacker could write arbitrary files to any location writable by the running user, but only if the victim opens the email and extracts its attachments.
What the attacker needed
Victim opens a malicious .eml file; victim bulk-extracts attachments; attacker can deliver an email file
How it was found
- Open a crafted .eml file in VisiData so its MIME parts are listed as rows.
- Select the parts and trigger bulk extraction with the gx command.
- Choose a destination directory when prompted.
- The part whose filename contains traversal sequences is written outside that 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 you save an attachment from an email, the program builds a file path from the attachment's name. If that name contains '..' sequences, the path can point outside the folder you picked, so the file lands somewhere else on disk. Here the email viewer never cleaned the name, letting a malicious email drop files into sensitive locations.
What is Path traversal?
Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.