CVE-2020-1693 (published 2020-02-17T20:15Z)

A flaw was found in Spacewalk up to version 2.9 where it was vulnerable to XML internal entity attacks via the /rpc/api endpoint. An unauthenticated remote attacker could use this flaw to retrieve the content of certain files and trigger a denial of service, or in certain circumstances, execute arbitrary code on the Spacewalk server.

Severity: HIGH
CVSS v2 base score: 7.5 (AV:N/AC:L/Au:N/C:P/I:P/A:P)
CVSS v3 base score: 9.8, CRITICAL (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H)

Weakness information:
cwe_id: CWE-611
cwe_name: Improper Restriction of XML External Entity Reference
description: The product processes an XML document that can contain XML entities with URIs that resolve to documents outside of the intended sphere of control, causing the product to embed incorrect documents into its output.
extended_description: 
            XML documents optionally contain a Document Type Definition (DTD), which, among other features, enables the definition of XML entities. It is possible to define an entity by providing a substitution string in the form of a URI. The XML parser can access the contents of this URI and embed these contents back into the XML document for further processing.
            By submitting an XML file that defines an external entity with a file:// URI, an attacker can cause the processing application to read the contents of a local file. For example, a URI such as "file:///c:/winnt/win.ini" designates (in Windows) the file C:\Winnt\win.ini, or file:///etc/passwd designates the password file in Unix-based systems. Using URIs with other schemes such as http://, the attacker can force the application to make outgoing requests to servers that the attacker cannot reach directly, which can be used to bypass firewall restrictions or hide the source of attacks such as port scanning.
            Once the content of the URI is read, it is fed back into the application that is processing the XML. This application may echo back the data (e.g. in an error message), thereby exposing the file contents.
         
         

Fix information:
repo_url: https://github.com/spacewalkproject/spacewalk
commit_details: repo_url: https://github.com/spacewalkproject/spacewalk
author: Michael Mraka
author_date: 2020-01-16 14:28:39+01:00
msg: 1791164 - disable external entity parsing
repository: repo_url: https://github.com/spacewalkproject/spacewalk
repo_name: spacewalkproject/spacewalk
description: The master repository for the Spacewalk Project.
repo_language: Java
owner: spacewalkproject
file_changes: filename: redstone-xmlrpc.spec
change_type: ModificationType.MODIFY
diff: @@ -9,6 +9,7 @@ Patch0: build-classpath.patch
 Patch1: fault_serialization.patch
 Patch2: escaping_string_serialization.path
 Patch3: xxe.patch
+Patch4: xxe2.patch
 %if 0%{?fedora} || 0%{?rhel} >=7
 BuildRequires: javapackages-tools
 BuildRequires: jboss-servlet-2.5-api
@@ -34,6 +35,7 @@ a simple xmlrpc library for java
 %patch1 -p0
 %patch2 -p0
 %patch3 -p0
+%patch4 -p0
 rm lib/javax.servlet.jar
 build-jar-repository -p lib/ %third_party_jars
 

programming_language: Markdown
filename: xxe2.patch
change_type: ModificationType.ADD
diff: @@ -0,0 +1,11 @@
+diff '--exclude=CVS' '--exclude=.svn' -ur ../xmlrpc-orig/source/redstone/xmlrpc/XmlRpcParser.java ../xmlrpc/source/redstone/xmlrpc/XmlRpcParser.java
+--- source/redstone/xmlrpc/XmlRpcParser.java	2020-01-16 14:18:28.294284905 +0100
++++ source/redstone/xmlrpc/XmlRpcParser.java	2020-01-16 14:21:57.985203925 +0100
+@@ -135,6 +135,7 @@
+                 {
+                     reader = XMLReaderFactory.createXMLReader();
+                     reader.setEntityResolver(new DummyEntityResolver());
++                    reader.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
+                 }
+                 catch ( SAXException e )
+                 {

programming_language: Markdown