Code

Dots are a security hole in filenames
authorSven Velt <sven@velt.de>
Tue, 25 May 2010 14:02:50 +0000 (16:02 +0200)
committerSven Velt <sven@velt.de>
Tue, 25 May 2010 14:02:50 +0000 (16:02 +0200)
Signed-off-by: Sven Velt <sven@velt.de>
nagixsc_conf2http.py

index 3dece813d29ed6c3ffdf4060f333edbaeb27e365..8738d044452471eebc855210e1334df50f4c02b7 100755 (executable)
@@ -102,7 +102,7 @@ class Conf2HTTPHandler(MyHTTPRequestHandler):
                if re.search('\.\.', configfile):
                        self.http_error(500, 'Found ".." in config file name')
                        return
-               if not re.search('^[a-zA-Z0-9-_\.]+$', configfile):
+               if not re.search('^[a-zA-Z0-9-_]+$', configfile):
                        self.http_error(500, 'Config file name contains invalid characters')
                        return