*Zip Slip Vulnerability*
A file upload feature extracted zip archives without checking the paths inside them, so an archive entry could escape the uploads folder. An attacker could overwrite files outside the intended directory, including the site's homepage, by using a traversal path in the archive.
Published on infosecwriteups.com
The Zip Slip vulnerability revolves around the unsafe extraction of compressed files within applications. It occurs when software mishandles paths embedded within zipped archives during extraction.
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 write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the extraction code joined archive entry names to the destination folder without rejecting paths that climb out with '..' sequences.
Impact
An attacker could write files outside the uploads folder, potentially overwriting the site's homepage or other files, though the author notes that writing to the root without knowing the project layout could fail.
What the attacker needed
Access to the file upload feature; ability to upload a zip archive
The fix
The extraction code should validate each archive entry's resolved path and reject any that fall outside the intended destination folder.
How it was found
- Open the file upload form on the site.
- Create a normal zip file and upload it to confirm the feature works.
- Build a zip containing a file whose path climbs out of the uploads folder toward the project root.
- Upload the crafted zip.
- Observe that the site's homepage has been replaced.
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 write-up has not been written yet. The Original tab links to the source.
A zip file is a container holding other files, and each file inside has a name that can include folder paths. This site unzipped uploaded archives without checking those names, so a crafted archive could write a file into a folder it should never reach, such as the website's main page. That lets someone replace or plant files on the server.
What is Path traversal?
Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.