Zip slip

From zakirkun/ice-tea · View interactive version

Zip slip is an AI agent skill from the GitHub repository zakirkun/ice-tea. Detects insecure ZIP/TAR extraction that does not validate entry paths, allowing directory traversal outside the extraction target.

How to use this skill

Skill file

Zip Slip (Archive Path Traversal)

Overview

Zip Slip is a directory traversal vulnerability in archive extraction. Malicious archives can contain entry names like ../../etc/cron.d/evil or ../webroot/shell.php. When extracted without path validation, files are written outside the intended directory, potentially achieving:

This affects ZIP, TAR, JAR, WAR, and other archive formats.

Detection Strategy

Remediation

Always normalize and validate the target path before writing each archive entry.

Vulnerable (Java):

ZipEntry entry = zipFile.getEntry(name);
File dest = new File(targetDir, entry.getName());
// entry.getName() could be "../../etc/cron.d/evil"

Safe (Java):

File dest = new File(targetDir, entry.getName()).getCanonicalFile();
if (!dest.toPath().startsWith(targetDir.toPath())) {
    throw new IOException("Zip Slip detected: " + entry.getName());
}
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.