Skip to content

Commit e1e749f

Browse files
author
Johannes Gijsbers
committed
Anonymous user can no longer edit or view itself.
This fixes a security bug [SF#828901].
1 parent 33110aa commit e1e749f

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

roundup/cgi/client.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $Id: client.py,v 1.130.2.2 2003-08-28 04:53:04 richard Exp $
1+
# $Id: client.py,v 1.130.2.3 2003-10-24 09:31:13 jlgijsbers Exp $
22

33
__doc__ = """
44
WWW request handler (also used in the stand-alone server).
@@ -1031,7 +1031,8 @@ def editItemPermission(self, props):
10311031
'user'):
10321032
return 0
10331033
# if the item being edited is the current user, we're ok
1034-
if self.nodeid == self.userid:
1034+
if (self.nodeid == self.userid
1035+
and self.db.user.get(self.nodeid, 'username') != 'anonymous'):
10351036
return 1
10361037
if self.db.security.hasPermission('Edit', self.userid, self.classname):
10371038
return 1

roundup/cgi/templating.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -807,14 +807,16 @@ def is_edit_ok(self):
807807
Also check whether this is the current user's info.
808808
'''
809809
return self._db.security.hasPermission('Edit', self._client.userid,
810-
self._classname) or self._nodeid == self._client.userid
810+
self._classname) or (self._nodeid == self._client.userid and
811+
self._db.user.get(self._client.userid, 'username') != 'anonymous')
811812

812813
def is_view_ok(self):
813814
''' Is the user allowed to View the current class?
814815
Also check whether this is the current user's info.
815816
'''
816817
return self._db.security.hasPermission('Edit', self._client.userid,
817-
self._classname) or self._nodeid == self._client.userid
818+
self._classname) or (self._nodeid == self._client.userid and
819+
self._db.user.get(self._client.userid, 'username') != 'anonymous')
818820

819821
class HTMLProperty:
820822
''' String, Number, Date, Interval HTMLProperty

0 commit comments

Comments
 (0)