{"vuln_id":"CVE-2025-29787","aliases":[],"description":"`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.","published_at":"2025-03-17T14:15:22.447000Z","modified_at":"2026-06-17T09:05:40.253000Z","first_seen_at":"2026-11-21T19:15:56.748797Z","severity":"high","severity_source":"nvd","cvss_score":7.3,"cvss_vector":"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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X","cwe":["CWE-22","CWE-61","CWE-180"],"vendor":null,"product":null,"kev":{"is_kev":false,"date_added":null,"due_date":null,"ransomware":false},"epss":0.00585,"epss_percentile":0.48891,"nvd_status":"Deferred","enriched_at":"2026-11-22T10:12:59.788656Z","links":{"nvd":"https://nvd.nist.gov/vuln/detail/CVE-2025-29787"},"matched_alias":null,"items":[{"id":11057,"source":{"id":"osv","name":"OSV.dev"},"title":"GHSA-hjqx-j4rw-g7xv: zip: Arbitrary file write outside the extraction directory, because ZipArchive::extract validates symlink targets lexically.","summary":"zip: Arbitrary file write outside the extraction directory, because ZipArchive::extract validates symlink targets lexically.\n\n### Summary\n\n- **Verified version:** zip `9.0.0-pre3`\n- **Affected versions:** `7.2.0` and later\n- **Precondition:** The attacker knows (or can guess) the absolute path of the extraction destination\n\nThe validation applied to symlinks is purely lexical.\nAs a result, an attacker can write arbitrary files outside the extraction directory through a symlink.\nExploitation requires the attacker to know (or guess) the absolute path of the destination, but this is realistic in practice: CI workspaces, `/opt/app`, a fixed Downloads path, and so on.\n\n> **Impact extends further on Windows (verified on real hardware for both the separate-drive and UNC-share cases)**:\n> Because `simplified_components` discards the `Prefix` component, paths like `D:\\\n` or a UNC path `\\\\attacker\\share\\\n` pass the `starts_with` check.\n> As a result, `outpath.push` gets replaced onto a different drive/remote share, so **a single symlink is enough — no intermediate symlink chain is required**.\n> That said, creating a symlink on Windows requires `SeCreateSymbolicLinkPrivilege` (administrator rights or Developer Mode enabled).\n> **Real-hardware verification (Windows 10 VM (19045.2604), `tests/poc_win.rs`)**:\n> With the extraction target set to a temporary directory under `C:`, both of the following paths returned `Ok(())` from `extract()` and successfully wrote outside the extraction target.\n> In both cases `extract()` returned no error (`Ok(())`), and it was confirmed that the contents of `pwned.txt` matched the attacker-specified value.\n\n### Relationship to CVE-2025-29787\n\nThis is **not a duplicate** of the existing [CVE-2025-29787](https://github.com/zip-rs/zip2/security/advisories/GHSA-94vh-gphv-8pm8) (2025-03); rather, **the protection introduced for that CVE was subsequently lost**.\n\n#### Timeline (git history, UTC)\n\n| commit | Date | Description |\n| ---------- | ---------- | ---------------------------------------------------------------------------------------------------------------- |\n| `d4539d6b` | 2025-02-28 | Initial fix for CVE-2025-29787. Canonicalizes output paths and symlink targets and verifies they descend from the destination |\n| `0199ac2c` | 2025-03-15 | **Before the v2.3.0 release**, the above is replaced with a lexical check based on `simplified_components` |\n| `v2.3.0` | 2025-03-16 | Released as the CVE fix. **What actually shipped is the lexical check** |\n| `d5cf4b55` | 2026-01-18 | Changes how `simplified_components` handles absolute paths, **from rejecting them to silently stripping them** (released in `v7.2.0`) |\n\n#### Why v2.3.0 was not affected, and how the protection was lost\n\nThe `safe_prepare_path` in v2.3.0 performs essentially the same lexical check as the current code. However, `simplified_components` at that time **rejected any path containing an ab\n\nAffected: crates.io:zip\n\nFixed in: 9.0.0\n\nReferences:\nhttps://github.com/zip-rs/zip2/security/advisories/GHSA-hjqx-j4rw-g7xv\nhttps://nvd.nist.gov/vuln/detail/CVE-2026-115908\nhttps://github.com/zip-rs/zip2/commit/09c030eab56e8db8fb3c1c33f554407b30bad8fa\nhttps://github.com/zip-rs/zip2\nhttps://github.com/zip-rs/zip2/releases/tag/v9.0.0","url":"https://osv.dev/vulnerability/GHSA-hjqx-j4rw-g7xv","published_at":"2026-10-29T16:40:12Z","updated_at":"2026-11-17T10:25:40.757510Z","fetched_at":"2026-11-21T19:15:55.946399Z","severity":"high","cvss_score":7.4,"epss":0.00585,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":null,"product":"zip","vuln_id":"CVE-2026-115908","vuln_ids":["CVE-2025-29787","CVE-2026-115908","GHSA-94VH-GPHV-8PM8","GHSA-HJQX-J4RW-G7XV","RUSTSEC-2026-0546"],"tags":["osv","crates.io","fix-available"],"cluster_id":10790,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/11057","html":"https://vulnwatch.ve1ve2.com/item/11057"}}]}