Описание
A flaw was found in KubeVirt's virt-handler network cache handling. The WriteToCachedFile function writes data to a launcher-rooted path using os.WriteFile and os.Chown without symlink protection. A user with access to the virt-launcher container can plant a symlink at the cache file path, causing virt-handler to follow it and overwrite an arbitrary host file with JSON content and change its ownership.
Отчет
This flaw affects OpenShift Virtualization deployments where virtual machines are configured with bridge or other non-masquerade network interfaces. The default network binding mode in OpenShift Virtualization is masquerade, which does not trigger the vulnerable code path — exploitation requires a cluster administrator to have pre-configured a NetworkAttachmentDefinition with bridge-type binding, a condition beyond the attacker's control. Additionally, the attacker must have exec access to the virt-launcher container (not merely VM guest console access). The file content written by the exploit is constrained to valid JSON following the network cache schema — arbitrary byte injection is not possible. On OpenShift Container Platform, SELinux mandatory access controls in enforcing mode restrict the set of host files writable by the virt-handler process, and base OS binaries under /usr/ are protected by RHCOS read-only ostree layers. However, host configuration files under /etc/ and data under /var/ are potentially reachable depending on virt-handler's SELinux context. Red Hat rates this as Moderate impact because exploitation requires non-default network configuration, container-level access beyond standard VM user privileges, and the content constraint significantly limits the attacker's ability to achieve meaningful host compromise.
Меры по смягчению последствий
Ensure virtual machines use the default masquerade network binding mode where possible. Restrict pods/exec access on virt-launcher pods to only trusted administrators. Review and restrict NetworkAttachmentDefinition resources to limit which namespaces can configure bridge-type network interfaces.
Затронутые пакеты
| Платформа | Пакет | Состояние | Рекомендация | Релиз |
|---|---|---|---|---|
| Red Hat OpenShift Virtualization 4 | container-native-virtualization/virt-handler | Fix deferred | ||
| Red Hat OpenShift Virtualization 4 | container-native-virtualization/virt-handler-rhel9 | Fix deferred |
Показывать по
Дополнительная информация
Статус:
4.2 Medium
CVSS3
Связанные уязвимости
A flaw was found in KubeVirt's virt-handler network cache handling. The WriteToCachedFile function writes data to a launcher-rooted path using os.WriteFile and os.Chown without symlink protection. A user with access to the virt-launcher container can plant a symlink at the cache file path, causing virt-handler to follow it and overwrite an arbitrary host file with JSON content and change its ownership.
Kubevirt: kubevirt: symlink following in writetocachedfile allows host file overwrite from virt-launcher
A flaw was found in KubeVirt's virt-handler network cache handling. The WriteToCachedFile function writes data to a launcher-rooted path using os.WriteFile and os.Chown without symlink protection. A user with access to the virt-launcher container can plant a symlink at the cache file path, causing virt-handler to follow it and overwrite an arbitrary host file with JSON content and change its ownership.
4.2 Medium
CVSS3