Loading...
Skip to main content

CVE-2025-29787 — Vulnerability in zip — CVE Details

HIGH

zip Incorrectly Canonicalizes Paths during Archive Extraction Leading to Arbitrary File Write

Published March 17, 2025Updated September 10, 2026Source: osv

Summary

### 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](https://github.com/snyk/zip-slip-vulnerability) 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

Advisory Timeline

  • First published March 17, 2025 (574 days ago).
  • Last revised September 10, 2026 — 541 days after initial publication.

Remediation

Upgrade to the fixed version using your package manager.

Cargo
Update zip to 2.3.0 or later
cargo update -p zip --precise 2.3.0

After upgrading, run your dependency scanner again to confirm the vulnerability is resolved.

Affected Packages (1)

Affects 1 ecosystem: crates.io (1).

PackageEcosystemAffectedFixed In
zip
crates.io
All versions2.3.0

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 8.5 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
High
Privileges Required
Low
User Interaction
None
Scope
—
Confidentiality
—
Integrity
—
Availability
—

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

Frequently Asked Questions

What is CVE-2025-29787?
zip Incorrectly Canonicalizes Paths during Archive Extraction Leading to Arbitrary File Write This vulnerability has been assigned a severity rating of HIGH (CVSS score: 8.5/10).
How do I check if my project is affected by CVE-2025-29787?
CVE-2025-29787 affects zip. Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2025-29787 and 200,000+ other known vulnerabilities.

Severity & Exploitability

CVSS Score
8.5

High exploitability or significant impact. Prioritize remediation within days.

Also Known As

GHSA-94vh-gphv-8pm8
RUSTSEC-2025-0168

Related CVEs

  • CVE-2026-93657
    HIGH

    hickory-resolver: Resolver::lookup() and Resolver::lookup_ip() APIs obscure DNSSEC validation failures

  • CVE-2026-18140
    HIGH

    aws-smithy-json: Uncontrolled recursion in the aws-smithy-json unknown-key skip path allows unauthenticated remote denial of service in smithy-rs generated servers

Check if you're affected

Scan your dependencies to see if this vulnerability affects your projects.

Scan Your Dependencies