Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): update rust crate zip to v2.3.0 [security] #2573

Merged
merged 1 commit into from
Mar 18, 2025

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Mar 18, 2025

This PR contains the following updates:

Package Type Update Change
zip build-dependencies minor 2.2.3 -> 2.3.0

GitHub Vulnerability Alerts

CVE-2025-29787

Summary

In the archive extraction routine of affected versions of the zip crate, symbolic links earlier in the archive are allowed to be used for later files in the archive without validation of the final canonicalized path, allowing maliciously crafted archives to overwrite arbitrary files in the file system when extracted.

Details

This is a variant of the zip-slip vulnerability, we can make the extraction logic step outside of the target directory by creating a symlink to the parent directory and then extracting further files through that symlink.

The documentation of the [::zip::read::ZipArchive::extract] method is in my opinion implying this should not happen:

"Paths are sanitized with ZipFile::enclosed_name." ...
[::zip::read::FileOptions::enclosed_name] ... is resistant to path-based exploits ... can’t resolve to a path outside the current directory.

Most archive software either decline to extract symlinks that traverse out of the directory or defer creation of symlinks after all files have been created to prevent unexpected behavior when later entries depend on earlier symbolic link entries.

PoC

https://gist.github.com/eternal-flame-AD/bf71ef4f6828e741eb12ce7fd47b7b85

Impact

Users who extract untrusted archive files using the following high-level API method may be affected and critical files on the system may be overwritten with arbitrary file permissions, which can potentially lead to code execution.

  • zip::unstable::stream::ZipStreamReader::extract
  • zip::read::ZipArchive::extract

Release Notes

zip-rs/zip2 (zip)

v2.3.0

Compare Source

🚀 Features
  • Add support for NTFS extra field (#​279)
🐛 Bug Fixes
  • (test) Conditionalize a zip64 doctest (#​308)
  • fix failing tests, remove symlink loop check
  • Canonicalize output path to avoid false negatives
  • Symlink handling in stream extraction
  • Canonicalize output paths and symlink targets, and ensure they descend from the destination
⚙️ Miscellaneous Tasks
  • Fix clippy and cargo fmt warnings (#​310)

Configuration

📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@HTGAzureX1212 HTGAzureX1212 merged commit 7d8eca9 into nightly Mar 18, 2025
3 of 4 checks passed
@HTGAzureX1212 HTGAzureX1212 deleted the renovate/crate-zip-vulnerability branch March 18, 2025 11:24
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