Fedora Account System
Red Hat Associate
Red Hat Customer
A path traversal vulnerability was found in KubeVirt's virt-exportserver component. The VMExport directory endpoint uses Go's http.FileServer(http.Dir(mountPoint)) to serve filesystem PVC contents. Because http.Dir follows symbolic links, an attacker who can control files inside an exported filesystem PVC can place a symlink pointing outside the PVC mount root and read arbitrary files from the exporter pod's filesystem through the VMExport directory endpoint. This vulnerability affects filesystem PVCs that do not have the cdi.kubevirt.io/storage.contentType annotation set to a KubeVirt content type. PVCs with KubeVirt content type receive raw/gzip export endpoints instead of the vulnerable directory endpoint. Namespaces with mixed workloads (pods and VMs) are more likely to have affected PVCs than namespaces hosting only KubeVirt VMs. To exploit this vulnerability, an attacker must have namespace-level access sufficient to create or control the contents of a filesystem PVC, create a VirtualMachineExport resource for that PVC, and possess or obtain the VMExport token.