summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2014-11-06 10:34:00 +0100
committerEric Blake <eblake@redhat.com>2014-11-10 09:33:56 -0700
commit220c6b867ca81f9027a7da54d5bc44b43c742d2a (patch)
tree075c9b3f7597cdf4742fc3a825e306062fe9b7b7
parent31674d08fc1b54cd30ad9422ba84090a8b4a3f48 (diff)
downloadlibvirt-220c6b867ca81f9027a7da54d5bc44b43c742d2a.tar.gz
CVE-2014-7823: dumpxml: security hole with migratable flag
Commit 28f8dfd (v1.0.0) introduced a security hole: in at least the qemu implementation of virDomainGetXMLDesc, the use of the flag VIR_DOMAIN_XML_MIGRATABLE (which is usable from a read-only connection) triggers the implicit use of VIR_DOMAIN_XML_SECURE prior to calling qemuDomainFormatXML. However, the use of VIR_DOMAIN_XML_SECURE is supposed to be restricted to read-write clients only. This patch treats the migratable flag as requiring the same permissions, rather than analyzing what might break if migratable xml no longer includes secret information. Fortunately, the information leak is low-risk: all that is gated by the VIR_DOMAIN_XML_SECURE flag is the VNC connection password; but VNC passwords are already weak (FIPS forbids their use, and on a non-FIPS machine, anyone stupid enough to trust a max-8-byte password sent in plaintext over the network deserves what they get). SPICE offers better security than VNC, and all other secrets are properly protected by use of virSecret associations rather than direct output in domain XML. * src/remote/remote_protocol.x (REMOTE_PROC_DOMAIN_GET_XML_DESC): Tighten rules on use of migratable flag. * src/libvirt-domain.c (virDomainGetXMLDesc): Likewise. Signed-off-by: Eric Blake <eblake@redhat.com> (cherry picked from commit b1674ad5a97441b7e1bd5f5ebaff498ef2fbb11b) Conflicts: src/libvirt-domain.c - file split from older src/libvirt.c; context with older virLibConnError src/remote/remote_protocol.x - no fine-grained ACLs Signed-off-by: Eric Blake <eblake@redhat.com>
-rw-r--r--src/libvirt.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libvirt.c b/src/libvirt.c
index 02d5dd94a7..f0061134e3 100644
--- a/src/libvirt.c
+++ b/src/libvirt.c
@@ -4382,7 +4382,8 @@ virDomainGetXMLDesc(virDomainPtr domain, unsigned int flags)
conn = domain->conn;
- if ((conn->flags & VIR_CONNECT_RO) && (flags & VIR_DOMAIN_XML_SECURE)) {
+ if ((conn->flags & VIR_CONNECT_RO) &&
+ (flags & (VIR_DOMAIN_XML_SECURE | VIR_DOMAIN_XML_MIGRATABLE))) {
virLibConnError(VIR_ERR_OPERATION_DENIED, "%s",
_("virDomainGetXMLDesc with secure flag"));
goto error;