CVE-2016-1000003 (published 2016-10-07T18:59Z)

Mirror Manager version 0.7.2 and older is vulnerable to remote code execution in the checkin code.

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.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H)

Weakness information:
cwe_id: CWE-94
cwe_name: Improper Control of Generation of Code ('Code Injection')
description: The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.
extended_description: 
            When a product allows a user's input to contain code syntax, it might be possible for an attacker to craft the code in such a way that it will alter the intended control flow of the product. Such an alteration could lead to arbitrary code execution.
            Injection problems encompass a wide variety of issues -- all mitigated in very different ways. For this reason, the most effective way to discuss these weaknesses is to note the distinct features which classify them as injection weaknesses. The most important issue to note is that all injection problems share one thing in common -- i.e., they allow for the injection of control plane data into the user-controlled data plane. This means that the execution of the process may be altered by sending code in through legitimate data channels, using no other mechanism. While buffer overflows, and many other flaws, involve the use of some further issue to gain execution, injection problems need only for the data to be parsed. The most classic instantiations of this category of weakness are SQL injection and format string vulnerabilities.
         
         

Fix information:
repo_url: https://github.com/fedora-infra/mirrormanager2
commit_details: repo_url: https://github.com/fedora-infra/mirrormanager2
author: Patrick Uiterwijk
author_date: 2016-06-17 19:09:13+00:00
msg: Update client to use json serialization

This changes the client to use json serialization rather than
pickles.

Related: CVE-2016-1000003
Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
repository: repo_url: https://github.com/fedora-infra/mirrormanager2
repo_name: fedora-infra/mirrormanager2
description: Rewrite of the MirrorManager application in Flask and SQLAlchemy
repo_language: Python
owner: fedora-infra
file_changes: filename: report_mirror
change_type: ModificationType.MODIFY
diff: @@ -1,7 +1,7 @@
 #!/usr/bin/python
 
 import os, sys
-import pickle
+import json
 import ConfigParser
 import pprint
 import xmlrpclib
@@ -186,7 +186,7 @@ def get_stats(conf, section):
             try:
                 f = open(fn, 'r')
                 contents = contents + f.readlines()
-                statsdata[name] = pickle.dumps(contents, -1)
+                statsdata[name] = json.dumps(contents, -1)
                 f.close()
             except:
                 pass
@@ -284,7 +284,7 @@ def main():
     get_exclude_dir_patterns_from_file(options)
     if options.input:
         infile = open(options.input, 'rb')
-        item.config = pickle.load(infile)
+        item.config = json.load(infile)
         infile.close()
         if not config(options.config, item, crawl=False):
             sys.exit(1)
@@ -292,7 +292,7 @@ def main():
         if not config(options.config, item, crawl=True):
             sys.exit(1)
 
-    p = pickle.dumps(item.config, -1)
+    p = json.dumps(item.config, -1)
 
     if options.debug:
         pp = pprint.PrettyPrinter(indent=4)

programming_language: Python
repo_url: https://github.com/fedora-infra/mirrormanager2
commit_details: repo_url: https://github.com/fedora-infra/mirrormanager2
author: Patrick Uiterwijk
author_date: 2016-06-17 18:32:34+00:00
msg: Allow submission of checkin information via json

This means we still allow pickle submissions as a stopgap until we
manage to convince admins to move to json submissions.

Related: CVE-2016-1000003
Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
repository: repo_url: https://github.com/fedora-infra/mirrormanager2
repo_name: fedora-infra/mirrormanager2
description: Rewrite of the MirrorManager application in Flask and SQLAlchemy
repo_language: Python
owner: fedora-infra
file_changes: filename: xmlrpc.py
change_type: ModificationType.MODIFY
diff: @@ -25,6 +25,7 @@ MirrorManager2 xmlrpc controller.
 
 import base64
 import pickle
+import json
 import bz2
 
 import flask
@@ -41,7 +42,11 @@ XMLRPC.connect(APP, '/xmlrpc')
 
 @XMLRPC.register
 def checkin(pickledata):
-    config = pickle.loads(bz2.decompress(base64.urlsafe_b64decode(pickledata)))
+    uncompressed = bz2.decompress(base64.urlsafe_b64decode(pickledata))
+    try:
+        config = json.loads(uncompressed)
+    except ValueError:
+        config = pickle.loads(uncompressed)
     r, message = read_host_config(SESSION, config)
     if r is not None:
         return message + 'checked in successful'

programming_language: Python