Update of /cvsroot/mailman/mailman/Mailman/Cgi
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22550
Modified Files:
Tag: Release_2_1-maint
private.py
Log Message:
Checkin for initial workaround for directry traverse flaw in private.py.
This is for the people who think 'CVS should be safe' and not final solution.
Index: private.py
===================================================================
RCS file: /cvsroot/mailman/mailman/Mailman/Cgi/private.py,v
retrieving revision 2.16.2.1
retrieving revision 2.16.2.2
diff -u -d -r2.16.2.1 -r2.16.2.2
--- private.py 8 Feb 2003 07:13:50 -0000 2.16.2.1
+++ private.py 10 Feb 2005 03:57:00 -0000 2.16.2.2
@@ -35,13 +35,16 @@
_ = i18n._
i18n.set_language(mm_cfg.DEFAULT_SERVER_LANGUAGE)
+SLASH = '/'
+
def true_path(path):
"Ensure that the path is safe by removing .."
- path = path.replace('../', '')
- path = path.replace('./', '')
- return path[1:]
+ # Workaround for path traverse vulnerablity. Unsuccessfull attempt
+ # will be logged in logs/error, anyway.
+ parts = [x for x in path.split(SLASH) if x not in ('.', '..')]
+ return SLASH.join(parts)[1:]
_______________________________________________
Mailman-checkins mailing list
[email protected]
Unsubscribe:
http://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org