Bug 464818 - libvirt/virsh access unsafe data from xenstored
Summary: libvirt/virsh access unsafe data from xenstored
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: libvirt
Version: 5.4
Hardware: All
OS: Linux
Target Milestone: rc
: ---
Assignee: Daniel Veillard
QA Contact: Virtualization Bugs
Depends On: CVE-2008-4405
TreeView+ depends on / blocked
Reported: 2008-09-30 17:22 UTC by Daniel Berrangé
Modified: 2009-12-14 21:13 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2009-01-22 13:04:53 UTC
Target Upstream Version:

Attachments (Terms of Use)

Description Daniel Berrangé 2008-09-30 17:22:05 UTC
Description of problem:
The location /local/domain/$DOMID  in xenstore is fully writable by guest virtual machines.

Unfortunately, libvirt reads a few pieces of data from here & uses them in ways which are potentially unsafe.

Specifically we read

 - VNC port for graphical framebuffer
 - TTY path for text console

This info is expoed in the libvirt XML, which is then used by other virt enabled applications like virt-manager, virt-install. It is possible that a malicious guest can write bogus data into xenstore which would cause applications using libvirt to perform unsafe actions.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Inside a gueest

 #yum install xen
 # xenstore-write /local/domain/GUEST-DOMID/console/tty /i/am/the/evil/guest

2. On the host

  virsh dumpxml GUEST-NAME | grep console

Actual results:
# virsh dumpxml rhel5pv | grep console
    <console tty='/i/am/the/evil/guest'/>

Expected results:
# virsh dumpxml rhel5pv | grep console
    <console tty='/dev/pty/3'/>

ie, console tty is not impacted by guest. Likewise for VNC port

Additional info:

Comment 1 Daniel Berrangé 2008-10-02 11:39:13 UTC
Upstream xen has revised their original patch dealing with this problem. Instead of moving the 'console' area within xenstore, it is now made read-only to the guest


So the TTY path problem should no longer be an security issue wrt libvirt. We still need to check other usage of xenstore in libvirt to make sure its not using untrusted data. Hopefully nothing will need changing, but I'll leave this open for now, until we've audited libvirt's use of xenstore.

Comment 2 Daniel Berrangé 2009-01-22 13:04:53 UTC
Libvirt usage of XenStore is now safe, following the fixes to XenStore permissions for guest areas.

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