REDHAT-BUG-2583149: Medium severity Kubevirt Containerized Data Importer vulnerability
A flaw was found in the Containerized Data Importer (CDI) clone controller. The controller's ensureCertSecret (pkg/controller/clone-controller.go) issues a CDI-CA-signed client certificate whose CommonName is read verbatim from the cdi.kubevirt.io/uploadClientName annotation on the target PVC — an annotation a namespace user can set on their own PVCs, with no validation of its value at any layer (no admission check, no allowlist, no comparison to the controller-derived value). The upload server (pkg/uploadserver/uploadserver.go) authenticates clients solely by CA-chain validation plus CommonName string match, with no namespace or PVC binding; for plain upload PVCs the expected client name is the cluster-wide constant client.upload-server.cdi.kubevirt.io (pkg/controller/upload-controller.go), and for clone targets it is a deterministic, derivable string. A namespace user with standard edit-level RBAC (create/update PVCs, create pods in their own namespace) can therefore obtain a valid client certificate — the clone token validation is skipped entirely for same-namespace clones — and blind-write arbitrary disk-image data into any upload-ready PVC in any namespace whose per-PVC headless upload Service they can reach on the pod network. The write is blind but lands in the victim's disk image; a VM booting the tampered image is a further escalation path.
Affected Software
Event History
Frequently Asked Questions
What level of access does an attacker need?
A namespace user with standard edit-level RBAC is sufficient, specifically the ability to create or update PVCs and create Pods in their own namespace. The user can set the relevant annotation on PVCs they control.
Can the impact extend beyond the attacker's namespace?
Yes. The flaw can allow arbitrary disk-image data to be written to upload-ready PVCs in other namespaces when their per-PVC configuration accepts the client identity used by the attacker.
Is a clone token required for exploitation?
Not for same-namespace clones. Clone token validation is skipped entirely in that case, allowing the attacker to obtain a CDI-CA-signed client certificate with an attacker-controlled CommonName.