Skip to content

Commit 50a007a

Browse files
committed
Fix another XSS with the "otk" parameter.
Thanks to Jesse Ruderman for reporting.
1 parent 0088b8f commit 50a007a

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

CHANGES.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ Fixed:
7575
the patch.
7676
- Fix override of TemplatingUtils in instance.py, thanks to Cheer Xiao
7777
for the patch.
78+
- Fix another XSS with the "otk" parameter, thanks to Jesse Ruderman for
79+
reporting. (Ralf)
7880

7981

8082
2011-07-15: 1.4.19

doc/acknowledgements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ Bernhard Reiter,
118118
Roy Rapoport,
119119
John P. Rouillard,
120120
Luke Ross,
121+
Jesse Ruderman,
121122
Ollie Rutherfurd,
122123
Toby Sargeant,
123124
Giuseppe Scelsi,

roundup/backends/sessions_dbm.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
import os, marshal, time
1010

11+
from cgi import escape
1112
from roundup import hyperdb
1213
from roundup.i18n import _
1314
from roundup.anypy.dbm_ import anydbm, whichdb, key_in
@@ -64,7 +65,7 @@ def get(self, infoid, value, default=_marker):
6465
else:
6566
if default != self._marker:
6667
return default
67-
raise KeyError('No such %s "%s"'%(self.name, infoid))
68+
raise KeyError('No such %s "%s"'%(self.name, escape(infoid)))
6869
return values.get(value, None)
6970
finally:
7071
db.close()
@@ -77,7 +78,7 @@ def getall(self, infoid):
7778
del d['__timestamp']
7879
return d
7980
except KeyError:
80-
raise KeyError('No such %s "%s"'%(self.name, infoid))
81+
raise KeyError('No such %s "%s"'%(self.name, escape(infoid)))
8182
finally:
8283
db.close()
8384

roundup/backends/sessions_rdbms.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
__docformat__ = 'restructuredtext'
88

99
import os, time
10+
from cgi import escape
1011

1112
class BasicDatabase:
1213
''' Provide a nice encapsulation of an RDBMS table.
@@ -35,7 +36,7 @@ def get(self, infoid, value, default=_marker):
3536
if not res:
3637
if default != self._marker:
3738
return default
38-
raise KeyError('No such %s "%s"'%(self.name, infoid))
39+
raise KeyError('No such %s "%s"'%(self.name, escape(infoid)))
3940
values = eval(res[0])
4041
return values.get(value, None)
4142

@@ -45,7 +46,7 @@ def getall(self, infoid):
4546
n, n, self.db.arg), (infoid,))
4647
res = self.cursor.fetchone()
4748
if not res:
48-
raise KeyError('No such %s "%s"'%(self.name, infoid))
49+
raise KeyError('No such %s "%s"'%(self.name, escape (infoid)))
4950
return eval(res[0])
5051

5152
def set(self, infoid, **newvalues):

0 commit comments

Comments
 (0)