Skip to content

Commit 5d6f611

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

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.142 2003-10-22 16:47:55 jlgijsbers Exp $
1+
# $Id: client.py,v 1.143 2003-10-24 09:32:19 jlgijsbers Exp $
22

33
__doc__ = """
44
WWW request handler (also used in the stand-alone server).
@@ -970,7 +970,8 @@ def editItemPermission(self, props):
970970
'user'):
971971
return 0
972972
# if the item being edited is the current user, we're ok
973-
if self.nodeid == self.userid:
973+
if (self.nodeid == self.userid
974+
and self.db.user.get(self.nodeid, 'username') != 'anonymous'):
974975
return 1
975976
if self.db.security.hasPermission('Edit', self.userid, self.classname):
976977
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)