|Summary:||CVE-2008-5086 libvirt: missing checks for read-only connection|
|Product:||[Other] Security Response||Reporter:||Tomas Hoger <thoger>|
|Component:||vulnerability||Assignee:||Red Hat Product Security <security-response-team>|
|Status:||CLOSED ERRATA||QA Contact:|
|Version:||unspecified||CC:||berrange, kreilly, meyering, rjones, security-response-team, veillard|
|Fixed In Version:||Doc Type:||Bug Fix|
|Doc Text:||Story Points:||---|
|Last Closed:||2009-03-20 07:36:51 UTC||Type:||---|
|oVirt Team:||---||RHEL 7.3 requirements from Atomic Host:|
|Cloudforms Team:||---||Target Upstream Version:|
|Bug Depends On:||479688, 479689|
Description Tomas Hoger 2008-12-15 16:56:05 UTC
Daniel Berrange discovered that libvirt fails to check whether connection to libvirtd is in read-only or read-write mode, possibly allowing non-privileged users with access to the host machine to perform certain actions that should be restricted to administrative users only. The following methods in libvirt.c are missing a check against the read-only connection flag: virDomainMigrate virDomainMigratePrepare virDomainMigratePerform virDomainMigrateFinish virDomainMigratePrepare2 virDomainMigrateFinish2 virDomainBlockPeek virDomainMemoryPeek virDomainSetAutostart virNetworkSetAutostart virConnectFindStoragePoolSources virStoragePoolSetAutostart In recent versions, libvirt uses PolicyKit to authorize connections from users. Default policy allows any local user to connect in the read-only mode. Older versions of libvirt, or version not compiled with PolicyKit or with PolicyKit authorization disabled, default to allow read-only connections to all local users. Thus out of the box unprivileged local users may be able to migrate VMs, set or unset the autostart flag for domains, networks & storage pools, and access privileged data in the VM memory, or disks. All TCP remote connections are read-write, and fully authenticated, thus not impacted.
Comment 1 Tomas Hoger 2008-12-15 16:56:55 UTC
Created attachment 326995 [details] Upstream patch against 0.5.1
Comment 2 Tomas Hoger 2008-12-15 17:00:38 UTC
In version of libvirt as shipped in Red Hat Enterprise Linux 5, only following APIs are affected: virDomainSetAutostart virDomainMigrate* Additionally, Xen hypervisor does not allow libvirt to set autostart flag for Xen domains.
Comment 4 Tomas Hoger 2008-12-17 17:16:08 UTC
Comment 5 Tomas Hoger 2008-12-18 13:38:25 UTC
As mentioned in the upstream announcement, it is possible to use a work-around to block exploitation of this flaw by changing default setting that allow read-only access to any local user. Steps how to to that depend on what authentication is configured to be used for connections on local unix sockets. libvirt versions built with support for PolicyKit default to PolicyKit authentication and authorization. PolicyKit action org.libvirt.unix.monitor is used as an authorization for read-only access, and is granted to all local users by default. By changing the policy (e.g. using polkit-gnome-authorization), you can restrict this action by default, and only grant it to selected local users (optionally requiring authentication). Alternatively, you can disable PolicyKit authorization by setting auth_unix_ro / auth_unix_rw to none in /etc/libvirt/libvirtd.conf and following instructions below. libvirt versions built without support for PolicyKit (e.g. as used in Red Hat Enterprise Linux 5) use socket file system permissions to control which local users can establish read-only and read-write connections. Two separate sockets are used - libvirt-sock (read-write connections) and libvirt-sock-ro (read-only connections), located in /var/run/libvirt/. Default permissions of those sockets on Red Hat Enterprise Linux 5 are 700 and 777 respectively, orwned by root:root. Those default permissions can be changed by adding following configuration directives to the /etc/libvirt/libvirtd.conf configuration file. If you only want root user to be able to make read-only connections to libvirtd, add: unix_sock_ro_perms = "0700" If you want to allow read-only access to some trusted group of unprivileged users, create new unix group (e.g. virtro) containing all those users and add following to libvirtd.conf: unix_sock_group = "virtro" unix_sock_ro_perms = "0770" You have to restart libvirtd after changing its configuration file for changes to take effect.
Comment 6 Fedora Update System 2008-12-21 08:17:57 UTC
libvirt-0.5.1-2.fc9 has been pushed to the Fedora 9 stable repository. If problems still persist, please make note of it in this bug report.
Comment 7 Fedora Update System 2008-12-21 08:30:36 UTC
libvirt-0.5.1-2.fc10 has been pushed to the Fedora 10 stable repository. If problems still persist, please make note of it in this bug report.
Comment 8 Tomas Hoger 2008-12-30 17:41:40 UTC
Comment 10 errata-xmlrpc 2009-03-19 16:10:06 UTC
This issue has been addressed in following products: Red Hat Enterprise Linux 5 Via RHSA-2009:0382 https://rhn.redhat.com/errata/RHSA-2009-0382.html
Comment 11 Red Hat Product Security 2009-03-20 07:36:51 UTC
This issue was addressed in: Red Hat Enterprise Linux: http://rhn.redhat.com/errata/RHSA-2009-0382.html Fedora: https://admin.fedoraproject.org/updates/F10/FEDORA-2008-11443 https://admin.fedoraproject.org/updates/F9/FEDORA-2008-11433