Repository navigation
fix(deps): bump zip 2.4.2 -> >=9.0.5 for zip2 CVEs (pre_seed) #1579
Description
Description
openab-core depends on the zip crate (zip-rs/zip2) 2.x, locked at 2.4.2 in Cargo.lock. A recent advisory covers zip up to and including 9.0.4, with the fix in 9.0.5. It lists four CVEs: CVE-2026-115905, CVE-2026-115907, CVE-2026-115908 and CVE-2026-115909.
Where it's used:
crates/openab-core/Cargo.toml:44haszip = { version = "2", default-features = false, features = ["deflate"], optional = true }.- The dependency is only enabled by the
pre-seedfeature (pre-seed = [..., "dep:zip", ...]), which arrived in feat: add pre_seed phase — S3 zip download before pre_boot #1189. - The only call site is
crates/openab-core/src/pre_seed.rs.extract_zip_budgetedrunszip::ZipArchive::newon the archive bytes downloaded from S3, then iteratesby_index, callingenclosed_name()andstd::io::copyfor each entry.
Exposure (my reading, not verified against the advisory's PoCs):
- Symlink escape (-115908): probably low.
pre_seeddoesn't callZipArchive::extractand only writes regular files and directories throughenclosed_name(). - Stream reader (-115905): not applicable. No
ZipStreamReader/read_zipfile_from_streamusage. - ZIP64 DoS (-115907 / -115909): plausibly applicable. The issues are in central-directory parsing, which
ZipArchive::newdoes on the downloaded bytes before any of the existing entry-count, size and deadline limits run.
The archive source is operator-configured S3, so an attacker would need write access to the bucket. Even so, a vulnerable parser on startup input is worth fixing.
Steps to Reproduce
- On
main, check the resolved version:grep -A1 'name = "zip"' Cargo.lockshowsversion = "2.4.2". Alternatively, runcargo tree -p openab-core --features pre-seed -i zip. - Run
cargo audit(or check the zip-rs/zip2 advisory).zip 2.4.2falls in the affected range (<= 9.0.4). - Runtime path: build with
--features pre-seed, configure ahooks.pre_seedlayer that points at an S3 object, and start openab. The downloaded bytes go straight tozip::ZipArchive::newinextract_zip_budgeted. A crafted ZIP64 archive at that location reaches the affected parsing code.
Expected Behavior
openab-coreresolveszip >= 9.0.5, for examplezip = { version = "9.1.2", default-features = false, features = ["deflate"], optional = true }pluscargo update -p zip.cargo auditreports none of the four CVEs.pre_seedzip extraction behaves the same as today.cargo check,cargo test -p openab-core --features pre-seedandcargo clippy --all-targets -- -D warningspass.
Environment
- openab
main@d59f7de2cc zip2.4.2 (resolved), only behind thepre-seedfeature
Notes on the fix
This is a major jump from 2.x. The APIs pre_seed.rs uses (ZipArchive::new, by_index, enclosed_name, is_dir, size, unix_mode) still exist in 9.x, but CI needs to confirm the build. zip 9.x needs Rust >= 1.88, and the rust:1-bookworm builder images should satisfy that.
Activity
fix(deps): bump zip 2.4.2 -> 9.1.2 for zip2 CVEs
fix(deps): bump zip 2.4.2 -> 9.1.2 for zip2 CVEs (openabdev#1580)