Repository navigation
Tags
Tags
Validate local header filename against central directory name (#78) Every ZIP entry is described twice: in the central directory and in the local file header that precedes the file data. A crafted archive can name a different member in the two places, so tools that read the local header disagree with tools that read the central directory about what the archive contains ("zip confusion"). This matters for wheel and supply-chain inspection even though zipwire never writes files. Like CPython's zipfile.ZipFile.open(), the raw local filename bytes are now compared against the central directory name encoded with the central directory's UTF-8 flag when an entry is resolved, raising BadZipFile on a mismatch. The check covers the sync and async readers and the wheel tail fast path. To make the name available for the check: - parse_local_file_header() extracts the raw filename bytes when the buffer contains them (LocalHeaderInfo.filename, None otherwise). - The large-file header fetch now includes the PREFETCH_EXTRA allowance so it normally covers the filename; a filename longer than the allowance is fetched with one extra bounded range request after the data region is validated. - The wheel tail fast path falls back to the regular resolve path when a cached member's actual header lengths exceed the tail coverage instead of slicing short data. As a side effect, a shared local header referenced under two different names is now rejected like zipfile does; the overlap warning remains for duplicate same-named entries. Signed-off-by: Christian Heimes <christian@python.org> Co-authored-by: Claude Code <noreply@anthropic.com>
Bump actions/checkout from 7.0.0 to 7.0.1 (#31) Bumps [actions/checkout](https://github.com/actions/checkout) from 7.0.0 to 7.0.1. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](actions/checkout@9c091bb...3d3c42e) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: 7.0.1 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Christian Heimes <christian@python.org>
Add SyncRemoteWheel and AsyncRemoteWheel subclasses (#29) Subclasses of SyncRemoteZip / AsyncRemoteZip that parse the wheel URL to derive the dist-info directory, fetch an adaptive tail (at least 128 KiB, scaling to ~0.4% of the archive for large wheels), and override _resolve_entry() to serve data from the tail buffer without extra HTTP requests. Also adds _tail_read_size() hook and tuple return to _ensure_loaded() in the base classes. Signed-off-by: Christian Heimes <christian@python.org> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>