{"vuln_id":"CVE-2026-115908","aliases":["GHSA-hjqx-j4rw-g7xv","CVE-2025-29787","GHSA-94vh-gphv-8pm8"],"description":"zip: Arbitrary file write outside the extraction directory, because ZipArchive::extract validates symlink targets lexically.","published_at":"2026-10-22T12:00:00Z","modified_at":"2026-11-17T10:25:40.757510Z","first_seen_at":"2026-11-21T19:15:56.747562Z","severity":"high","severity_source":"native","cvss_score":7.4,"cvss_vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:H","cwe":["CWE-22","CWE-59","CWE-61"],"vendor":null,"product":null,"kev":{"is_kev":false,"date_added":null,"due_date":null,"ransomware":false},"epss":0.00494,"epss_percentile":0.43269,"nvd_status":null,"enriched_at":null,"links":{"nvd":"https://nvd.nist.gov/vuln/detail/CVE-2026-115908"},"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"}},{"id":11072,"source":{"id":"osv","name":"OSV.dev"},"title":"RUSTSEC-2026-0546: `ZipArchive::extract` can write outside the destination through absolute or chained symlink targets","summary":"`ZipArchive::extract` can write outside the destination through absolute or chained symlink targets\n\nBefore 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.\n\nA 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.\n\nThis affects `ZipArchive::extract` and `ZipArchive::extract_unwrapped_root_dir`.\n\nThe 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.\n\nAffected: crates.io:zip\n\nFixed in: 9.0.0\n\nReferences:\nhttps://crates.io/crates/zip\nhttps://rustsec.org/advisories/RUSTSEC-2026-0546.html\nhttps://github.com/zip-rs/zip2/commit/09c030eab56e8db8fb3c1c33f554407b30bad8fa","url":"https://osv.dev/vulnerability/RUSTSEC-2026-0546","published_at":"2026-10-22T12:00:00Z","updated_at":"2026-11-17T10:15:02.342876Z","fetched_at":"2026-11-21T19:15:55.946410Z","severity":"high","cvss_score":7.4,"epss":0.00494,"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":10791,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/11072","html":"https://vulnwatch.ve1ve2.com/item/11072"}}]}