e204d58
diff -up CherryPy-2.2.1/cherrypy/filters/sessionfilter.py.sessionfix CherryPy-2.2.1/cherrypy/filters/sessionfilter.py
e204d58
--- CherryPy-2.2.1/cherrypy/filters/sessionfilter.py.sessionfix	2008-01-06 08:54:39.000000000 -0800
e204d58
+++ CherryPy-2.2.1/cherrypy/filters/sessionfilter.py	2008-01-06 08:55:31.000000000 -0800
e204d58
@@ -326,6 +326,8 @@ class FileStorage:
e204d58
             raise SessionStoragePathNotConfiguredError()
e204d58
         fileName = self.SESSION_PREFIX + id
e204d58
         file_path = os.path.join(storage_path, fileName)
e204d58
+        if not os.path.normpath(filePath).startswith(storagePath):
e204d58
+            raise cherrypy.HTTPError(400, "Invalid session id in cookie.")
e204d58
         return file_path
e204d58
     
e204d58
     def _lock_file(self, path):