Vulnerability HighRUSTSEC-2025-0168 · zip
RUSTSEC-2025-0168: Incorrect path canonicalization during Archive Extraction Leading to Arbitrary File Write
Short answerA security vulnerability in the zip crate: Incorrect path canonicalization during Archive Extraction Leading to Arbitrary File Write. GitHub rates it High. Fixed in 2.3.0: update to a fixed version.
| Crate | zip |
|---|---|
| Type | Vulnerability |
| Affected versions | From 1.3.0 before 2.3.0. |
| Fixed in | 2.3.0 |
| Severity | High (GitHub rating) CVSS:4.0/AV:N/AC:H/AT:N/PR:L/UI:N/VC:L/VI:H/VA:N/SC:H/SI:H/SA:H |
| Published | 2025-03-16 |
| Last changed | 2026-10-12 |
| Also known as | CVE-2025-29787, GHSA-94vh-gphv-8pm8 |
| Affected functions | zip::read::ZipArchive::extract, zip::unstable::stream::ZipStreamReader::extract |
What to do
- See which version you have:
cargo tree -i zip(it also shows which of your dependencies pulls it in). - Update within your version requirement:
cargo update -p zip. If the fix is a newer major or minor than your requirement allows, raise it in Cargo.toml (for examplezip = "2.3.0") or update the dependency that pulls it in. - Check again with
cargo audit, or paste your Cargo.lock into our Cargo.toml checker.
Details from the advisory
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.
For more details, see the GitHub-hosted security advisory: <https://github.com/zip-rs/zip2/security/advisories/GHSA-94vh-gphv-8pm8>
References
- Package: crates.io/crates/zip
- Advisory: rustsec.org/advisories/RUSTSEC-2025-0168.html
- Web: github.com/zip-rs/zip2/commit/a2e062f37066c3b12860a32eb1cb44856cfb7afe
From the RustSec Advisory Database (CC0-1.0) via the OSV export, downloaded Oct 24, 2026. Severity score computed from the published CVSS vector.
Other advisories for zip
- Vulnerability HighRUSTSEC-2026-0367 · 2026-10-09 Insecure Preservation of SUID/SGID Bits during ZIP Extraction Leading to Potential Privilege Escalation
- VulnerabilityRUSTSEC-2026-0368 · 2026-10-09zip: `ZipArchive::extract` creates symbolic links whose attacker-controlled targets are outside the destination directory
- Vulnerability CriticalRUSTSEC-2026-0369 · 2026-10-10ZipStreamReader::extract() and ZipArchive::extract() apply Unix permissions through symlinks without confining the target
Up next
Same cratezip: security historyEvery advisory for this crate, and whether it is safe to use today.Read it next →Did this answer your question?