Zip Me In: How I Used Archive Bombs and Zip Slip to Write Anywhe
An unauthenticated archive import endpoint extracted ZIP files without validating entry paths, allowing directory traversal (Zip Slip). An attacker could write files to arbitrary locations, including a PHP web shell, leading to remote code execution.
Free Link 🎈
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 archive extraction routine did not sanitise entry paths, allowing directory traversal.
Impact
An attacker could overwrite configuration files, plant backdoors, tamper logs, and achieve remote code execution, potentially compromising the entire server.
What the attacker needed
No authentication required; Endpoint accepts ZIP uploads; No rate limiting
The fix
The issue was fixed by checking for path traversal, rejecting archives with '..' entries, and implementing sandboxed upload processing.
How it was found
- Discover the archive import endpoint via JavaScript files.
- Craft a ZIP archive containing a file with a path traversal name.
- Upload the ZIP to the endpoint.
- Access the written file via its URL to confirm write.
- Replace the file with a PHP web shell and upload again.
- Execute commands through the web shell.
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 can contain file names with '../' sequences that, when extracted, cause files to be written outside the intended folder. Here, the upload feature didn't check these paths, so the attacker could place a malicious script anywhere on the server and then run commands on it.
What is Path traversal?
Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.