aboutsummaryrefslogtreecommitdiffstats
path: root/main/libvirt/CVE-2014-0179.patch
blob: 11c78285bc5d023065324259bd9aefcefbab2810 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
From 4410a83e18c1b41f1f5d3f10a0b648fc9304bc35 Mon Sep 17 00:00:00 2001
From: Daniel P. Berrange <berrange@redhat.com>
Date: Tue, 15 Apr 2014 11:20:29 +0100
Subject: [PATCH] LSN-2014-0003: Don't expand entities when parsing XML

If the XML_PARSE_NOENT flag is passed to libxml2, then any
entities in the input document will be fully expanded. This
allows the user to read arbitrary files on the host machine
by creating an entity pointing to a local file. Removing
the XML_PARSE_NOENT flag means that any entities are left
unchanged by the parser, or expanded to "" by the XPath
APIs.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
(cherry picked from commit d6b27d3e4c40946efa79e91d134616b41b1666c4)
---
 src/util/virxml.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/util/virxml.c b/src/util/virxml.c
index aa55a33..613e8f0 100644
--- a/src/util/virxml.c
+++ b/src/util/virxml.c
@@ -749,11 +749,11 @@ virXMLParseHelper(int domcode,
 
     if (filename) {
         xml = xmlCtxtReadFile(pctxt, filename, NULL,
-                              XML_PARSE_NOENT | XML_PARSE_NONET |
+                              XML_PARSE_NONET |
                               XML_PARSE_NOWARNING);
     } else {
         xml = xmlCtxtReadDoc(pctxt, BAD_CAST xmlStr, url, NULL,
-                             XML_PARSE_NOENT | XML_PARSE_NONET |
+                             XML_PARSE_NONET |
                              XML_PARSE_NOWARNING);
     }
     if (!xml)
-- 
1.7.1