I've noticed that with the classic tracker's schema
concerning queries, any
user can edit any and all queries regardless of whether they
created it or
marked as private despite the following in schema.py:
# Users should be able to edit and view their own queries.
# They should also be able to view any marked as not
private.
# They should not be able to edit others' queries, even if
they're not private.
def view_query(db, userid, itemid):
private_for = db.query.get(itemid, 'private_for')
if not private_for: return True
return userid == private_for
def edit_query(db, userid, itemid):
return userid == db.query.get(itemid, 'creator')
p = db.security.addPermission(name='View', klass='query',
check=view_query,
description="User is allowed to view their own and
public queries")
db.security.addPermissionToRole('User', p)
p = db.security.addPermission(name='Edit', klass='query',
check=edit_query,
description="User is allowed to edit their
queries")
db.security.addPermissionToRole('User', p)
p = db.security.addPermission(name='Create', klass='query',
description="User
is allowed to create queries")
db.security.addPermissionToRole('User', p)
All it takes is to point the browser at the query class
instead of a particular
query. The generic template allows editing an entire class
if create permission
is granted on the class (which it must be in the case of
queries to allow users
to create their own queries).
How should I plug this apparent security hole?
Creating a new template that simply does not allow editing
the query class as a
whole is not enough as a template argument (or a
carefully hand built URL) can
be used to work around this.
Any ideas. Am I missing something?
Bruce
------------------------------------------------------------
-------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the
chance to share your
opinions on IT & business topics through brief
surveys-and earn cash
http://www.techsay.com/default.
php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Roundup-users mailing list
Roundup-users lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/roundup-u
sers
|