Mercurial > p > roundup > code
diff doc/customizing.txt @ 4880:ca692423e401
Different approach to fix XSS in issue2550817
Encapsulate the error/ok message append method as add_ok_message and
add_error_message. The new approach escapes the messages when appending
-- at a point in the code where we still know where the message comes
from. Escaping is the default but can bei turned off. This also fixes
issue2550836 where certain messages may contain links.
Another advantage of the new fix is that users don't need to change
installed trackers and are secure by default.
| author | Ralf Schlatterbeck <rsc@runtux.com> |
|---|---|
| date | Mon, 31 Mar 2014 18:19:23 +0200 |
| parents | 07014a4b8a49 |
| children | b07014d6a7aa |
line wrap: on
line diff
--- a/doc/customizing.txt Sat Mar 29 11:59:37 2014 +0100 +++ b/doc/customizing.txt Mon Mar 31 18:19:23 2014 +0200 @@ -2958,7 +2958,9 @@ The method will typically check the ``self.form`` variable's contents. It may then: -- add information to ``self.client.ok_message`` or ``self.client.error_message`` +- add information to ``self.client._ok_message`` + or ``self.client._error_message`` (by using ``self.client.add_ok_message`` + or ``self.client.add_error_message``, respectively) - change the ``self.client.template`` variable to alter what the user will see next - raise Unauthorised, SendStaticFile, SendFile, NotFound or Redirect @@ -4993,7 +4995,7 @@ ''' category = self.form['category'].value if category == '-1': - self.client.error_message.append('You must select a category of report') + self.client.add_error_message('You must select a category of report') return # everything's ok, move on to the next page self.client.template = 'add_page2'
