Join our Newsletter — 33% off our NHI Course

Zip Slip

Zip Slip is a path traversal flaw in archive extraction. It happens when an application writes ZIP entries using attacker controlled names without checking where those paths resolve. A malicious archive can escape the target directory and overwrite files elsewhere on the filesystem, sometimes leading to code execution or service compromise.

Expanded Definition

Zip Slip is a path traversal weakness in archive extraction logic, not a flaw in the ZIP format itself. The issue arises when software trusts entry names from a malicious archive and reconstructs filesystem paths without validating whether the final destination stays inside the intended extraction directory. That can allow writes to arbitrary locations, including configuration paths, startup scripts, web roots, or application binaries. The same pattern can affect other archive formats when extraction code fails to normalise and constrain paths.

For security teams, the important distinction is between safe extraction and unsafe file placement. A robust implementation resolves the candidate output path, compares it against the target root, and rejects absolute paths, parent directory segments, and symlink-based escapes. Guidance from NIST Cybersecurity Framework 2.0 supports this kind of defensive validation as part of secure software handling, even though Zip Slip itself is an implementation flaw rather than a named control.

The most common misapplication is assuming that checking for “../” strings alone is sufficient, which occurs when applications fail to canonicalise paths before writing files.

Examples and Use Cases

Implementing archive extraction rigorously often introduces extra validation overhead and compatibility edge cases, requiring organisations to weigh safer file handling against developer convenience and legacy package formats.

  • A deployment pipeline unpacks a release archive into a build directory, but a crafted entry points outside the workspace and overwrites a script used during startup.
  • An email security gateway or document processing service accepts compressed attachments and extracts them automatically, creating a route for attackers to replace files in temporary or persistent directories.
  • A web application unzips user uploads for image processing, and a malicious archive places a file into a web-accessible path that the server later serves or executes.
  • A desktop application imports plugin bundles or project files from a ZIP archive and writes attacker-controlled filenames into a user profile or autoload directory.
  • A CI/CD or container build step extracts third-party packages without path checks, allowing a modified archive to tamper with build artifacts or injected configuration.

Secure extraction patterns are documented broadly in secure coding guidance, and OWASP file handling guidance is useful for understanding how untrusted file content should be constrained before it reaches the filesystem.

Why It Matters for Security Teams

Zip Slip matters because it turns routine file ingestion into a filesystem write primitive, which can become a stepping stone to persistence, privilege escalation, supply chain tampering, or remote code execution depending on what gets overwritten. It is especially relevant where archives are accepted from users, partners, build systems, or automated agents that handle packages without human review. In modern environments, the risk extends beyond classic apps into agentic workflows that ingest files, expand attachments, or process software artifacts on behalf of a broader automation chain.

Security teams should treat archive extraction as a trust boundary and require canonical path validation, allowlist-based destination rules, and rejection of symbolic-link escapes. This aligns with secure development and operational resilience principles reflected in the MITRE CWE path traversal family and the OWASP path traversal guidance. The practical lesson is that the bug often stays invisible until an attacker drops a crafted archive into a normal workflow. Organisations typically encounter unexpected file overwrites only after an archive is processed in production, at which point Zip Slip becomes operationally unavoidable to address.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

OWASP Non-Human Identity Top 10 address the attack and risk surface, while NIST CSF 2.0 and NIST AI RMF set the governance and control requirements practitioners need to meet.

Framework Control / Reference Relevance
NIST CSF 2.0 PR.DS Zip Slip is a software integrity issue that can alter files through unsafe extraction.
OWASP Non-Human Identity Top 10 Archive handling in agentic and automation workflows can impact NHI-managed tools and secrets.
NIST AI RMF AI and agent workflows that unpack files need governance over unsafe tool actions.

Harden file-processing paths used by automation that may touch secrets or service identities.