/

CVE-2026-115908

Severity:

HIGH RISK

(7.4)

Path Traversal (CWE-22) in Rust zip Archive Extraction

CVE-2026-115908

Awaiting Analysis

Vulnerability type

Category:

Path Traversal via Symbolic Links

CWE:

CWE-22, CWE-59, CWE-61

Impact:

Unauthorized File Creation or Overwrite

Severity:

HIGH RISK

(7.4)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A path traversal and symlink-handling vulnerability in the Rust zip library can let an attacker escape the intended extraction directory through crafted symbolic-link chains. If an attacker can supply or influence an archive and knows or guesses the extraction destination, files may be created or overwritten using the extracting process's privileges.

A path traversal and symlink-handling vulnerability in the Rust zip library can let an attacker escape the intended extraction directory through crafted symbolic-link chains. If an attacker can supply or influence an archive and knows or guesses the extraction destination, files may be created or overwritten using the extracting process's privileges.

Affected context

The issue affects applications using the Rust zip library's archive extraction

functions, including ZipArchive::extract and

ZipArchive::extract_unwrapped_root_dir, when processing archives containing

symbolic links. Risk is greater when an attacker can provide an archive,

influence extraction inputs, or predict the destination path. Windows-specific

behavior may also be relevant when symbolic-link creation privileges are

available.

The issue affects applications using the Rust zip library's archive extraction

functions, including ZipArchive::extract and

ZipArchive::extract_unwrapped_root_dir, when processing archives containing

symbolic links. Risk is greater when an attacker can provide an archive,

influence extraction inputs, or predict the destination path. Windows-specific

behavior may also be relevant when symbolic-link creation privileges are

available.

Exploit preconditions

  • Attack surface: Archive extraction functionality in an application using the Rust zip library
  • Required access: Ability to provide or influence a ZIP archive, directly or through an upstream file-transfer or ingestion workflow
  • Trigger point: Extraction of archive entries containing a crafted symbolic-link chain
  • Environmental condition: The extraction destination must be known or reasonably guessable
  • Why exploitation is possible: Validation uses lexical path comparisons and simplified path components without resolving every intermediate symbolic link, allowing a link in the chain to redirect writes outside the intended directory
  • Windows condition: A drive or UNC prefix may contribute to an escape when the extracting process can create symbolic links, such as with administrator rights or Developer Mode
  • Attack surface: Archive extraction functionality in an application using the Rust zip library
  • Required access: Ability to provide or influence a ZIP archive, directly or through an upstream file-transfer or ingestion workflow
  • Trigger point: Extraction of archive entries containing a crafted symbolic-link chain
  • Environmental condition: The extraction destination must be known or reasonably guessable
  • Why exploitation is possible: Validation uses lexical path comparisons and simplified path components without resolving every intermediate symbolic link, allowing a link in the chain to redirect writes outside the intended directory
  • Windows condition: A drive or UNC prefix may contribute to an escape when the extracting process can create symbolic links, such as with administrator rights or Developer Mode

Why this happens

The underlying bug is an incomplete containment check during archive extraction.

The affected logic compares normalized path representations lexically, but does

not fully resolve intermediate symbolic links before deciding whether a target

remains inside the extraction directory. This permits a path that appears

confined to the destination to resolve elsewhere at write time. The behavior

maps primarily to CWE-22: Improper Limitation of a Pathname to a Restricted Directory, with related CWE-59: Improper Link Resolution Before File Access

and CWE-61: UNIX Symbolic Link Following.

The underlying bug is an incomplete containment check during archive extraction.

The affected logic compares normalized path representations lexically, but does

not fully resolve intermediate symbolic links before deciding whether a target

remains inside the extraction directory. This permits a path that appears

confined to the destination to resolve elsewhere at write time. The behavior

maps primarily to CWE-22: Improper Limitation of a Pathname to a Restricted Directory, with related CWE-59: Improper Link Resolution Before File Access

and CWE-61: UNIX Symbolic Link Following.

Potential impact

  • An attacker may create files outside the intended extraction directory.
  • Existing files may be overwritten with the extracting process's privileges.
  • Sensitive application, user, or system data could be modified.
  • The extracting process could be used to alter configuration, scripts, or other operational files.
  • A successful attack could contribute to code execution or broader host compromise, depending on writable targets and process privileges.
  • An attacker may create files outside the intended extraction directory.
  • Existing files may be overwritten with the extracting process's privileges.
  • Sensitive application, user, or system data could be modified.
  • The extracting process could be used to alter configuration, scripts, or other operational files.
  • A successful attack could contribute to code execution or broader host compromise, depending on writable targets and process privileges.

