zip
Affected
- introduced
7.2.0, fixed9.0.0(semver)
Fixed versions
9.0.0
Fix
- Fixed version
9.0.0cargo update -p zip --precise 9.0.0
Advisory
Also known as: CVE-2026-115908, GHSA-hjqx-j4rw-g7xv
ZipArchive::extract can write outside the destination through absolute or chained symlink targets
Before writing an entry whose path goes through a symlink, ZipArchive::extract checks the symlink's target against the destination directory. That check compares the paths as text and does not follow symlinks, and from 7.2.0 it drops the root and prefix of an absolute target before comparing. Symlinks taken from the archive were created without any check of their targets.
A crafted archive can first create a symlink that points outside the destination, then a second symlink whose target looks like a path inside the destination but goes through the first one, and then a file entry under the second symlink. The file is written outside the destination directory, for example over an existing file in the user's home directory, and extract still returns Ok(()). On Windows, a target on another drive or share whose path otherwise matches the destination passes the check directly (creating symlinks there needs Developer Mode or administrator rights). The attacker has to know or guess the absolute path of the destination directory.
This affects ZipArchive::extract and ZipArchive::extract_unwrapped_root_dir.
The fix resolves symlink targets one component at a time from the canonicalized destination, following symlinks on the way, and refuses to create a symlink, or write through one, that leads outside the destination.
High Basis: CVSS v3 score 7.4, vector CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:H
7.2.0, fixed 9.0.0 (semver)9.0.0
9.0.0cargo update -p zip --precise 9.0.0Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.
Check your own computer: guard packages check
Source: RustSec Advisory Database · CC0-1.0