/

CVE-2026-42275

Severity:

HIGH RISK

(8.7)

Path Traversal / Symlink Following in zrok WebDAV Drive

CVE-2026-42275

Analyzed

Vulnerability type

Category:

Path Traversal / Symlink Following

CWE:

CWE-22, CWE-61

Impact:

Arbitrary File Read and Potential Arbitrary File Write Outside Intended Root

Severity:

HIGH RISK

(8.7)

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

The zrok WebDAV drive backend follows symbolic links inside the shared drive root without enforcing that their targets remain within that root, enabling path traversal via symlinks.

A remote WebDAV client that can write or control files under the shared DriveRoot may be able to read and, where OS permissions allow, write or overwrite arbitrary files on the host filesystem accessible to the zrok process.

Affected context

This vulnerability affects deployments using the zrok WebDAV drive backend (davServer.Dir) to expose a directory tree as a share.

The issue arises when:

  • The shared WebDAV DriveRoot contains or can be made to contain symbolic links
  • Those symlinks can point to directories or files outside the intended DriveRoot
  • The underlying OS filesystem permissions allow the zrok process to access those external targets

In such setups, remote WebDAV consumers interacting with the share can traverse out of the logical root via symlinks even though lexical path normalization is applied.

Exploit preconditions

  • Attack surface: Network-accessible zrok WebDAV shares (HTTP/WebDAV interface).
  • Required access: Ability to interact with the WebDAV endpoint as a client; in many configurations this includes the ability to upload, rename, or otherwise create filesystem entries under the shared DriveRoot.
  • Trigger point: A WebDAV file or directory operation (e.g., PROPFIND, GET, PUT, MOVE, COPY, MKCOL) that resolves a path containing or traversing through a symbolic link located under the DriveRoot.
  • Why exploitation is possible:
  • The backend prevents simple ../-style directory traversal through lexical normalization but does not constrain filesystem resolution of symlinks.
  • As a result, a symlink stored under the DriveRoot can point to any location on the host filesystem reachable by the zrok process.
  • Subsequent WebDAV operations on paths that include that symlink are executed against the symlink target, not the intended bounded root.

Why this happens

The core issue is an incomplete path confinement strategy: the backend normalizes input paths to remove .. segments (mitigating direct lexical traversal) but relies on the OS to resolve filesystem paths, including symbolic links, without re-verifying that the resolved path still resides within the intended root directory.

This design maps to:

  • CWE-61: Improper Restriction of Symlink Following, where the application follows symlinks without enforcing contextual boundaries.
  • CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), because the intended directory restriction can be bypassed using symlink-based traversal.

Conceptually, the system trusts the apparent location of files under the DriveRoot but does not enforce that the effective location after symlink resolution remains constrained, enabling access outside the logical sandbox.

Potential impact

  • Remote WebDAV consumers may read arbitrary files on the host filesystem that are readable by the zrok process, including configuration files or sensitive data.
  • On shares where OS-level permissions are permissive, remote clients could write or overwrite files outside the intended share, potentially:
  • Corrupting application or system files
  • Altering configuration files to influence other services
  • Planting or modifying data used by other processes
  • Expansion of an initial WebDAV share into a broader filesystem exposure, undermining isolation expectations.
  • Facilitation of further compromise when combined with other weaknesses (e.g., overwriting scripts or configuration executed by higher-privileged components).

General mitigation guidance

Effective mitigation centers on enforcing a strict directory boundary that survives symlink resolution and reducing the trust placed in filesystem entries under the share:

  • Constrain resolved paths, not just input strings:
  • After resolving a requested path (including symlinks), verify that the canonical/absolute path is still within the intended DriveRoot before performing any filesystem operation.
  • Reject or neutralize operations that would escape the root, even if requested via symlink.
  • Control symlink behavior within shared roots:
  • Disallow symlinks in shared directories, or treat them as opaque entries that cannot be traversed.
  • Optionally support a configurable policy (allow, deny, or restrict symlink targets to specific subtrees).
  • Reduce privilege and filesystem exposure:
  • Run the zrok process under a dedicated user with least-privilege access, isolating it to only the directories that must be shared.
  • Consider containerization or chroot-style isolation to ensure that even if traversal occurs, the accessible filesystem is tightly bounded.
  • Harden share configuration:
  • Avoid exposing directories containing sensitive material or configuration files as WebDAV roots.
  • Where possible, mount a dedicated, minimal directory as the DriveRoot specifically for sharing.

These patterns focus on structural defenses and confinement rather than relying solely on lexical path checks.

How teams detect issues like this

Detection typically involves a combination of code-centric review and behavioral testing:

  • Static analysis and code review:
  • Look for filesystem operations that:
  • Accept user-influenced paths under a configured root directory, and
  • Rely only on string normalization (clean, filepath.Join, manual removal of ..) without post-resolution boundary checks.
  • Flag use of symlink-following calls that do not validate the final canonical path against the expected root.
  • Review WebDAV or file-sharing components for assumptions that "anything under this directory is safe" without accounting for symlinks.
  • Policy and configuration checks:
  • Implement internal security guidelines requiring canonical path verification before file operations in shared or remotely accessible directories.
  • Use automated review tools or linters configured with rules for CWE-22 / CWE-61 patterns, focusing on shared filesystem backends and path resolution logic.
  • Dynamic and penetration testing:
  • In staging environments, create symlinks under the shared root pointing outside the directory and attempt file operations via WebDAV.
  • Monitor logs and filesystem activity for unexpected access to files outside designated share paths when WebDAV requests occur.

Sources

SourceLink
github.comgithub.com/openziti/zrok/commit/459bcfc1e121decae1b1d11c37ad94e4ed5bbf2e
github.comgithub.com/openziti/zrok/releases/tag/v2.0.2
github.comgithub.com/openziti/zrok/security/advisories/GHSA-74m3-9qvm-rp9h

Frequently asked

questions

Exploitability depends on how the WebDAV share is exposed and controlled.

If untrusted or semi-trusted clients can create or manipulate entries under the shared DriveRoot, they can often leverage symlinks to access files outside the intended share.

In more restricted deployments where only trusted automation interacts with the share and symlinks cannot be introduced, the practical risk is reduced.

An attacker must be able to interact with the affected WebDAV share as a client and, in most realistic exploit scenarios, must be able to create or influence filesystem entries (such as uploading files or creating directories) within the shared DriveRoot.

In some operational setups, a local user or process with write access to the DriveRoot on the host could also introduce malicious symlinks that are then followed when a remote client accesses them.

The safest pattern is to treat the DriveRoot as a strict security boundary enforced after resolving the real filesystem path:

  • Canonicalize the target path (resolving symlinks) and verify it remains within the configured root before performing any read or write.
  • Optionally, disallow or strictly control symlink traversal under shared roots.
  • Combine this with least-privilege execution so that even misconfigurations do not expose the broader host filesystem.

When designing or reviewing file-sharing features:

  • Define a clear trust boundary (e.g., a root directory) and consistently enforce it using canonical path checks after symlink resolution.
  • Assume that any directory writable by untrusted parties may contain symlinks and other crafted entries meant to escape confinement.
  • Incorporate security requirements into development, such as mandatory boundary checks for file operations and automated tests for symlink-based traversal.
  • Run services with restricted privileges and avoid reusing host directories that contain sensitive or unrelated data as share roots.
Find out what's already
exploitable in your codebase.