Bug 476560 - (CVE-2008-5086) CVE-2008-5086 libvirt: missing checks for read-only connection
CVE-2008-5086 libvirt: missing checks for read-only connection
Status: CLOSED ERRATA
Product: Security Response
Classification: Other
Component: vulnerability (Show other bugs)
unspecified
All Linux
medium Severity medium
: ---
: ---
Assigned To: Red Hat Product Security
source=redhat,reported=20081212,publi...
: Security
Depends On: 479688 479689
Blocks:
  Show dependency treegraph
 
Reported: 2008-12-15 11:56 EST by Tomas Hoger
Modified: 2011-05-05 04:44 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-03-20 03:36:51 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Upstream patch against 0.5.1 (4.89 KB, patch)
2008-12-15 11:56 EST, Tomas Hoger
no flags Details | Diff

  None (edit)
Description Tomas Hoger 2008-12-15 11:56:05 EST
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 11:56:55 EST
Created attachment 326995 [details]
Upstream patch against 0.5.1
Comment 2 Tomas Hoger 2008-12-15 12:00:38 EST
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 12:16:08 EST
Public now via:
  https://www.redhat.com/archives/libvir-list/2008-December/msg00522.html
Comment 5 Tomas Hoger 2008-12-18 08:38:25 EST
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 03:17:57 EST
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 03:30:36 EST
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 10 errata-xmlrpc 2009-03-19 12:10:06 EDT
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 12 errata-xmlrpc 2011-05-05 04:44:49 EDT
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

Note You need to log in before you can comment on or make changes to this bug.