aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Sapiro <msapiro@value.net>2011-04-25 16:26:13 -0700
committerMark Sapiro <msapiro@value.net>2011-04-25 16:26:13 -0700
commit7ef6c582816cb349f240054064d495753a916408 (patch)
tree57ab4a00cad7b892e8ef64ac58237ef0c2d30a7b
parent9bc9d9c391b0726d9b4538a79732f24f7d974443 (diff)
downloadmailman2-7ef6c582816cb349f240054064d495753a916408.tar.gz
mailman2-7ef6c582816cb349f240054064d495753a916408.tar.xz
mailman2-7ef6c582816cb349f240054064d495753a916408.zip
Strengthened escaping of user web data by including some characters that
some older browsers misinterpret as < or >.
-rw-r--r--Mailman/Utils.py8
-rw-r--r--NEWS3
2 files changed, 11 insertions, 0 deletions
diff --git a/Mailman/Utils.py b/Mailman/Utils.py
index 847e450e..9a29662b 100644
--- a/Mailman/Utils.py
+++ b/Mailman/Utils.py
@@ -425,7 +425,15 @@ def check_global_password(response, siteadmin=True):
_ampre = re.compile('&amp;((?:#[0-9]+|[a-z]+);)', re.IGNORECASE)
+# Characters misinterpreted as < or > by some broken browsers.
+_broken_browser = {'\x8b': '&#8249;',
+ '\x9b': '&#8250;',
+ '\xbc': '&#188;',
+ '\xbd': '&#190;',
+ }
def websafe(s):
+ for k in _broken_browser:
+ s = s.replace(k, _broken_browser[k])
# Don't double escape html entities
return _ampre.sub(r'&\1', cgi.escape(s, quote=True))
diff --git a/NEWS b/NEWS
index 394d596a..8ee35b09 100644
--- a/NEWS
+++ b/NEWS
@@ -43,6 +43,9 @@ Here is a history of user visible changes to Mailman.
Bug Fixes and other patches
+ - Strengthened escaping of user web data by including some characters that
+ some older browsers misinterpret as < or >.
+
- Mailman now sets the 'secure' flag in cookies set via https URLs.
Bug #770377.