Repository navigation
feat(core)!: report ZIP entries whose xl extra field gives another file type than the central attributes - #689
Merged
Merged
Conversation
…le type than the central attributes A local or central xl (0x6c78) extra field overrides the entry type for libarchive readers, so an entry listed as a regular file could be written as a symlink or directory by a reader that honours the field. verify, list and extract now reject such archives under Enforce with ZipInconsistency::XlTypeDivergence, derived with the reader's own precedence (local over central) and final-name rules. BREAKING CHANGE: ZIP archives carrying an xl extra whose type differs from the central attributes are rejected under Enforce.
This was referenced Oct 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
libarchive honours the `xl` (0x6c78) extra field of a local header, and of a central record when it reads from a seekable file. Such a field can turn an entry that the central directory lists as a regular file into a symlink or a directory, so `verify` passed archives that `bsdtar` extracts differently.
`verify`, `list` and `extract` now reject these archives under `Enforce` with `ZipInconsistency::XlTypeDivergence` (category `HiddenEntry`):
Live checks with bsdtar 3.5.3 on a file and on a real pipe: a local `xl` symlink is applied by both readers, a central `xl` link or directory only by the file reader. All three are rejected. The 21-archive ZIP corpus and real symlink archives still pass. Measured cost on a 10000-entry archive: list +1.6%, verify +2.8%.
`skills/exarch-cli/SKILL.md` and spec 017 are updated.
Closes #686