Repository navigation
chore(deps): move ant-core to zip 9 for three RustSec advisories - #233
Conversation
dirvine
left a comment
There was a problem hiding this comment.
Review: APPROVE — no evidenced new blocking defect
Reviewed WithAutonomi/ant-client #233 at a24f496880e048cd02b3b1cbbc234d9c5d3c4010 against e47ea7a7803e8c1947b0b254f1d38e5cdd950198. All four changed files are covered. No unresolved material dissent.
Panel: 6/6 substantive reviews, 3/3 named models. GLM 5.3 (z-ai/glm-5.3, OpenRouter), local Qwen 3.8 (qwen38-27b) and local DS4 Flash (deepseek-v4-flash) each completed an independent correctness pass and an adversarial security/platform pass. All six recommend approval. This is three models in two roles, not six-model diversity.
Checked
ant-core/Cargo.toml:55–57: zip 9.0.5 resolves withdefault-features = falseanddeflate-flate2. The direct flate2 dependency supplies the backend. The locked default CLI graph uses zip 9 only; browser-wasm has no zip dependency.extract_zip: production extraction is unchanged and compiles against zip 9. Its manualby_index/enclosed_name/copy path does not invoke theextract()/stream-extract APIs implicated by RUSTSEC-2026-0367, -0368 and -0369. New tests exercise subdirectory binaries, bootstrap peers, missing binaries and traversal rejection.- The lock delta adds zip 9.0.5 and typed-path 0.12.3. It retains zip 2.4.2 through ant-node 0.23.0 in dev/devnet graphs. The checksum-verified published ant-node source also uses manual entry extraction, not the affected extract APIs.
- The archive probes used the real production extractor on two downloaded Windows release archives. All archive entries were Stored/Deflate. Extracted binary/bootstrap SHA-256 values matched an independent Python decoder. Separate mode probes confirmed that archive mode
06755becomes0755on Unix.
Executed verification
Local runtime: macOS 26.4, rustc 1.96.0.
cargo fmt --all -- --check: passed.cargo check --locked -p ant-cli: passed.cargo test --locked -p ant-core --lib -- --test-threads=4: 846 passed, 0 failed, including the four new tests.- Temporary review-only integration target: 4 passed, 0 failed. The target was removed after execution; the checkout is clean. These are separate from the 846 repository tests.
- Locked CLI graphs resolved for macOS and
x86_64-pc-windows-msvc; browser-wasm and the inverse zip-2 devnet graph were inspected. - Audit with the PR's policy: exit 0. With only the three new ignores removed: exit 1 with exactly those three zip-2 advisories. This is a policy pass, not a vulnerability-free lockfile.
- GitHub read-back immediately before submission: 18/18 checks successful on this exact head, including Security Audit, Third-party notices, Browser WASM, E2E and Merkle E2E. Base/head are unchanged and GitHub reports clean mergeability.
Non-blocking limits and follow-up
- The three new audit ignores are workspace-wide. Keep the removal condition in the CI comment (V2-1633): remove them when ant-node upgrades, and reassess them if its extraction path or the release feature graph changes. They do not patch zip 2.4.2 itself.
- Decoder support is now Stored/Deflate rather than every default zip codec. Keep release ZIP packaging compatible; current inspected artifacts satisfy this requirement.
- No Windows build/runtime test or old-toolchain build was executed locally. The Windows result above is graph resolution plus extraction of Windows archives on macOS, not Windows execution. CI has no Windows job. zip 9 requires Rust 1.88; this review used 1.96.
Panel evidence and all six receipts were retained locally. Secondary reviewer platform claims were checked against upstream metadata: zip's nix dependency is gated to macOS/BSD, not Windows. No material finding remains unresolved.
Formal review submitted at Nic's request. This does not merge, release or deploy the PR.
RUSTSEC-2026-0367, -0368 and -0369 cover `extract()` in zip < 9; the 2.x line has no fix. ant-core never calls `extract()` (extract_zip reads entries one by one through enclosed_name), so none of them is reachable, but the audit fails on every pull request and on downstream lockfiles such as antd's. ant-core now uses zip 9 with Deflate support only: every ant and ant-node release .zip is Deflate, and flate2 keeps the miniz_oxide backend it already had. The other codecs drop out of the `ant` build, along with the bundled C of bzip2-sys, lzma-sys and zstd-sys. ant-node 0.23.1 already uses zip 9, so this removes zip 2.4.2 from Cargo.lock entirely and the audit needs no new ignores. extract_zip had no tests; add four that mirror the extract_tar_gz ones. Closes V2-1632 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
a24f496 to
7d47fbb
Compare
Linear issue
Closes V2-1632
Risk tier
Proposed, not asserted. zip sits under two client-side paths:
ant updateself-update andant node addbinary install. Both read Windows release archives throughextract_zip. That function's source is unchanged here; only the library under it moves, from 2.x to 9.x. Both paths were exercised against the real releases (see Test evidence). No node, protocol or payment code changes.Compatibility
extract_ziptakes bytes and returnsExtractionResult, and zip errors are carried as strings. One behaviour narrows. ant-core's zip now reads Deflate and Stored entries only, so an archive using bzip2, LZMA, Zstandard, Deflate64, PPMd or AES would fail to open. Every current release archive is Deflate:ant-0.3.11-x86_64-pc-windows-msvc.zipand ant-node v0.23.0'sant-node-cli-windows-x64.zipwere checked entry by entry, andant-cli-release.ymlbuilds archives with7z a, whose .zip default is Deflate.Semver impact
zip's major version changes, but no zip type appears in ant-core's public API.
Test evidence
Rebased 2026-10-23 onto
mainat50bc653(0.3.12 promoted).mainnow has ant-node 0.23.1, which already uses zip 9 (V2-1633). So with ant-core moved too, zip 2.4.2 leaves Cargo.lock entirely, and the threeci.ymlignores this PR first added are dropped. The only conflict was Cargo.lock: it was re-resolved frommain's, and the diff is exactly the removal of zip 2.4.2 and its codec tree. Re-run on Linux (dev2, stable):cargo auditwithmain's ignore list: RUSTSEC-2026-0367, -0368 and -0369 are gone. It still exits non-zero on RUSTSEC-2026-0382 and -0383 (rustls-webpki 0.103.15, webpki-root-certs 1.0.7), which chore(deps): move rustls-webpki to 0.103.16 and webpki-root-certs to 1.0.10 for two RustSec advisories #236 fixes. The audit goes green once both have merged.cargo fmt --all -- --checkandcargo clippy --all-targets --all-features -- -D warnings: pass.cargo test -p ant-core --lib node::binary: 20 passed, including the fourextract_ziptests.Original evidence, run on Windows 11 with Rust 1.97.1, one commit on top of
mainate47ea7a:cargo auditwith this PR's original ignore list: exit 0, with only the 8 warningsmainhad then.cargo fmt --all -- --check,cargo clippy --all-targets --all-features -- -D warningsandcargo doc --all-features --no-deps: all pass.cargo test --lib --all: 838 passed. That's 834 before plus the four newextract_ziptests:<name>.exe;bootstrap_peers.tomlextracted;../entry skipped.unit_self_encrypt16 passed (2 ignored);merkle_unit8 passed;daemon_integration6 passed andnode_add_integration3 passed (--test-threads=1).cargo checkandcargo clippy -D warningsfor-p ant-core --target wasm32-unknown-unknown --no-default-features --features browser-wasmboth pass. zip is behindnative.cargo build --release -p ant-clipasses.zip9.0.5 is MIT andtyped-path0.12.3 is MIT OR Apache-2.0.[native.bzip2-sys],[native.lzma-sys]and[native.zstd-sys]are now reported unused, because those C libraries reached theantbuild only through zip's default codecs.flate2features in theantbuild are unchanged frommain(default,rust_backend,miniz_oxide,any_impl). zip 9's owndeflatefeature would have switched every flate2 user to thezlib-rsbackend, so this PR usesdeflate-flate2instead.ant.exebuilt from this branch withAPPDATApointed at an empty scratch directory, so no real registry or install was touched:ant node add --version 0.23.0downloadedant-node-cli-windows-x64.zipfrom the v0.23.0 release and extractedant-node.exeandbootstrap_peers.toml. Both are byte-identical to the archive entries (SHA-25631b6d670…and9953eda7…), and the extracted binary reported version 0.23.0.ant update --forceran from a throwaway copy of the built binary. It downloadedant-0.3.11-x86_64-pc-windows-msvc.zip, verified its ML-DSA signature, extracted it and replaced itself. The result is byte-identical to the releasedant.exe(SHA-256a7e53b87…).New dependency
None new to the shipped binary beyond the version move.
zipgoes from 2.4.2 to 9.0.5 for ant-core, with default features off anddeflate-flate2on.zip9.0.5 andtyped-pathare already in Cargo.lock through ant-node 0.23.1. Cargo.lock loseszip2.4.2 and its codec dependencies:bzip2/bzip2-sys,xz2/lzma-sys,lzma-rs,zstd/zstd-safe/zstd-sys,zopfli,deflate64,arbitraryand an olderconstant_time_eq.ADR
n/a, Tier 1.
Mitigation / rollback
Revert the commit. That restores zip 2 and the three advisories, with nothing to migrate.
What this is
Three advisories published 2026-10-09/10 cover zip 2.4.2. All are fixed only in zip >= 9.0.0, and the 2.x line ends unpatched:
extract()applies Unix permissions through symlinks.extract()preserves SUID/SGID bits.extract()creates symlinks that escape the destination.Not reachable. ant-core's only zip use is
node::binary::extract_zip, which opens the archive withZipArchive::new, walks it withby_index, filters withenclosed_name(), copies the one matching file withstd::io::copyand sets 0o755 itself. It never callsextract()orZipStreamReader. Those three APIs are unchanged in zip 9, so the source needs no change.Why bump anyway. The Security Audit job fails on every ant-client pull request right now on these three IDs alone, and downstream lockfiles inherit zip 2 from ant-core. ant-sdk's antd is carrying a reasoned ignore (ant-sdk#372) until it can repin to an ant-client release with this change (V2-1634).
No audit ignores needed now. When this PR was opened, zip 2.4.2 also came in through ant-node 0.23.0, so it added three
ci.ymlignores pending V2-1633. ant-node 0.23.1, now onmain, uses zip 9, so after the rebase nothing in the lockfile pulls zip 2 and the ignores are gone. antd's lockfile has no ant-node, so the bump alone clears antd once released.Deflate only. zip 9's default features add aes 0.9, sha2 0.11, bzip2 0.6 with
libbz2-rs-sys, lzma-rust2, ppmd-rust, zstd 0.14, zopfli and zlib-rs.libbz2-rs-sysis licensedbzip2-1.0.6, which the notices policy doesn't allow, so the notices job would fail. None of those codecs is used by a release archive, so ant-core turns them off. In theantbuild this also removes the bundled C of bzip2-sys, lzma-sys and zstd-sys.zip 9's MSRV is 1.88; the workspace declares no
rust-versionand CI uses stable.🤖 Generated with Claude Code