-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Open
Description
We should investigate following scenario and possibly mitigate it.
originally tested by @bickelj
- Created users
- Created two groups,
test-groupandtest-group-admin - Created a permission to view, view members, manage on the
test-groupusing a policy of checking whether a user is in thetest-group-admingroup. - Verified that the member of one user in
test-group-adminwas able to listtest-groupviacurl .../admin/realms/the-realm/groups/[group-uuid]/membersusing a token fromthe-realm(rather than master realm token). - Found the call in Firefox dev tools that did the
PUT /admin...from (3). - Made a call (using a master realm admin token) using cURL substituting the Organization X UUID in place of the Group
test-usersUUID to replace that permission. This call succeeded with201 Created. - Tried to list the organization members like (4) above as the user, because (6) essentially said "members of the
test-group-adminshould be able to view organization X members". Got a 403 Forbidden 😞. - Looked in the Admin UI and the modified permission now shows up as applying to All groups 🤔.
- Tried a call to list members of the
test-group(I should not have permission to do this) using a realm token for the user intest-group-admin, basically a repeat of (4). This should not have worked because I used the Organization X UUID to replace the rule from (3). But it actually succeeded 😱. So by substituting Organization X UUID I accidentally elevated the privileges oftest-group-adminusers to be able to do all those things in the permissions to all groups! This does not seem good to me, how about to you?
Originally posted by @bickelj in #37133 (reply in thread)