Download Install Tutorial Docs FAQ Tools WikiLicense Team IRC Planet Involvement Shop Book

Changeset 1775

Show
Ignore:
Timestamp:
10/27/07 12:23:47
Author:
fumanchu
Message:

2.x fix for #744 (Malicious cookies may allow access to files outside the session directory).

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/cherrypy-2.x/cherrypy/filters/sessionfilter.py

    r1585 r1775  
    348348        fileName = self.SESSION_PREFIX + id 
    349349        file_path = os.path.join(storage_path, fileName) 
     350        if not os.path.normpath(file_path).startswith(storage_path): 
     351            raise cherrypy.HTTPError(400, "Invalid session id in cookie.") 
    350352        return file_path 
    351353     

Hosted by WebFaction

Log in as guest/cpguest to create tickets