zip-archive · shipping · also ZIP file

ZIP archive

A ZIP archive is a container of individually described entries whose local headers and payloads are indexed by a central directory.

Related Observatory article: Read on hesela.com

ZIP stores per-entry metadata and supports stored or compressed payloads. The local header and central-directory entry contain CRC and size fields; interpreting a listed entry is distinct from reading and checking its payload. [1]

A filename need not identify a unique entry. The Python API accepts a ZipInfo object to select a particular occurrence. A name-keyed inventory can collapse repeated names, changing which bytes are validated or recovered. [2]

On the tested CPython 3.12.3 build, testzip() reopened entries by name and missed a damaged earlier duplicate. Explicit ZipInfo reads detected the CRC error. Six controlled fixtures also showed that the zipfile testing CLI could report corruption while returning exit status 0. These are version-specific observations, not a ZIP format guarantee. [3] [4]

Restoration needs an explicit member-selection rule, complete payload checks and an independent expectation of the intended contents. Retain validation errors separately from process completion and rerun damaged-input controls after changing the reader. [4]

Extraction failure: in 36 designed ZIP_STORED cases on one recorded CPython 3.12.3 POSIX build, CRC rejection left a preexisting target empty or partly overwritten. A local-header filename rejection preserved that target's bytes, but earlier completed members remained. BadZipFile alone did not describe the output state. [5]

Isolated extraction preserved the original byte/name inventory because it never wrote there. No staging result, including a clean control, was promoted. This demonstrates isolation, not atomic or crash-safe publication. [5]

Relations

related
Archive member, Backup manifest, Checksum, Restore test, Flexible Image Transport System (FITS), NumPy NPZ archive

Citations

  1. PKWARE ZIP APPNOTE: local headers, central directory and CRC fields, sections 4.3.7 and 4.3.12 (accessed 2026-10-18)
  2. Python 3.12 zipfile: ZipInfo selection, testzip and command-line testing (accessed 2026-10-18)
  3. CPython issue 156539: testzip skips earlier duplicate members (reported August 2026) (accessed 2026-10-18)
  4. Hesela: controlled ZIP entry-identity and CLI-status observations (accessed 2026-10-18)
  5. Hesela: CPython 3.12.3 extraction failure states, original captures and reproducibility packet (accessed 2026-11-29)
Sources & caveats
  • PKWARE APPNOTE sections 4.3.7 and 4.3.12; Python 3.12 API documentation and pinned CPython v3.12.3 implementation.
  • CPython issue 156539 predates this reproduction; linked upstream PR 156540 was open when checked on 2026-10-18. No claim of a new defect or all-release coverage.
  • Reproduction: https://hesela.dev/research/zip-validation-identity.py ; data: https://hesela.dev/research/zip-validation-identity.json
  • Six synthetic ZIP_STORED fixtures with two 13-byte entries each. No compression, encryption, ZIP64, extraction or adversarial-archive testing.
  • ZIP extraction supplement: 36 deliberately constructed cases, three matching same-host captures; byte/name inventories only. No incident-rate, independent-replication, compression, hostile-path, metadata or crash claim. [5]

JSON: /data/terms/zip-archive.json

Published by Hesela team · Updated

Report a correction · Editorial standards · Reuse guidance

Cite this page
Hesela team. ZIP archive. Hesela. 2026-11-29. https://hesela.dev/terms/zip-archive/