CVE-2025-29787: zip Vulnerable to Incorrect Path Canonicalization During Archive Extraction, Leading to Arbitrary File Write

Published Mar 17, 2025
·
Updated

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::enclosedname." ... > [::zip::read::FileOptions::enclosedname] ... 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

Other sources

zip is a zip library for rust which supports reading and writing of simple ZIP files. In the archive extraction routine of affected versions of the zip crate starting with version 1.3.0 and prior to version 2.3.0, 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. 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. Version 2.3.0 fixes the issue.

MITRE

Affected Software

2 affected componentsFixes available
rust-lang zip>=1.3.0, <2.3.0
rust/zip>=1.3.0<2.3.0
2.3.0

Event History

Mar 17, 2025
CVE Published
via MITRE·01:19 PM
Data Sourced
via MITRE·01:19 PM
DescriptionWeakness
Data Sourced
via NVD·02:15 PM
DescriptionSeverityWeakness
Advisory Published
via GitHub·09:26 PM
Aug 18, 57211
Event
via FIRST·11:34 AM
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2025-29787?

CVE-2025-29787 has been classified as high severity due to its potential exploitation risks.

2

How do I fix CVE-2025-29787?

To fix CVE-2025-29787, upgrade the `zip` crate to version 2.3.0 or later.

3

What versions of the `zip` crate are affected by CVE-2025-29787?

CVE-2025-29787 affects `zip` crate versions starting from 1.3.0 up to, but not including, 2.3.0.

4

What impact does CVE-2025-29787 have on systems?

CVE-2025-29787 can lead to unauthorized access to files through symbolic link exploitation.

5

Is there a workaround for CVE-2025-29787 before upgrading?

There are no known effective workarounds for CVE-2025-29787 besides upgrading to a secure version.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203