The virDomainManagedSaveDefineXML can be used to alter the domain's
config used for managedsave or even execute arbitrary emulator binaries.
Forbid it on read-only connections.
Fixes: CVE-2019-10166
Reported-by: Matthias Gerstner <mgerstner(a)suse.de>
Signed-off-by: Ján Tomko <jtomko(a)redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
src/libvirt-domain.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c
index b15726caa9..6355f497ce 100644
--- a/src/libvirt-domain.c
+++ b/src/libvirt-domain.c
@@ -9570,6 +9570,7 @@ virDomainManagedSaveDefineXML(virDomainPtr domain, const char
*dxml,
virCheckDomainReturn(domain, -1);
conn = domain->conn;
+ virCheckReadOnlyGoto(conn->flags, error);
if (conn->driver->domainManagedSaveDefineXML) {
int ret;
--
2.20.1