CVE-2026-3864 Overview
A path traversal vulnerability was discovered in the Kubernetes CSI Driver for NFS where the subDir parameter in volume identifiers was insufficiently validated. Attackers with the ability to create PersistentVolumes referencing the NFS CSI driver could craft volume identifiers containing path traversal sequences (../). During volume deletion or cleanup operations, the driver could operate on unintended directories outside the intended managed path within the NFS export. This may lead to deletion or modification of directories on the NFS server.
Critical Impact
Attackers with PersistentVolume creation privileges can manipulate volume identifiers to traverse directories and delete or modify arbitrary directories on NFS servers, potentially causing significant data loss or integrity issues.
Affected Products
- Kubernetes CSI Driver for NFS (vulnerable versions not specified in advisory)
- Kubernetes clusters using NFS CSI driver with PersistentVolume creation capabilities
- NFS storage backends connected via the vulnerable CSI driver
Discovery Timeline
- 2026-03-17 - Security announcement posted to Openwall OSS-Security
- 2026-03-20 - CVE-2026-3864 published to NVD
- 2026-03-23 - Last updated in NVD database
Technical Details for CVE-2026-3864
Vulnerability Analysis
This vulnerability is classified as CWE-22 (Improper Limitation of a Pathname to a Restricted Directory), commonly known as path traversal. The root issue lies in insufficient input validation of the subDir parameter within volume identifiers processed by the NFS CSI driver.
When a user creates a PersistentVolume that references the NFS CSI driver, they can specify a volume identifier that includes a subDir component. Under normal operation, this parameter should constrain operations to a subdirectory within the NFS export. However, due to inadequate validation, attackers can inject path traversal sequences such as ../ to escape the intended directory boundary.
The attack requires privileged access to create PersistentVolumes in the Kubernetes cluster. While this limits the attack surface to users with elevated permissions, it represents a significant risk in multi-tenant environments or clusters where PersistentVolume creation is delegated to less-trusted users or automated systems.
Root Cause
The vulnerability stems from the NFS CSI driver's failure to properly sanitize or validate the subDir parameter before using it in file system operations. The driver does not implement adequate checks to prevent directory traversal sequences from being included in the path, allowing the constructed path to resolve to locations outside the intended NFS export subdirectory.
Attack Vector
The attack is network-accessible and requires high privileges (the ability to create PersistentVolumes in a Kubernetes cluster). An attacker would craft a malicious PersistentVolume resource with a specially constructed volume identifier containing path traversal sequences in the subDir parameter. When the volume is subsequently deleted or cleaned up, the CSI driver processes the malicious path without proper validation, causing it to operate on directories outside the intended scope. This can result in unauthorized deletion or modification of directories on the NFS server, potentially affecting other volumes or critical system data.
The vulnerability mechanism can be understood through the following attack flow:
- Attacker creates a PersistentVolume with a crafted volume identifier containing ../ sequences in the subDir field
- The NFS CSI driver accepts the volume specification without proper path validation
- During volume deletion or cleanup operations, the driver constructs a file system path using the unsanitized subDir value
- The path traversal sequences cause the driver to operate on directories outside the intended NFS export path
- Unintended directories are deleted or modified on the NFS server
For detailed technical information, refer to the GitHub Kubernetes Issue and the Kubernetes Security Announcement.
Detection Methods for CVE-2026-3864
Indicators of Compromise
- PersistentVolume resources containing ../ or similar path traversal patterns in volume identifiers or subDir parameters
- Unexpected deletions or modifications of directories on NFS servers
- Audit logs showing creation of PersistentVolumes with unusual or suspicious volume identifier strings
- NFS server logs indicating access to directories outside expected export subdirectories
Detection Strategies
- Implement Kubernetes admission controllers (e.g., OPA Gatekeeper, Kyverno) to validate PersistentVolume specifications and reject those containing path traversal sequences
- Monitor Kubernetes audit logs for PersistentVolume creation events and analyze volume identifiers for suspicious patterns
- Enable detailed logging on NFS servers to track directory operations and identify anomalous access patterns
- Deploy runtime security tools to detect unexpected file system operations by the CSI driver pods
Monitoring Recommendations
- Configure alerts for PersistentVolume creation events involving the NFS CSI driver
- Establish baseline monitoring for NFS server directory structures and alert on unexpected changes
- Implement file integrity monitoring on critical NFS directories to detect unauthorized modifications
- Review CSI driver pod logs regularly for error messages or unusual path operations
How to Mitigate CVE-2026-3864
Immediate Actions Required
- Review all existing PersistentVolumes using the NFS CSI driver for path traversal sequences in volume identifiers
- Implement admission controller policies to prevent creation of PersistentVolumes with path traversal patterns
- Restrict PersistentVolume creation privileges to trusted administrators only
- Audit NFS server directories for signs of unauthorized access or modifications
Patch Information
Consult the Kubernetes Security Announcement and the GitHub Issue for the latest patch information and updated driver versions. Upgrade to a patched version of the NFS CSI driver as soon as one becomes available.
Workarounds
- Deploy admission controllers with policies that reject PersistentVolumes containing ../ or encoded path traversal sequences in volume identifiers
- Restrict RBAC permissions for PersistentVolume creation to a minimal set of trusted users or service accounts
- Implement NFS server-side access controls to limit the impact of potential directory traversal attacks
- Consider using alternative CSI drivers or storage solutions until a patched version is available
# Example Kyverno ClusterPolicy to block path traversal in PersistentVolumes
# Deploy after customizing to your environment
kubectl apply -f - <<EOF
apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
name: block-nfs-path-traversal
spec:
validationFailureAction: enforce
rules:
- name: check-volume-handle
match:
resources:
kinds:
- PersistentVolume
validate:
message: "Volume identifiers must not contain path traversal sequences"
pattern:
spec:
csi:
volumeHandle: "!*../*"
EOF
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.


