areguera / rpms / mailman

Forked from rpms/mailman 4 years ago
Clone

Blame SOURCES/mailman-2.1.15-CVE-2015-2775.patch

7812c9
=== modified file 'Mailman/Defaults.py.in'
7812c9
--- a/Mailman/Defaults.py.in	2015-02-13 18:41:28 +0000
7812c9
+++ b/Mailman/Defaults.py.in	2015-03-27 18:10:39 +0000
7812c9
@@ -138,7 +138,7 @@
7812c9
 
7812c9
 # A Python regular expression character class which defines the characters
7812c9
 # allowed in list names.  Lists cannot be created with names containing any
7812c9
-# character that doesn't match this class.
7812c9
+# character that doesn't match this class.  Do not include '/' in this list.
7812c9
 ACCEPTABLE_LISTNAME_CHARACTERS = '[-+_.=a-z0-9]'
7812c9
 
7812c9
 
7812c9
7812c9
=== modified file 'Mailman/Utils.py'
7812c9
--- a/Mailman/Utils.py	2015-01-23 23:50:47 +0000
7812c9
+++ b/Mailman/Utils.py	2015-03-27 18:14:06 +0000
7812c9
@@ -100,6 +100,12 @@
7812c9
     #
7812c9
     # The former two are for 2.1alpha3 and beyond, while the latter two are
7812c9
     # for all earlier versions.
7812c9
+    #
7812c9
+    # But first ensure the list name doesn't contain a path traversal
7812c9
+    # attack.
7812c9
+    if len(re.sub(mm_cfg.ACCEPTABLE_LISTNAME_CHARACTERS, '', listname)) > 0:
7812c9
+        syslog('mischief', 'Hostile listname: %s', listname)
7812c9
+        return False
7812c9
     basepath = Site.get_listpath(listname)
7812c9
     for ext in ('.pck', '.pck.last', '.db', '.db.last'):
7812c9
         dbfile = os.path.join(basepath, 'config' + ext)
7812c9