Skip to content
Path traversal Write-up Intermediate

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.

iski Follow

Published on infosecwriteups.com

Free Link 🎈

Iski, on infosecwriteups.com

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

  1. Discover the archive import endpoint via JavaScript files.
  2. Craft a ZIP archive containing a file with a path traversal name.
  3. Upload the ZIP to the endpoint.
  4. Access the written file via its URL to confirm write.
  5. Replace the file with a PHP web shell and upload again.
  6. 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.

More by iski

View all

186 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Path traversal and file inclusion

The lesson behind this report.

Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.