Commit a09a96a5 authored by Georg Brandl's avatar Georg Brandl

HTML-escape the plain traceback in cgitb's HTML output, to prevent

the traceback inadvertently or maliciously closing the comment and
injecting HTML into the error page.
parent 8be9ab84
...@@ -183,7 +183,8 @@ function calls leading up to the error, in the order they occurred.</p>''' ...@@ -183,7 +183,8 @@ function calls leading up to the error, in the order they occurred.</p>'''
%s %s
--> -->
''' % ''.join(traceback.format_exception(etype, evalue, etb)) ''' % pydoc.html.escape(
''.join(traceback.format_exception(etype, evalue, etb)))
def text((etype, evalue, etb), context=5): def text((etype, evalue, etb), context=5):
"""Return a plain text document describing a given traceback.""" """Return a plain text document describing a given traceback."""
......
...@@ -207,6 +207,10 @@ Core and builtins ...@@ -207,6 +207,10 @@ Core and builtins
Library Library
------- -------
- HTML-escape the plain traceback in cgitb's HTML output, to prevent
the traceback inadvertently or maliciously closing the comment and
injecting HTML into the error page.
- The popen2 module and os.popen* are deprecated. Use the subprocess module. - The popen2 module and os.popen* are deprecated. Use the subprocess module.
- Added an optional credentials argument to SMTPHandler, for use with SMTP - Added an optional credentials argument to SMTPHandler, for use with SMTP
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment