Repository navigation
build(deps): move zip off the yanked 2.x line to 9.0.4 - #516
Merged
Merged
Conversation
The zip maintainer yanked every release but 9.0.3/9.0.4 on 2026-10-16 (zip-rs/zip2#1075) over three published advisories in the crate's bulk extractors and issues still to be published. cargo-deny fails on the locked 2.4.2. Lucerna never calls those extractors. - deflate-flate2 + deflate-zopfli instead of 9.x's deflate, which adds the zlib-rs backend: flate2 stays on rust_backend (miniz_oxide), as before. - name() is a Result in 9.x; crate::zip_entry reads every entry name one way (its error is unreachable: CP437 never fails on non-ASCII bytes). - by_name now matches raw bytes: the @mod class scan and the nested-jar reader read a listed entry back by index (test: a CP437 class name). - enclosed_name now makes a rooted name relative; natives extraction keeps skipping rooted entries (the existing test asserts it). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 16, 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.
Why
cargo-denyfails onmainand on every PR:error[yanked]: detected yanked crate (try cargo update -p zip). On 2026-10-16 thezipmaintainer yanked every release on crates.io except 9.0.3 and 9.0.4 (zip-rs/zip2#1075), over three published advisories "and other security issues that will be published later this month":ZipArchive::extractcreates symlinks whose targets are outside the destinationZipStreamReader::extract()/ZipArchive::extract()apply Unix permissions through symlinksWas Lucerna exposed?
No, to the three published ones. All three live in the crate's bulk extractors. Lucerna opens untrusted archives (modpacks, mod jars, data packs, resource packs, Forge installers, world zips, natives) but never calls
ZipArchive::extractorZipStreamReader. Every site reads entries one by one and writes bytes into a regular file it names itself. No entry's Unix mode is ever applied: the onlyunix_mode()read rejects symlink entries, andplatform::set_executablesets a fixed0o755. No symlink is created from an entry.The issues still to be published can't be judged today; moving off a yanked line is the reason on its own. There is no
### Securitychangelog bullet, since nothing a user would have hit is known.cargo-deny justification (major bump of an existing direct dependency)
zip2.4.2 → 9.0.4: every older release is yanked. MIT, MSRV 1.88 (the toolchain is stable 1.96), used only bylucerna.["deflate-flate2", "deflate-zopfli"], not 9.x'sdeflate. That one adds thezlib-rsbackend; these two keep theminiz_oxidebackend Lucerna's ownflate2 = { features = ["rust_backend"] }already brings, as 2.x'sdeflatedid. Default features stay off.typed-path0.12.3 added (MIT OR Apache-2.0, a 9.x dependency);arbitraryandderive_arbitraryremoved. Nothing else moves.cargo tree -i zlib-rsfinds nothing.Migration: behaviour kept, where 9.x moved semantics
ZipFile::name()/file_names()returnZipResult<Cow<str>>. Its only error is CP437 decoding failing on all-ASCII bytes that are not UTF-8, which cannot happen. A newcrate::zip_entryreads every name one way; its fallbacks never run (lossy UTF-8, as 2.x gave a mis-flagged name; a logged skip in a listing). All call sites ported with no change in control flow.by_namematches raw bytes, not the decoded name. A listed entry looked up again by name would miss a non-UTF-8 (CP437) entry. The legacy@Modclass scan and the nested-jar reader now read by index. New testa_class_named_in_cp437_is_read: red on the naive port, green here.enclosed_name()makes a rooted name relative (/abs.dll→abs.dll) where 2.x refused it. Natives extraction skips rooted entries itself, as before. The existing zip-slip test now asserts it: red on the naive port.is_dir;unix_mode(it now clears SUID/SGID/sticky; the file type the symlink check reads is kept);timefeature stays off, and thel10nbyte-stability test pins it);Deflatedat the default level still uses flate2 (zopfli only above level 9; Lucerna sets no level).Test plan
cargo check --all-targetscargo-deny🤖 Generated with Claude Code