/

CVE-2025-62878

Severity:

CRITICAL RISK

(9.9)

Path Traversal in PersistentVolume Path Configuration on

CVE-2025-62878

Awaiting Analysis

Vulnerability type

Category:

Path Traversal / Directory Traversal

CWE:

CWE-23

Impact:

Arbitrary File Overwrite and Unauthorized Filesystem Access on Host Node

Severity:

CRITICAL RISK

(9.9)

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 weakness in how parameters.pathPattern is handled allows a malicious user to influence where PersistentVolumes are created on the host node.

By crafting a pathPattern that escapes the intended directory, an attacker may create volumes in arbitrary filesystem locations, potentially overwriting sensitive files or accessing unintended host directories.

Affected context

This vulnerability arises in Kubernetes or containerized storage integrations where a parameters.pathPattern value from user-controlled or semi-trusted configuration is used to compute host filesystem paths for PersistentVolumes.

It is most relevant when:

  • Volume provisioning logic concatenates pathPattern directly into host paths
  • There is an assumption that pathPattern stays within a specific base directory
  • The underlying host filesystem is shared with sensitive system or application data

Exploit preconditions

  • Attack surface: Storage or volume provisioning API that accepts parameters.pathPattern (e.g., StorageClass, provisioner configuration, or similar).
  • Required access: Ability to define or modify resources that influence pathPattern (such as StorageClass parameters or PVC annotations, depending on deployment).
  • Trigger point: Volume creation or provisioning workflow where the provisioner resolves pathPattern into a host filesystem path.
  • Why exploitation is possible: The value of pathPattern is not normalized, validated, or restricted to a safe base directory, allowing traversal sequences (such as ../) or absolute paths to escape the intended storage root.

Why this happens

The core issue maps to CWE-23: Relative Path Traversal.

Application logic constructs filesystem paths for PersistentVolumes by combining a trusted base directory with a partially or fully untrusted pathPattern without:

  • canonicalizing and normalizing the resulting path, and
  • enforcing that the final path remains within a designated directory boundary.

This insecure pattern allows specially crafted path components to traverse the directory structure, targeting arbitrary locations on the host node.

Potential impact

  • Creation of PersistentVolumes that map to unintended directories on the host node
  • Overwriting or truncating sensitive configuration or application files on the host
  • Gaining read/write access to system directories that should not be exposed to workloads
  • Escalation of privileges within the cluster if critical host files are modified
  • Lateral movement opportunities by accessing data belonging to other tenants or workloads

General mitigation guidance

Effective mitigation focuses on strict path handling and constraining filesystem access:

  • Normalize and canonicalize any derived paths that include pathPattern before use.
  • Enforce that the resolved path always resides within a predefined, immutable base directory (e.g., by checking that the canonical path has the expected prefix).
  • Reject pathPattern values containing traversal tokens, absolute path markers, or other disallowed constructs.
  • Use a whitelist of allowed patterns or template variables rather than accepting free-form path strings.
  • Isolate storage directories for dynamic volumes on dedicated, least-privilege paths separate from host system data.
  • Combine filesystem-level permissions and container runtime security controls so that even misconfigured volumes have limited blast radius.

How teams detect issues like this

Detection typically combines code-level analysis with configuration review:

  • Static analysis and manual review targeting any code that:
  • concatenates user-controlled strings into filesystem paths, or
  • uses pathPattern-like parameters without canonicalization and boundary checks.
  • Cluster policy or admission controllers that:
  • inspect StorageClass and related custom resources for unsafe or unconstrained pathPattern usage, and
  • block patterns containing traversal sequences or absolute paths.
  • Runtime monitoring for unusual mount points or volumes that map outside expected storage roots.
  • Periodic configuration and filesystem audits to identify volumes or directories created outside approved storage locations.

Sources

SourceLink
bugzilla.suse.combugzilla.suse.com/show_bug.cgi?id=CVE-2025-62878
github.comgithub.com/advisories/GHSA-jr3w-9vfr-c746

Frequently asked

questions

It can be exploitable by any actor who can influence parameters.pathPattern through the cluster's APIs. In many environments this means authenticated users or workloads with permission to define or modify storage-related resources.

The attacker needs permission to create or modify resources that control pathPattern, such as StorageClasses, dynamic provisioning parameters, or similar configuration objects, depending on how the environment is set up.

Implement strict path handling by canonicalizing the computed path, validating it against a fixed base directory, and rejecting any configuration that would cause the path to leave that directory. Combine this with constraints on allowed pathPattern formats.

Treat all path fragments derived from user or configuration input as untrusted, enforce directory boundary checks, codify these rules in code review guidelines and admission policies, and use automated analysis to flag path concatenation that lacks normalization and validation.

Find out what's already
exploitable in your codebase.