๐Ÿ—œ๏ธ Archive Security

How to Create & Extract ZIP Archives Safely: Avoiding Zip Slip Exploits

ZIP files are the foundation of digital archiving and data bundling, but unpacking unfamiliar archives can expose your system to critical path traversal attacks. Learn how ZIP binary structures work and why in-browser extraction provides a security advantage.

โฑ๏ธ 6 min read ๐Ÿ“… Updated October 2026 ๐ŸŽฏ Advanced

The Internal Architecture of a ZIP File

Standardized by Phil Katz in 1989 (the PKZIP format), a ZIP archive is composed of three consecutive sections:

  1. Local File Entries: Each stored file begins with a Local File Header (signature 0x04034b50), containing file metadata, followed immediately by the compressed DEFLATE byte payload.
  2. The Central Directory: Positioned near the end of the file, this catalog lists every single file in the archive, its byte offset, uncompressed size, CRC32 checksum, and directory path.
  3. End of Central Directory Record (EOCD): A 22-byte structure (signature 0x06054b50) that marks where the central directory starts and records the total number of files.

The Major Vulnerability: "Zip Slip" (Path Traversal)

When you create an archive containing a file inside a subfolder, the file name entry inside the Central Directory is stored as a relative string (e.g., documents/contract.pdf).

A malicious actor can craft a weaponized ZIP file where the file name contains parent directory navigation tokens:

โš ๏ธ Malicious ZIP Path Traversal Example

../../../../../../Windows/System32/evil.dll
../../../../../../home/user/.bashrc

If an unpatched desktop extraction tool or server script extracts this archive without sanitizing the path, the file writes outside the designated target folder and overwrites critical operating system files or executable startup scripts. This vulnerability is formally tracked as Zip Slip.

How FileWorks Enforces Anti-Zip-Slip Protection

FileWorks executes all extraction in the browser via JSZip, and strictly validates every archive entry before exposing it to the user via FileToolsLib._validateZipPath:

  • Leading Slash Rejection: Any path starting with / or \ is blocked immediately.
  • Dot-Dot Token Rejection: The path is split by directory separators. If any segment matches .., an immediate security exception is thrown.
  • Absolute Drive Letter Rejection: Paths attempting to target Windows drives (e.g. C:\) are rejected.
  • Browser Sandboxing: Furthermore, browser JavaScript does not have direct write access to your computer's filesystem. When you download a file, the browser prompts you through your operating system's standard safe download sandbox.

Step-by-Step: Creating and Extracting ZIPs in FileWorks

Creating an Archive:

  1. Navigate to FileWorks Create ZIP.
  2. Drag and drop up to 10 files (documents, pictures, spreadsheets).
  3. Enter your preferred archive filename (e.g. Project-Assets.zip).
  4. Click Create ZIP Archive. FileWorks applies level 6 DEFLATE compression in memory and serves the bundle instantly.

Extracting an Archive:

  1. Navigate to FileWorks Extract ZIP.
  2. Drop your ZIP archive into the workspace.
  3. Inspect the contents table showing individual file sizes and extensions.
  4. Click Download on any specific file you need, or click Download All.

Manage Archives Safely

Create and extract ZIP archives with built-in path traversal protection.

Create ZIP โ†’ Extract ZIP โ†’

Frequently Asked Questions

Does creating a ZIP archive compress files that are already compressed?
Files that are already compressed (like JPEG photos, MP3 audio, or modern MP4 video) will experience negligible size reduction inside a ZIP because their entropy is already near maximum. Text documents, HTML, CSVs, and raw bitmaps, however, will compress by 50% to 80%.
Can FileWorks open password-protected or AES-encrypted ZIPs?
FileWorks supports standard unencrypted PKZIP archives. Archives protected with proprietary WinRAR encryption or proprietary 256-bit AES ZIP passwords must be decrypted using desktop archive managers.