/

CVE-2026-45576

Severity:

HIGH RISK

(7.5)

Path Traversal (CWE-22) in zrok2 Copy Sync Pipeline

CVE-2026-45576

Analyzed

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22

Impact:

Arbitrary File Write Outside Intended Directory

Severity:

HIGH RISK

(7.5)

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

zrok versions 0.4.23 through 2.0.3 contain a path traversal flaw in the zrok2 copy sync pipeline that trusts attacker-controlled WebDAV or zrok drive paths.

By supplying crafted paths like /../outside.txt, an attacker can cause files to be written outside the intended local destination directory when synchronization occurs.

zrok versions 0.4.23 through 2.0.3 contain a path traversal flaw in the zrok2 copy sync pipeline that trusts attacker-controlled WebDAV or zrok drive paths.

By supplying crafted paths like /../outside.txt, an attacker can cause files to be written outside the intended local destination directory when synchronization occurs.

Affected context

The vulnerability appears in environments where zrok is used to synchronize files from WebDAV or zrok drive sources to a local filesystem using the zrok2 copy command.

It becomes relevant when remote endpoints can influence or control the paths that are stored in the source inventory and later passed into the sync pipeline.

In such setups, insufficient normalization and validation of incoming file paths allow traversal sequences to escape the intended destination root directory.

The vulnerability appears in environments where zrok is used to synchronize files from WebDAV or zrok drive sources to a local filesystem using the zrok2 copy command.

It becomes relevant when remote endpoints can influence or control the paths that are stored in the source inventory and later passed into the sync pipeline.

In such setups, insufficient normalization and validation of incoming file paths allow traversal sequences to escape the intended destination root directory.

Exploit preconditions

  • Attack surface: The sync functionality of zrok2 copy interacting with WebDAV or zrok drive sources.
  • Required access: Ability to supply or control file paths on the remote WebDAV or zrok drive (e.g., by hosting or modifying content on the source).
  • Trigger point: Execution of zrok2 copy where the source inventory records paths containing traversal segments like /../.
  • Why exploitation is possible: The sync pipeline passes unsanitized source paths directly to FilesystemTarget.WriteStream, which does not enforce that writes stay within the selected local destination root.
  • Attack surface: The sync functionality of zrok2 copy interacting with WebDAV or zrok drive sources.
  • Required access: Ability to supply or control file paths on the remote WebDAV or zrok drive (e.g., by hosting or modifying content on the source).
  • Trigger point: Execution of zrok2 copy where the source inventory records paths containing traversal segments like /../.
  • Why exploitation is possible: The sync pipeline passes unsanitized source paths directly to FilesystemTarget.WriteStream, which does not enforce that writes stay within the selected local destination root.

Why this happens

This issue stems from inadequate validation and canonicalization of file paths received from remote sources before using them in filesystem write operations.

The code path that builds the source inventory and later invokes FilesystemTarget.WriteStream relies on externally controlled paths without stripping traversal segments or re-checking that the resolved location remains under the chosen destination root.

Conceptually, this maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory, where a component fails to constrain file system operations to an intended directory, enabling attackers to escape that boundary.

This issue stems from inadequate validation and canonicalization of file paths received from remote sources before using them in filesystem write operations.

The code path that builds the source inventory and later invokes FilesystemTarget.WriteStream relies on externally controlled paths without stripping traversal segments or re-checking that the resolved location remains under the chosen destination root.

Conceptually, this maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory, where a component fails to constrain file system operations to an intended directory, enabling attackers to escape that boundary.

Potential impact

  • Files may be written to arbitrary locations outside the designated sync destination directory.
  • Attackers could create or overwrite configuration files on the local system.
  • Sensitive local files or application data could be corrupted or replaced.
  • Local privilege escalation may be possible if critical system or application files are overwritten in permissive environments.
  • Files may be written to arbitrary locations outside the designated sync destination directory.
  • Attackers could create or overwrite configuration files on the local system.
  • Sensitive local files or application data could be corrupted or replaced.
  • Local privilege escalation may be possible if critical system or application files are overwritten in permissive environments.

General mitigation guidance

