Re: [Python-Dev] Use of cgi.escape can lead to XSS vulnerabilities

2010-06-23 Thread James Y Knight
On Jun 22, 2010, at 5:14 PM, Craig Younkins wrote: I suggest rewording the documentation for the method making it more clear what it should and should not be used for. I would like to see the method changed to properly escape single-quotes, but if it is not changed, the documentation shoul

Re: [Python-Dev] Use of cgi.escape can lead to XSS vulnerabilities

2010-06-23 Thread Craig Younkins
http://bugs.python.org/issue9061 On Tue, Jun 22, 2010 at 5:29 PM, Bill Janssen wrote: > Craig Younkins wrote: > > > cgi.escape never escapes single quote characters, which can easily lead > to a > > Cross-Site Scripting (XSS) vulnerability. This seems to be known by many, > > but a quick search

Re: [Python-Dev] Use of cgi.escape can lead to XSS vulnerabilities

2010-06-22 Thread Bill Janssen
Craig Younkins wrote: > cgi.escape never escapes single quote characters, which can easily lead to a > Cross-Site Scripting (XSS) vulnerability. This seems to be known by many, > but a quick search reveals many are using cgi.escape for HTML attribute > escaping. Did you file a bug report? Bill

[Python-Dev] Use of cgi.escape can lead to XSS vulnerabilities

2010-06-22 Thread Craig Younkins
Hello, The method in question: http://docs.python.org/library/cgi.html#cgi.escape http://svn.python.org/view/python/tags/r265/Lib/cgi.py?view=markup # at the bottom "Convert the characters '&', '<' and '>' in string s to HTML-safe sequences. Use this if you need to display text that might conta