General mitigation guidance

Mitigation generally focuses on resolving and validating the complete filesystem

path before every write, rather than relying only on lexical normalization.

Common defensive patterns include:

  • Extracting into a dedicated directory with narrowly scoped permissions.
  • Rejecting symbolic links, hard links, absolute paths, drive-qualified paths, and UNC paths when they are not required.
  • Resolving each intermediate component and confirming that the final target remains within the approved extraction root.
  • Using filesystem APIs and containment checks designed to resist link races where available.
  • Applying least privilege to the extracting process and limiting its ability to modify sensitive locations.
  • Treating archives as untrusted input and applying size, entry, and path policies before extraction.
  • Using a maintained library release that contains the relevant security correction, subject to application compatibility testing.

Mitigation generally focuses on resolving and validating the complete filesystem

path before every write, rather than relying only on lexical normalization.

Common defensive patterns include:

  • Extracting into a dedicated directory with narrowly scoped permissions.
  • Rejecting symbolic links, hard links, absolute paths, drive-qualified paths, and UNC paths when they are not required.
  • Resolving each intermediate component and confirming that the final target remains within the approved extraction root.
  • Using filesystem APIs and containment checks designed to resist link races where available.
  • Applying least privilege to the extracting process and limiting its ability to modify sensitive locations.
  • Treating archives as untrusted input and applying size, entry, and path policies before extraction.
  • Using a maintained library release that contains the relevant security correction, subject to application compatibility testing.

How teams detect issues like this

Detection can combine source review, automated analysis, and runtime controls.

Useful approaches include:

  • Static analysis rules for archive extraction APIs that do not resolve symbolic links before file access.
  • Code review checks for lexical-only prefix comparisons, path canonicalization gaps, and writes performed after untrusted link creation.
  • Tests using nested symbolic links, absolute paths, drive-qualified paths, and UNC-style paths where the platform permits them.
  • Policy enforcement that rejects links and out-of-root paths in uploaded archives.
  • Runtime monitoring for extraction processes creating or modifying files outside designated staging directories.
  • Dependency and software composition analysis to identify affected library usage and track security-relevant updates.

Detection can combine source review, automated analysis, and runtime controls.

Useful approaches include:

  • Static analysis rules for archive extraction APIs that do not resolve symbolic links before file access.
  • Code review checks for lexical-only prefix comparisons, path canonicalization gaps, and writes performed after untrusted link creation.
  • Tests using nested symbolic links, absolute paths, drive-qualified paths, and UNC-style paths where the platform permits them.
  • Policy enforcement that rejects links and out-of-root paths in uploaded archives.
  • Runtime monitoring for extraction processes creating or modifying files outside designated staging directories.
  • Dependency and software composition analysis to identify affected library usage and track security-relevant updates.

Sources

SourceLink
github.comgithub.com/zip-rs/zip2/commit/09c030eab56e8db8fb3c1c33f554407b30bad8fa
github.comgithub.com/zip-rs/zip2/releases/tag/v9.0.0
github.comgithub.com/zip-rs/zip2/security/advisories/GHSA-hjqx-j4rw-g7xv

Frequently asked

questions

It can be reached remotely when an application accepts attacker-controlled ZIP

archives through an upload, synchronization, package, or other network-facing

workflow. The library itself does not make the issue remotely exploitable unless

such an input path exists.

The attacker generally needs the ability to supply or influence an archive and

must have a destination path that is known or guessable. The impact also

depends on the permissions of the extracting process.

Treat archive contents as untrusted, reject unnecessary link types, and resolve

every path component before confirming that the resulting target remains inside

a dedicated extraction directory.

Combine secure archive-extraction libraries with least-privilege execution,

strict path and link policies, adversarial path tests, dependency monitoring,

and runtime controls that detect writes outside approved staging locations.

It can be reached remotely when an application accepts attacker-controlled ZIP

archives through an upload, synchronization, package, or other network-facing

workflow. The library itself does not make the issue remotely exploitable unless

such an input path exists.

The attacker generally needs the ability to supply or influence an archive and

must have a destination path that is known or guessable. The impact also

depends on the permissions of the extracting process.

Treat archive contents as untrusted, reject unnecessary link types, and resolve

every path component before confirming that the resulting target remains inside

a dedicated extraction directory.

Combine secure archive-extraction libraries with least-privilege execution,

strict path and link policies, adversarial path tests, dependency monitoring,

and runtime controls that detect writes outside approved staging locations.

Find out what's already
exploitable in your codebase.