Issue Details (XML | Word | Printable)

Key: MODPYTHON-151
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Graham Dumpleton
Reporter: Graham Dumpleton
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
mod_python

PythonDebug exception error page doesn't escape special HTML characters.

Created: 26/Mar/06 07:33 PM   Updated: 11/Apr/07 11:38 AM
Return to search
Component/s: core
Affects Version/s: 2.7.10, 3.1.4, 3.2.8
Fix Version/s: 3.3.1

Time Tracking:
Not Specified

Resolution Date: 26/Mar/06 07:48 PM


 Description  « Hide
When an exception occurs in a handler and PythonDebug is On, an error page is generated and returned to the client. The traceback and details of the exception will be output within a <pre></pre> section, however the content put in the section is included as is and no escaping is performed on special HTML characters. This means that if the details of the exception include any special HTML characters, it can stuff up the formatting of the page and/or information could on face value be lost.

For example the new importer will generate a specific exception where the response from a handler is not of the correct type.

  AssertionError: Handler has returned result or raised SERVER_RETURN
  exception with argument having non integer type. Type of value returned
  was <type 'module'>, whereas expected <type 'int'>.

Because this includes <> characters, it actuall displays in the resultant HTML page as:

  AssertionError: Handler has returned result or raised SERVER_RETURN
  exception with argument having non integer type. Type of value returned
  was , whereas expected .

The error reporter therefore should pass content through cgi.escape().

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Repository Revision Date User Message
ASF #388893 Sun Mar 26 10:47:21 UTC 2006 grahamd Debug error page returned to client when an exception in a handler
occurred wasn't escaping special HTML characters in the traceback or
the details of the exception. (MODPYTHON-151)
Files Changed
MODIFY /httpd/mod_python/trunk/lib/python/mod_python/__init__.py
MODIFY /httpd/mod_python/trunk/Doc/appendixc.tex
MODIFY /httpd/mod_python/trunk/lib/python/mod_python/apache.py
MODIFY /httpd/mod_python/trunk/src/include/mpversion.h

Graham Dumpleton made changes - 26/Mar/06 07:36 PM
Field Original Value New Value
Status Open [ 1 ] In Progress [ 3 ]
Graham Dumpleton made changes - 26/Mar/06 07:48 PM
Resolution Fixed [ 1 ]
Fix Version/s 3.3 [ 12310101 ]
Status In Progress [ 3 ] Resolved [ 5 ]
Graham Dumpleton made changes - 11/Apr/07 11:38 AM
Status Resolved [ 5 ] Closed [ 6 ]