Effective mitigation focuses on ensuring that all file paths derived from external sources are constrained to an expected directory and validated before use.

Common patterns include:

  • Normalizing and canonicalizing paths, then verifying that the final resolved path remains under the intended destination root.
  • Rejecting or sanitizing any path that contains traversal tokens (.., absolute path prefixes, or mixed separators) before use in file operations.
  • Encapsulating filesystem writes behind APIs that enforce directory boundaries rather than exposing raw path handling throughout the codebase.
  • Applying least-privilege principles to the processes performing synchronization so that even misdirected writes have limited impact on the system.

Effective mitigation focuses on ensuring that all file paths derived from external sources are constrained to an expected directory and validated before use.

Common patterns include:

  • Normalizing and canonicalizing paths, then verifying that the final resolved path remains under the intended destination root.
  • Rejecting or sanitizing any path that contains traversal tokens (.., absolute path prefixes, or mixed separators) before use in file operations.
  • Encapsulating filesystem writes behind APIs that enforce directory boundaries rather than exposing raw path handling throughout the codebase.
  • Applying least-privilege principles to the processes performing synchronization so that even misdirected writes have limited impact on the system.

How teams detect issues like this

Detection generally relies on identifying unsafe path handling and write operations in code and configurations.

Useful strategies include:

  • Static analysis rules that flag uses of path-join and file-write APIs receiving data from untrusted sources without normalization or boundary checks.
  • Code review guidelines that require verification of directory confinement around any logic performing filesystem writes from remotely supplied paths.
  • Policy checks that ensure sync or backup tooling uses whitelisting or root-lock mechanisms for target directories.
  • Optional use of automated security scanners to highlight instances where traversal sequences in user-controlled input can reach filesystem APIs.

Detection generally relies on identifying unsafe path handling and write operations in code and configurations.

Useful strategies include:

  • Static analysis rules that flag uses of path-join and file-write APIs receiving data from untrusted sources without normalization or boundary checks.
  • Code review guidelines that require verification of directory confinement around any logic performing filesystem writes from remotely supplied paths.
  • Policy checks that ensure sync or backup tooling uses whitelisting or root-lock mechanisms for target directories.
  • Optional use of automated security scanners to highlight instances where traversal sequences in user-controlled input can reach filesystem APIs.

Sources

SourceLink
github.comgithub.com/openziti/zrok/commit/a5811e61589d2f804267c6de4a9056db1bdea457
github.comgithub.com/openziti/zrok/releases/tag/v2.0.3
github.comgithub.com/openziti/zrok/security/advisories/GHSA-c656-jcx2-7pqj

Frequently asked

questions

Exploitation depends on having control over the paths provided by the WebDAV or zrok drive source. In scenarios where an attacker can host or alter content on the source, they can craft traversal paths to influence where files are written locally.

An attacker needs the ability to provide or modify paths during synchronization—typically by controlling a remote endpoint, repository, or share that zrok2 copy is configured to use as a source.

The most robust approach is to normalize and canonicalize all externally supplied paths, then enforce that the resolved paths remain strictly within a predefined destination root before performing any write operations, rejecting inputs that fail this check.

Future prevention hinges on treating all remote or user-controlled paths as untrusted, applying strict directory confinement checks, centralizing filesystem access behind hardened APIs, and incorporating automated validation and review of path-handling logic into the development lifecycle.

Exploitation depends on having control over the paths provided by the WebDAV or zrok drive source. In scenarios where an attacker can host or alter content on the source, they can craft traversal paths to influence where files are written locally.

An attacker needs the ability to provide or modify paths during synchronization—typically by controlling a remote endpoint, repository, or share that zrok2 copy is configured to use as a source.

The most robust approach is to normalize and canonicalize all externally supplied paths, then enforce that the resolved paths remain strictly within a predefined destination root before performing any write operations, rejecting inputs that fail this check.

Future prevention hinges on treating all remote or user-controlled paths as untrusted, applying strict directory confinement checks, centralizing filesystem access behind hardened APIs, and incorporating automated validation and review of path-handling logic into the development lifecycle.

Find out what's already
exploitable in your codebase.