chore(deps): update module kubevirt.io/kubevirt to v1.9.0 [security] (v1.7) - #234
Open
renovate[bot] wants to merge 1 commit into
Open
chore(deps): update module kubevirt.io/kubevirt to v1.9.0 [security] (v1.7)#234renovate[bot] wants to merge 1 commit into
renovate[bot] wants to merge 1 commit into
Conversation
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Contributor
Author
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
v1.6.0→v1.9.0v1.5.0→v1.9.0KubeVirt Isolation Detection Flaw Allows Arbitrary File Permission Changes
CVE-2025-64437 / GHSA-2r4r-5x78-mvqf / GO-2025-4102
More information
Details
Summary
_Short summary of the problem. Make the impact and severity as clear as possible.
It is possible to trick the
virt-handlercomponent into changing the ownership of arbitrary files on the host node to the unprivileged user with UID107due to mishandling of symlinks when determining the root mount of avirt-launcherpod.Details
Give all details on the vulnerability. Pointing to the incriminated source code is very helpful for the maintainer.
In the current implementation, the
virt-handlerdoes not verify whether thelauncher-sockis a symlink or a regular file. This oversight can be exploited, for example, to change the ownership of arbitrary files on the host node to the unprivileged user with UID107(the same user used byvirt-launcher) thus, compromising the CIA (Confidentiality, Integrity and Availability) of data on the host.To successfully exploit this vulnerability, an attacker should be in control of the file system of the
virt-launcherpod.PoC
Complete instructions, including specific configuration details, to reproduce the vulnerability.
In this demonstration, two additional vulnerabilities are combined with the primary issue to arbitrarily change the ownership of a file located on the host node:
launcher-sock) is used to manipulate the interpretation of the root mount within the affected container, effectively bypassing expected isolation boundaries.disk.img) is employed to alter the perceived location of data within a PVC, redirecting it to a file owned by root on the host filesystem.It is assumed that an attacker has access to a
virt-launcherpod's file system (for example, obtained using another vulnerability) and also has access to the host file system with the privileges of theqemuuser (UID=107). It is also assumed that they can create unprivileged user namespaces:admin@minikube:~$ sysctl -w kernel.unprivileged_userns_clone=1The below is inspired by an article, where the attacker constructs an isolated environment solely using Linux namespaces and an augmented Alpine container root file system.
After the environment is set, the
launcher-sockin thevirt-launchercontainer should be replaced with a symlink to../../../../../../../../../proc/2245509/root/tmp/bad.sock(2245509 is the PID of the above isolated shell process). This should be done, however, in a the right moment. For this demonstration, it was decided to trigger the bug while leveraging a race condition when creating or updating a VMI:The manifest of the #acr("vmi") which is going to trigger the bug is:
Just before the line is executed, the attacker should replace the
launcher-sockwith a symlink to thebad.sockcontrolled by the isolated process:Upon successful exploitation,
virt-launcherconnects to the attacker controlled socket, misinterprets the root mount and changes the permissions of the host's/etc/passwdfile:The attacker controlling an unprivileged user can now update the contents of the file.
Impact
What kind of vulnerability is it? Who is impacted?
This oversight can be exploited, for example, to change the ownership of arbitrary files on the host node to the unprivileged user with UID
107(the same user used byvirt-launcher) thus, compromising the CIA (Confidentiality, Integrity and Availability) of data on the host.Severity
CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:C/C:L/I:L/A:LReferences
This data is provided by OSV and the GitHub Advisory Database (CC-BY 4.0).
KubeVirt Affected by an Authentication Bypass in Kubernetes Aggregation Layer
CVE-2025-64432 / GHSA-38jw-g2qx-4286 / GO-2025-4103
More information
Details
Summary
_Short summary of the problem. Make the impact and severity as clear as possible.
A flawed implementation of the Kubernetes aggregation layer's authentication flow could enable bypassing RBAC controls.
Details
Give all details on the vulnerability. Pointing to the incriminated source code is very helpful for the maintainer.
It was discovered that the
virt-apicomponent fails to correctly authenticate the client when receiving API requests over mTLS. In particular, it fails to validate the CN (Common Name) field in the received client TLS certificates against the set of allowed values defined in theextension-apiserver-authenticationconfigmap.The Kubernetes API server proxies received client requests through a component called aggregator (part of K8S's API server), and authenticates to the
virt-apiserver using a certificate signed by the CA specified via the--requestheader-client-ca-fileCLI flag. This CA bundle is primarily used in the context of aggregated API servers, where the Kubernetes API server acts as a trusted front-end proxy forwarding requests.While this is the most common use case, the same CA bundle can also support less common scenarios, such as issuing certificates to authenticating front-end proxies. These proxies can be deployed by organizations to extend Kubernetes' native authentication mechanisms or to integrate with existing identity systems (e.g., LDAP, OAuth2, SSO platforms). In such cases, the Kubernetes API server can trust these external proxies as legitimate authenticators, provided their client certificates are signed by the same CA as the one defined via
--requestheader-client-ca-file.Nevertheless, these external authentication proxies are not supposed to directly communicate with aggregated API servers.
Thus, by failing to validate the CN field in the client TLS certificate, the
virt-apicomponent may allow an attacker to bypass existing RBAC controls by directly communicating with the aggregated API server, impersonating the Kubernetes API server and its aggregator component.However, two key prerequisites must be met for successful exploitation:
The attacker must possess a valid front-end proxy certificate signed by the trusted CA (
requestheader-client-ca-file). For example, they can steal the certificate material by compromising a front-end proxy or they could obtain a bundle by exploiting a poorly configured and managed PKI system.The attacker must have network access to the
virt-apiservice, such as via a compromised or controlled pod within the cluster.These conditions significantly reduce the likelihood of exploitation. In addition, the
virt-apicomponent acts as a sub-resource server, meaning it only handles requests for specific resources and sub-resources . The handled by it requests are mostly related to the lifecycle of already existing resources.Nonetheless, if met, the vulnerability could be exploited by a Pod-Level Attacker to escalate privileges, and manipulate existing virtual machine workloads potentially leading to violation of their CIA (Confidentiality, Integrity and Availability).
PoC
Complete instructions, including specific configuration details, to reproduce the vulnerability.
Bypassing authentication
In this section, it is demonstrated how an attacker could use a certificate with a different CN field to bypass the authentication of the aggregation layer and perform arbitrary API sub-resource requests to the
virt-apiserver.The
kube-apiserverhas been launched with the following CLI flags:By default, Minikube generates a self-signed CA certificate (
var/lib/minikube/certs/front-proxy-ca.crt) and use it to sign the certificate used by the aggregator (/var/lib/minikube/certs/front-proxy-client.crt):One can also inspect the contents of the
extension-apiserver-authenticationConfigMap which is used as a trust anchor by all extension API servers:It is assumed that an attacker has obtained access to a Kubernetes pod and could communicate with
virt-apireachable at10.244.0.6.The
virt-apiservice has two types of endpoints -- authenticated and non-authenticated:Each endpoint which is not in this list is considered an authenticated endpoint and requires a valid client certificate to be presented by the caller.
To illustrate the vulnerability and attack scenario, below is generated a certificate signed by the
front-proxy-cabut issued to an entity which is different thanfront-proxy-client(i.e the certificate has a different CN). Later on, it is assumed that the attacker has obtained access to the certificate bundle:The authentication will now succeed:
To fully exploit the vulnerability, the attacker must also provide valid authentication HTTP headers:
The
virt-apiis a sub-resource extension server - it handles only requests for specific resources and sub-resources (requests having URIs prefixed with/apis/subresources.kubevirt.io/v1/). In reality, most of the requests that it accepts are actually executed by thevirt-handlercomponent and are related to the lifecycle of a VM.Hence,
virt-handler's API can be seen as aggregated withinvirt-api's API which in turn transforms it into a proxy.The endpoints which are handled by
virt-apiare listed in the Swagger definitions available on GitHub @openapi-spec.Resetting a Virtual Machine Instance
Consider the following deployed
VirtualMachineInstance(VMI) within the default namespace:An attacker with a stolen external authentication proxy certificate could easily reset (hard reboot), freeze, or remove volumes from the virtual machine.
Impact
What kind of vulnerability is it? Who is impacted?
The
virt-apicomponent may allow an attacker to bypass existing RBAC controls by directly communicating with the aggregated API server, impersonating the Kubernetes API server and its aggregator component.Severity
CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:HReferences
This data is provided by OSV and the GitHub Advisory Database (CC-BY 4.0).
KubeVirt Vulnerable to Arbitrary Host File Read and Write
CVE-2025-64324 / GHSA-46xp-26xh-hpqh / GO-2025-4110
More information
Details
Summary
The
hostDiskfeature in KubeVirt allows mounting a host file or directory owned by the user with UID 107 into a VM. However, the implementation of this feature and more specifically theDiskOrCreateoption which creates a file if it doesn't exist, has a logic bug that allows an attacker to read and write arbitrary files owned by more privileged users on the host system.Details
The
hostDiskfeature gate in KubeVirt allows mounting a QEMU RAW image directly from the host into a VM. While similar features, such as mounting disk images from a PVC, enforce ownership-based restrictions (e.g., only allowing files owned by specific UID, this mechanism can be subverted. For a RAW disk image to be readable by the QEMU process running within thevirt-launcherpod, it must be owned by a user with UID 107. If this ownership check is considered a security barrier, it can be bypassed. In addition, the ownership of the host files mounted via this feature is changed to the user with UID 107.The above is due to a logic bug in the code of the
virt-handlercomponent which prepares and sets the permissions of the volumes and data inside which are going to be mounted in thevirt-launcherpod and consecutively consumed by the VM. It is triggered when one tries to mount a host file or directory using theDiskOrCreateoption. The relevant code is as follows:The root cause lies in the fact that if the specified by the user file does not exist, it is created by the
handleRequestedSizeAndCreateSparseRawfunction. However, this function does not explicitly set file ownership or permissions. As a result, the logic inmountHostDiskAndSetOwnershipproceeds to the branch marked with// Change file ownership to the qemu user, assuming ownership should be applied. This logic fails to account for the scenario where the file already exists and may be owned by a more privileged user.In such cases, changing file ownership without validating the file's origin introduces a security risk: it can unintentionally grant access to sensitive host files, compromising their integrity and confidentiality. This may also enable an External API Attacker to disrupt system availability.
PoC
To demonstrate this vulnerability, the
hostDiskfeature gate should be enabled when deploying the KubeVirt stack.Initially, if one tries to create a VM and mount
/etc/passwdfrom the host using theDiskoption which assumes that the file already exists, the following error is returned:The hosts's
/etc/passwdfile's owner and group are0:0(root:root) hence, when one tries to deploy the aboveVirtualMachinedefinition, it gets aPermissionDeniederror because the file is not owned by the user with UID107(qemu):However, if one uses the
DiskOrCreateoption, the file's ownership is silently changed to107:107(qemu:qemu) before the VM is started which allows the latter to boot, and then read and modify it.If one inspects the file content of the host's
/etc/passwdfile, they will see that it has changed alongside its ownership:Impact
Host files arbitrary read and write - this vulnerability it can unintentionally grant access to sensitive host files, compromising their integrity and confidentiality.
Severity
CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:NReferences
This data is provided by OSV and the GitHub Advisory Database (CC-BY 4.0).
KubeVirt's Improper TLS Certificate Management Handling Allows API Identity Spoofing
CVE-2025-64434 / GHSA-ggp9-c99x-54gp / GO-2025-4107
More information
Details
Summary
Due to improper TLS certificate management, a compromised
virt-handlercould impersonatevirt-apiby using its own TLS credentials, allowing it to initiate privileged operations against anothervirt-handler.Details
Give all details on the vulnerability. Pointing to the incriminated source code is very helpful for the maintainer.
Because of improper TLS certificate management, a compromised
virt-handlerinstance can reuse its TLS bundle to impersonatevirt-api, enabling unauthorized access to VM lifecycle operations on othervirt-handlernodes.The
virt-apicomponent acts as a sub-resource server, and it proxies API VM lifecycle requests tovirt-handlerinstances.The communication between
virt-apiandvirt-handlerinstances is secured using mTLS. The former acts as a client while the latter as the server. The client certificate used byvirt-apiis defined in the source code as follows and have the following properties:The
virt-handlercomponent verifies the signature of client certificates using a self-signed root CA. This latter is generated byvirt-operatorwhen the KubeVirt stack is deployed and it is stored within a ConfigMap in thekubevirtnamespace. This configmap is used as a trust anchor by allvirt-handlerinstances to verify client certificates.The
kubevirt-cais also used to sign the server certificate which is used by avirt-handlerinstance:In addition to the validity of the signature, the
virt-handlercomponent also verifies the CN field of the presented certificate:<code.sec.SetupTLSForVirtHandlerServer>
The above code illustrates that client certificates accepted be KubeVirt should have as CN
kubevirt.io:system:client:virt-handlerwhich is the same as the CN present in thevirt-api's certificate. However, the latter is not the only component in the KubeVirt stack which can communicate with avirt-handlerinstance.In addition to the extension API server, any other
virt-handlercan communicate with it. This happens in the context of VM migration operations. When a VM is migrated from one node to another, thevirt-handlers on both nodes are going to use structures calledProxyManagerto communicate back and forth on the state of the migration.This communication follows a classical client-server model, where the
virt-handleron the migration source node acts as a client and thevirt-handleron the migration destination node acts as a server. This communication is also secured using mTLS. The server certificate presented by thevirt-handleracting as a migration destination node is the same as the one which is used for the communication between the samevirt-handlerand thevirt-apiin the context of VM lifecycle operations (CN=kubevirt.io:system:node:virt-handler). However, the client certificate which is used by avirt-handlerinstance has the same CN as the client certificate used byvirt-api.Although the migration procedure, where two separate
virt-handlerinstances coordinate the transfer of a VM's state, is not directly tied to the communication betweenvirt-apiandvirt-handlerduring VM lifecycle management, there is a critical overlap in the TLS authentication mechanism. Specifically, the client certificate used by bothvirt-handlerandvirt-apishares the same CN field, despite the use of different, randomly allocated ports, for the two types of communication.PoC
Complete instructions, including specific configuration details, to reproduce the vulnerability.
To illustrate the vulnerability, a Minikube cluster has been deployed with two nodes (
minikubeandminikube-m02) thus, with twovirt-handlerinstances alongside a vmi running on one of the nodes. It is considered that an attacker has obtained access to the client certificate bundle used by thevirt-handlerinstance running on the compromised node (minikube) while the virtual machine is running on the other node (minikube-m02). Thus, they can interact with the sub-resource API exposed by the othervirt-handlerinstance and control the lifecycle of the VMs running on the other node:Impact
What kind of vulnerability is it? Who is impacted?
Due to the peer verification logic in
virt-handler(viaverifyPeerCert), an attacker who compromises avirt-handlerinstance, could exploit these shared credentials to impersonatevirt-apiand execute privileged operations against othervirt-handlerinstances potentially compromising the integrity and availability of the managed by it VM.Severity
CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:HReferences
This data is provided by OSV and the GitHub Advisory Database (CC-BY 4.0).
KubeVirt Arbitrary Container File Read
CVE-2025-64433 / GHSA-qw6q-3pgr-5cwq / GO-2025-4109
More information
Details
Summary
_Short summary of the problem. Make the impact and severity as clear as possible.
Mounting a user-controlled PVC disk within a VM allows an attacker to read any file present in the
virt-launcherpod. This is due to erroneous handling of symlinks defined within a PVC.Details
Give all details on the vulnerability. Pointing to the incriminated source code is very helpful for the maintainer.
A vulnerability was discovered that allows a VM to read arbitrary files from the
virt-launcherpod's file system. This issue stems from improper symlink handling when mounting PVC disks into a VM. Specifically, if a malicious user has full or partial control over the contents of a PVC, they can create a symbolic link that points to a file within thevirt-launcherpod's file system. Sincelibvirtcan treat regular files as block devices, any file on the pod's file system that is symlinked in this way can be mounted into the VM and subsequently read.Although a security mechanism exists where VMs are executed as an unprivileged user with UID
107inside thevirt-launchercontainer, limiting the scope of accessible resources, this restriction is bypassed due to a second vulnerability (TODO: put link here). The latter causes the ownership of any file intended for mounting to be changed to the unprivileged user with UID107prior to mounting. As a result, an attacker can gain access to and read arbitrary files located within thevirt-launcherpod's file system or on a mounted PVC from within the guest VM.PoC
Complete instructions, including specific configuration details, to reproduce the vulnerability.
Consider that an attacker has control over the contents of two PVC (e.g., from within a container) and creates the following symlinks:
By default, Minikube's storage controller (
hostpath-provisioner) will allocate the claim as a directory on the host node (HostPath). Once the above Kubernetes resources are created, the user can create the symlinks within the PVC as follows: