Skip to content

fix(deps): move zip to 9.x and pyo3 to 0.29 for security advisories - #100

Merged
MrScripty merged 2 commits into
mainfrom
fix/zip-pyo3-security
Nov 6, 2026
Merged

MrScripty merged 2 commits into
mainfrom
fix/zip-pyo3-security

Conversation

@MrScripty

Copy link
Copy Markdown
Owner

Moves zip to 9.x and pyo3 to 0.29 to clear the open advisories against them. This also unblocks the Pumas-Library guard-interop harness, which vendors this dependency graph and currently carries the same 6 alerts.

Advisories addressed

  • zip < 9.0.5: parser-differential "zip cloaking" (critical), unbounded symlink-target handling (high), and AES entry HMAC bypass on premature EOF (moderate). inference's managed-runtime installer extracts downloaded zip archives with this crate.
  • pyo3 < 0.29: out-of-bounds read in PyList/PyTuple nth/nth_back (high), a missing Sync bound on PyCFunction::new_closure (moderate), and a PyString::from_object overflow (low).

Changes

  • Workspace zip = "9.0.5" (resolves to 9.4.1) and pyo3 = "0.29" (0.29.3). Both support the pinned toolchain: zip needs rustc 1.88, pyo3 needs 1.83.
  • managed_runtime/archive.rs: zip 9 makes ZipFile generic over its reader and name() fallible, so error messages now render the raw entry name lossily and can't fail on an undecodable name. New tests write a real zip, extract it, and reject a ../escape entry.
  • PyTorch backend: the pyo3 0.29 renames Python::with_gil → Python::attach, allow_threads → detach, and Bound::downcast → cast. No behavior change.

Not addressed here

candle-core 0.9.2-alpha.2 still brings its own zip 7.2.0 (and 1.1.4 in the legacy src-tauri/Cargo.lock). Those alerts need a candle release that moves to zip 9.

Verification

  • cargo check --locked --workspace --all-features and --no-default-features pass.
  • cargo clippy -p inference --all-targets is clean.
  • cargo test -p inference --features backend-pytorch --lib backend:: passes 343 tests, including the embedded-Python tests.
  • cargo test -p inference --lib managed_runtime passes 67 tests, including the 2 new zip tests.

🤖 Generated with Claude Code

zip below 9.0.5 is affected by parser-differential ("zip cloaking"),
symlink-target exhaustion and AES HMAC bypass advisories, and the
managed-runtime installer extracts downloaded zip archives with it.
pyo3 below 0.29 has an out-of-bounds read in PyList/PyTuple nth and a
missing Sync bound on closure-backed functions.

zip 9 makes ZipFile generic over its reader and entry names fallible,
so error messages now use the raw name lossily. pyo3 0.29 renames
with_gil to attach, allow_threads to detach and Bound::downcast to
cast. New tests extract a real zip and reject a parent-escaping entry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4ef54706-ddc1-4152-93a3-5c4104fa192e
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MrScripty
MrScripty merged commit cc41a56 into main Nov 6, 2026
24 checks passed
@MrScripty
MrScripty deleted the fix/zip-pyo3-security branch November 6, 2026 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant