Bug 1720118 (CVE-2019-10168)

Summary: CVE-2019-10168 libvirt: arbitrary command execution via virConnectBaselineHypervisorCPU and virConnectCompareHypervisorCPU APIs
Product: [Other] Security Response Reporter: Doran Moppert <dmoppert>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: unspecifiedCC: agedosier, berrange, clalancette, cperry, dblechte, dfediuck, eblake, eedri, erik-fedora, itamar, jdenemar, jforbes, jsuchane, knoel, laine, libvirt-maint, marcandre.lureau, mgoldboi, michal.skrivanek, pkrempa, rbalakri, richard.poettler, rjones, sbonazzo, security-response-team, sherold, sisharma, ssaha, vbellur, veillard, virt-maint, yturgema
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: libvirt 4.10.1, libvirt 5.4.1 Doc Type: If docs needed, set a value
Doc Text:
The virConnectBaselineHypervisorCPU() and virConnectCompareHypervisorCPU() libvirt APIs accept an "emulator" argument to specify the program providing emulation for a domain. Since v1.2.19, libvirt will execute that program to probe the domain's capabilities. Read-only clients could specify an arbitrary path for this argument, causing libvirtd to execute a crafted executable with its own privileges.
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-07-12 13:07:47 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1720494, 1720497, 1720501, 1720509, 1720513, 1720517, 1720521, 1720525, 1721494, 1722466, 1722469    
Bug Blocks: 1718800    

Description Doran Moppert 2019-06-13 07:54:32 UTC
The virConnectBaselineHypervisorCPU() and virConnectCompareHypervisorCPU()
libvirt APIs accept an "emulator" argument to specify the program providing
emulation for a domain.  Since v1.2.19, libvirt will execute that program to
probe the domain's capabilities.  Read-only clients could specify an arbitrary
path for this argument, causing libvirtd to execute a crafted executable with
its own privileges.

Comment 3 Doran Moppert 2019-06-18 04:49:37 UTC
Acknowledgments:

Name: Jan Tomko (Red Hat)

Comment 7 Hardik Vyas 2019-06-19 07:12:46 UTC
Statement:

* This vulnerability requires access to the libvirt socket, normally in /var/run/libvirt/libvirt_sock_ro.  Typically in hypervisor environments, local user accounts are not supported so no untrusted users should be able to access this socket.
* Red Hat Gluster Storage 3 is not affected by this vulnerability as libvirtd daemon is not shipped in Gluster.

Comment 8 Doran Moppert 2019-06-20 02:05:41 UTC
External References:

https://access.redhat.com/libvirt-privesc-vulnerabilities

Comment 9 Doran Moppert 2019-06-20 02:05:44 UTC
Mitigation:

The Unix permissions of libvirt's read-only socket can be made more restrictive than the default (0777) by editing `/etc/libvirt/libvirtd.conf`.  The settings `unix_sock_group = libvirt` and `unix_sock_ro_perms = 0770` will restrict access to only members of `libvirt`, who already have management access to virtual machines.

Comment 11 Doran Moppert 2019-06-20 12:14:26 UTC
Created libvirt tracking bugs for this issue:

Affects: fedora-all [bug 1722466]


Created mingw-libvirt tracking bugs for this issue:

Affects: fedora-all [bug 1722469]

Comment 12 errata-xmlrpc 2019-06-20 15:33:30 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7

Via RHSA-2019:1579 https://access.redhat.com/errata/RHSA-2019:1579

Comment 13 errata-xmlrpc 2019-06-20 15:48:28 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

Via RHSA-2019:1580 https://access.redhat.com/errata/RHSA-2019:1580

Comment 15 errata-xmlrpc 2019-07-08 09:19:08 UTC
This issue has been addressed in the following products:

  Red Hat Virtualization 4 for Red Hat Enterprise Linux 7

Via RHSA-2019:1699 https://access.redhat.com/errata/RHSA-2019:1699

Comment 16 errata-xmlrpc 2019-07-11 16:26:08 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8 Advanced Virtualization

Via RHSA-2019:1762 https://access.redhat.com/errata/RHSA-2019:1762

Comment 17 Product Security DevOps Team 2019-07-12 13:07:47 UTC
This bug is now closed. Further updates for individual products will be reflected on the CVE page(s):

https://access.redhat.com/security/cve/cve-2019-10168