check_permission is (incorrectly) use security adapters which can check the wrong users permissions

Bug #764406 reported by Henning Eggers
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
High
Henning Eggers

Bug Description

Security adapters are the classes in security.py that adapt to IAuthorization by inheriting from Authorization base. These implement "checkAuthenticated" which gets passed a "user" object. Calling "check_permission" in such an adapter does not pass that user object on to the next adapter but instead will pick the user from the current Zope interaction. Although it is very likely that this will be the same user it still seems wrong because nothing does stop the code from checking permissions for a completely different user than originally requested.

The correct way is to use "getAdapter" to find the right security adapter to refer to and call "checkAuthenticated" on it, passing on the original user object. A helper function (or method on Authoriazation base) to wrap that would be make this easy, too.

Tags: qa-ok

Related branches

summary: - Don't use check_permission in security adapters.
+ check_permission is (incorrectly) use security adapters which can check
+ the wrong users permissions
Changed in launchpad:
status: New → Triaged
importance: Undecided → High
Changed in launchpad:
status: Triaged → In Progress
assignee: nobody → Henning Eggers (henninge)
Revision history for this message
Launchpad QA Bot (lpqabot) wrote :
Changed in launchpad:
milestone: none → 11.05
tags: added: qa-needstesting
Changed in launchpad:
status: In Progress → Fix Committed
William Grant (wgrant)
tags: added: qa-ok
removed: qa-needstesting
Changed in launchpad:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.