Repository navigation
build(deps): bump zip from 2.4.2 to 8.6.0 - #231
Conversation
771b2ce to
2e986b5
Compare
Bumps [zip](https://github.com/zip-rs/zip2) from 2.4.2 to 8.6.0. - [Release notes](https://github.com/zip-rs/zip2/releases) - [Changelog](https://github.com/zip-rs/zip2/blob/master/CHANGELOG.md) - [Commits](zip-rs/zip2@v2.4.2...v8.6.0) --- updated-dependencies: - dependency-name: zip dependency-version: 8.6.0 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
2e986b5 to
8bce0b8
Compare
Generated by `cargo xtask manifest` and `cargo xtask tpn` for the dependency change in this pull request. Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
michaelroy-amd
left a comment
There was a problem hiding this comment.
Reviewed at 4cd0b84a2d58692ce205cd50e3372f2c5887d86d. The zip 8.6 APIs used by Lemonade extraction and xtask packaging remain source-compatible, including ZipArchive, ZipWriter, SimpleFileOptions, enclosed_name, and symlink checks. The non-exhaustive ZipFlags change is not used here. New permissive transitive dependencies are reflected in the generated manifests/notices, DCO is green, and all 17 required checks pass on Linux and Windows. The advisory Windows GPU timeout does not exercise zip paths. No blocking finding. Approving.
siloteemu
left a comment
There was a problem hiding this comment.
🔴 Automated review · pr-review-watcher · 4cd0b84
This automation never files a GitHub approval, so no approving review will appear here whatever the outcome — the merge decision stays with a human reviewer.
Summary
Dependabot bumps zip from 2.4.2 to 8.6.0 in engines/lemonade and xtask, with a bot-generated follow-up commit regenerating MANIFEST.md and THIRD_PARTY_NOTICES.txt. The bump is API-compatible with every call site in this tree and the generated files match the lock exactly, but it silently changes two behaviours — the deflate backend and entry-path parsing — and neither is covered by a test. Verified: both manifests bumped, lock has a single zip and no duplicate majors, generated notices match the lock, and all eight zip APIs used here are unchanged at 8.6.0 (checked against the v8.6.0 sources and docs); a local compile check could not be completed, so the one question below could not be settled by running it. Blocking: 1 · Non-blocking: 3.
This head is not recently validated. Its checks last ran four weeks ago against a base branch that has since moved substantially. The single failure is on a hardware end-to-end path that is green on recent base commits and failed in the test-run step itself, so it is not demonstrably caused by this bump — but equally, nothing has validated this head against the current base. A rebase and re-run is the cheapest way to close that gap.
No prompt-injection content was found in the diff, commit messages, or regenerated notices.
What changed upstream
The version-number jump is much larger than the API change. Across the six majors crossed:
- 3.0.0 (2025-05): dropped the already-deprecated
deflate-minizfeature flag. Narrow. - 4.0.0 and 5.0.0: no breaking-change entries at all in the changelog — a Zip64 bugfix plus dependency reverts, and a new
by_path*()method respectively. These read as forced/renumbering majors, not API breaks. - 6.0.0:
FileOptions::add_extra_databecame generic overAsRef<[u8]>. Source-breaking only for callers passing a concrete type. - 7.0.0: removed the
getrandom,hmac,pbkdf2,sha1,zeroizefeature flags and thelzma-static/xz-staticsynonyms. Real, but feature-only. - 8.0.0: removed deprecated
DateTimemethods; migrated to Rust 2024 edition.
So three of the six majors are effectively renumbering, and the three real ones break surfaces this repo does not touch. The core read/write API shape was never rewritten in this window.
What this repository is exposed to. Two manifests declare zip, both default-features = false, features = ["deflate"]: engines/lemonade/Cargo.toml (unconditional) and xtask/Cargo.toml ([target.'cfg(windows)'.dependencies]). The call sites are extract_zip in engines/lemonade/src/lib.rs (read side, ungated — runs on Linux too) and zip_bundle in xtask/src/package.rs (write side, #[cfg(windows)]), plus two zip tests in the lemonade test module. The APIs used are ZipArchive::new, len, by_index, name, is_symlink, enclosed_name, is_dir, unix_mode, ZipWriter::new, SimpleFileOptions::default, compression_method, unix_permissions, start_file, add_symlink, write_all, finish. I checked each against v8.6.0: enclosed_name still returns Option<PathBuf>, unix_mode still Option<u32>, is_file is still documented as "not a directory or symlink" (so extract_zip's comment asserting there is no third entry kind remains correct), and the writer signatures are identical to 2.4.2. ZipFile did gain a reader type parameter, but no call site here names the type. Nothing in this tree touches add_extra_data, DateTime, data_start, or any removed feature flag. No compile-level exposure.
The behavioural exposure is elsewhere, and neither item appears in the changelog:
-
Deflate backend swap. At 2.4.2,
deflateresolved toflate2/rust_backend(miniz_oxide). At 8.6.0 it resolves toflate2/zlib-rs. The lockfile corroborates this independently:flate2gains azlib-rsdependency in this diff. Becauseflate2giveszlib-rsprecedence over miniz_oxide, and Cargo unifies features, this switches the deflate/inflate implementation for everyflate2user in any build graph containingzip— which includesextract_tar_gz'sGzDecoderin the same file, not just the zip path. zlib-rs is pure Rust, so no C toolchain is introduced (nolibz-sys/libz-ng-sysin the lock, andccis pre-existing). Decompression is spec-defined and safe; compressed output bytes and ratio can differ, so a released Windows bundle built after this merge will not be byte-identical to one built before. -
Entry-path parsing. From 7.2.0,
zipparses stored entry names withtyped-path'sUtf8WindowsPath, unconditionally on every OS — I confirmed this in the v8.6.0src/path.rs(nocfggating on the parsing; only the tests are gated). At 2.4.2 the same names were parsed with host-nativestd::pathsemantics. Consequence forextract_zipon Linux: an entry nameda\..\bwas previously oneNormalcomponent and was rejected byarchive_entry_destination's explicit "separators smuggled through a single component" guard; at 8.6.0enclosed_namesplits it intoa,..,band returnsb, which is then accepted and written. Same for aC:\foo\bar.txt-style entry, now returned asfoo/bar.txt. This is a fail-closed → accept change, but it is not a traversal hole:enclosed_namestill returnsNonefor anything that actually escapes (foo/../../bar), andarchive_entry_destinationstill builds the path component-by-component under the destination root, so the result stays contained. The defence-in-depth is intact; what changed is that some hostile-looking-but-contained names are now extracted instead of refused.
MSRV rose from 1.73.0 to 1.88 (at 7.4.0). The workspace pins rust-version = "1.96" and the toolchain file pins 1.96.0, so there is no MSRV problem.
Manifest and lockfile consistency: clean. Both declaring manifests were bumped to "8.6". The lock holds exactly one zip (8.6.0) with no lingering 2.x, adds typed-path 0.12.3 (referenced only by zip) and zlib-rs 0.6.7 (referenced only by flate2), and drops arbitrary/derive_arbitrary, which 8.6.0 no longer pulls in. MANIFEST.md and THIRD_PARTY_NOTICES.txt reflect precisely those five deltas and nothing else. The new Zlib license is already in the generator's accepted list, so the license tripwire is satisfied rather than bypassed. The two adjacent "zlib License" blocks in the notices file are the generator's normal grouping by exact license text (zlib-rs and foldhash carry differently-worded copies), not a duplication bug.
🚫 Blocking (must fix before merge)
engines/lemonade/src/lib.rs:5331 — after this bump, nobody can say whether the zip traversal guard still tests anything, and it stays green either way.
extract_archive_rejects_hostile_zip_entry writes its hostile entry as
start_file("../escaped.txt", options).or_else(|_| writer.start_file("placeholder.txt", options)), then reads the name back and branches on it. If the name round-tripped, it asserts the extraction is refused and nothing escaped — the real guard. If it did not, it takes the other branch, extracts a benign file and asserts only that placeholder.txt exists. That branch asserts nothing about traversal at all, and the test passes green from it, under a name that says the opposite.
Why this is this PR's problem rather than a pre-existing one to wave through: which branch runs is decided by how zip's writer handles an entry name — exactly the component being replaced here. This bump crosses six majors of that crate and, as set out above, changes entry-path parsing to typed-path's Windows semantics on every OS from 7.2.0. So the bump is precisely the kind of change that can flip this test from "guards against directory traversal" to "extracts a file and shrugs", with no signal whatsoever: no failure, no skip, no warning. Neither this review nor a reader of the diff can currently tell which side it lands on, because a compile-and-run check could not be completed here.
This is a security guard on archive extraction, and the failure mode is silent. The fix is small and turns an unknowable into a known: assert that the hostile name actually round-tripped — replace the or_else(...) fallback with an explicit expectation, or assert_eq!(hostile, "../escaped.txt") before the branch — so that if a future zip refuses to emit the name, the test fails loudly and someone writes the entry bytes directly instead of quietly losing the coverage. If the fallback is genuinely wanted, the test needs a different name and a comment saying it does not always test traversal.
Two smaller things in the same block, worth fixing while it is open: the comment above the call says "add_directory/start_file normalize names, so the traversal name is written through the raw entry API a hostile producer would use", but the code calls start_file directly and uses no raw entry API — the comment describes a technique that is not in use, which is how this construct reads as safer than it is. And the follow-on comment ("the tar cases cover the shared validator") is true of the shared validator but not of the zip path's own enclosed_name handling, which is the part this bump changes.
Nothing else here blocks: the bump itself is API-compatible with every call site, the generated files match the lock, and the two behavioural changes below are worth knowing about rather than worth stopping for.
Non-blocking
- No test was added. For a bump that changes the deflate implementation, a round-trip assertion over the affected format — write a normal deflate zip, extract it, assert contents and mode — would have been proportionate, and no such positive zip-extraction test exists today (the two zip tests both assert rejection and never decompress entry data). The new backend is not entirely untested by accident:
extract_archive_writes_a_well_formed_treedoes a realGzEncoder→GzDecoderround trip with a content assertion, and that path now runs through zlib-rs too, which materially lowers the risk. - Nothing covers the changed path-parsing behaviour described above. A single case asserting what
extract_zipnow does with a backslash-bearing entry name on Linux would pin the new semantics rather than leaving them to be discovered. - The write side (
zip_bundle) is Windows-only and so is its end-to-end coverage, which means the new deflate encoder is exercised only on a gated path. Worth confirming that lane actually ran before merge, given the four-week-old checks.
Correction: this blocking objection was wrong, and it is withdrawn. It claimed that the zip traversal-guard test branches on how the zip writer handles a hostile entry name, and that this bump could therefore silently send the test down the fallback branch that asserts nothing. That has now been checked against both crate versions directly: the test reads the raw entry name, and both the writer's acceptance of the traversal name and that accessor's behaviour are unchanged across the two versions, so the traversal-asserting branch runs in both and the guard is still being tested. The path-parsing change described in the original review affects the sanitising accessor, not the raw one the test actually uses. The mistake was ours, and it held this up longer than it should have. The non-blocking observations in that review stand as written and are unaffected.
Signed-off-by: Jussi Elo <jussi.elo@amd.com> # Conflicts: # engines/lemonade/Cargo.toml
Bumps zip from 2.4.2 to 8.6.0.
Release notes
Sourced from zip's releases.
... (truncated)
Changelog
Sourced from zip's changelog.
... (truncated)
Commits
771dfc5chore: release v8.6.0 (#781)8e480ccchore(deps): update sha1 requirement from 0.10 to 0.11 (#767)2513bbechore(deps): update aes requirement from 0.8 to 0.9 (#787)957e240ci(deps): bump actions/cache from 5.0.4 to 5.0.5 (#786)0329d9dfix: allow for[u8]as filename (#775)ddcf854ci(deps): bump github/codeql-action from 4.35.1 to 4.35.2 (#788)42323a8ci(deps): bump actions/create-github-app-token from 3.0.0 to 3.1.1 (#785)901014aci(deps): bump crate-ci/typos from 1.45.0 to 1.45.1 (#784)07702d4feat: addcompression not supportedas enum error (#774)2d0c46bci(deps): bump actions/upload-artifact from 7.0.0 to 7.0.1 (#783)