Safe ZIP Intake for Untrusted Archives

    1

    A ZIP from a customer, a marketplace, a webhook or another agent is hostile until proven otherwise.

    $29

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+22 more

    Safe ZIP Intake for Untrusted Archives

    Example session with this skill installed

    A customer uploaded plugin-bundle.zip through our portal. Check whether it is safe to unpack into /srv/plugins/incoming and unpack it if so.

    • Read your context and instructions
    • Compiled the safe zip intake

    Summary

    Refused: the archive contains a path-traversal entry and an entry whose declared size does not match its bytes. Nothing was written.

    What the inspection found

    • python -I scripts/safe_zip.py inspect plugin-bundle.zip --json
    • Entry 7: assets/../../etc/cron.d/plugin refused by rule traversal.
    • Entry 12: vendor/blob.bin declared 2.1 MB but inflates to 1.9 GB (ratio 900:1), refused by rule ratio.
    • 31 other entries: names clean, stored or deflated, no symlink or special-file attributes, no case-insensitive collisions, CRCs match.
    • Archive digest (SHA-256) taken through a single open descriptor; inode, size and mtime identical before and after reading.

    Exit

    1 (refused), rule names in the output. The destination directory was left empty and untouched. Ask the sender for a clean bundle or allow-list the digest of a reviewed one with --sha256.

    Tests

    python -I scripts/test_safe_zip.py: 14 passed.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    The standard library's extractall will write ../../.ssh/authorized_keys, follow a symlink entry out of the destination, let readme.md overwrite README.md on a case-insensitive filesystem, and decompress 10 KB into 10 GB. A ZIP from a customer, a marketplace, a webhook or another agent is hostile until proven otherwise.

    safe_zip.py (standard library, Python 3.9+): inspect_bundle checks every entry before a byte is written: .., absolute paths, drive letters, backslashes, NUL, trailing dots and spaces; symlink and special-file entries from external attributes; names that collide under case folding; encrypted entries; compression methods other than stored and deflated; entry count, declared expanded size and per-entry compression ratio caps; CRC. inspect_file hashes and sizes the archive through one open descriptor and compares the inode, size, mtime and link count before and after, so the file you verified is the file you read, and an approved SHA-256 can be required. extract writes only into an existing, empty, link-free directory, with xb (an existing file is an error), counting bytes against both the entry's declared size and the global cap so a lying central directory is caught, and resetting modes to 0600 so nothing arrives executable or setuid.

    CLI: inspect and extract with --sha256, --max-entries, --max-expanded-bytes, --max-bundle-bytes, --max-ratio, --json; exit 0 ok, 1 refused with the rule named, 2 could not run.

    14 offline tests including a hand-patched archive whose central directory lies about sizes. No network. Lifted from a job runner that executes only operator-approved bundles.

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for APIs & Backend.

    ZIP only. Strips executable bits (sets 0600). Windows skips symlink-destination tests. Requires Python 3.9+.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed 19 days ago

    Software
    Python 3.9+

    Uses only the standard library.

    Permissions

    Terminal / Shell
    Read Files
    Write Files

    Shell to run the Python script and tests; read files to inspect the archive; write files only on extract, into an existing empty directory you name. No network access, no environment variables.

    Listed19 days ago

    What's inside

    Frequently Asked Questions

    This skill solves critical security vulnerabilities found in standard library decompression, such as Zip Bombs, path traversal attacks, and symlink exploits that can compromise your host system.

    The skill is designed for Python 3.9+ environments and can be integrated into any AI agent framework that supports custom Python modules, such as LangChain, AutoGPT, or custom-built local agents.

    Yes, the skill includes resource capping features that allow you to set strict limits on the number of files, total expanded size, and maximum compression ratios to prevent denial-of-service attacks.

    You will receive the complete Python source code for the hardened intake module, detailed documentation for programmatic integration, and a CLI wrapper for manual archive inspection.

    The skill is highly portable because it relies exclusively on the Python standard library, requiring no pip installs or external binary dependencies for deployment.

    To maximize security, all extracted files are defaulted to mode 0600 (read/write for owner only) and executable bits are stripped to prevent unauthorized code execution.

    New in APIs & Backend