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

Changeset 920

Show
Ignore:
Timestamp:
01/10/06 09:40:43
Author:
rdelon
Message:

Patch for serious security flaw in staticfilter

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/cherrypy/_cputil.py

    r910 r920  
    155155 
    156156 
    157 _HTTPErrorTemplate = '''<html> 
     157_HTTPErrorTemplate = '''<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
     158<html> 
    158159<head> 
    159160    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"></meta> 
    160161    <title>%(status)s</title> 
    161162    <style type="text/css"> 
    162     #poweredBy { 
     163    #powered_by { 
    163164        margin-top: 20px; 
    164165        border-top: 2px solid black; 
     
    175176        <p>%(message)s</p> 
    176177        <pre id="traceback">%(traceback)s</pre> 
    177     <div id="poweredBy"> 
     178    <div id="powered_by"> 
    178179    <span>Powered by <a href="http://www.cherrypy.org">CherryPy %(version)s</a></span> 
    179180    </div> 
  • trunk/cherrypy/filters/staticfilter.py

    r900 r920  
    3939            extraPath = urllib.unquote(extraPath) 
    4040            # If extraPath is "", filename will end in a slash 
     41            if '..' in extraPath: 
     42                # Disallow '..' (secutiry flaw) 
     43                raise cherrypy.HTTPError(403) # Forbidden 
    4144            filename = os.path.join(staticDir, extraPath) 
    4245         

Hosted by WebFaction

Log in as guest/cpguest to create tickets