diff roundup/cgi/templating.py @ 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 302c967d710c
children c120f747e0b4
line wrap: on
line diff
--- a/roundup/cgi/templating.py	Sat Mar 29 11:59:37 2014 +0100
+++ b/roundup/cgi/templating.py	Mon Mar 31 18:19:23 2014 +0200
@@ -740,8 +740,8 @@
 
         # use our fabricated request
         args = {
-            'ok_message': self._client.ok_message,
-            'error_message': self._client.error_message
+            'ok_message': self._client._ok_message,
+            'error_message': self._client._error_message
         }
         return pt.render(self._client, self.classname, req, **args)
 

Roundup Issue Tracker: http://roundup-tracker.org/