Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Privilege Separation/Escalation
I want to make Vanilla available to a user, but I don't want them to be able to change application settings. They should be able to manage accounts though (to approve new members). For this reason I have created a role "User Admin" that has all options until "Notify by email of new applicants" set, plus "IP addresses visible", "Registration configuration" and "Can view debug info", and created a corresponding user "useradmin". (using Vanilla 1.0.3.)
However, with "Change user roles" unset "useradmin" is unable to approve accounts. The only way to make this work is to set the "Change user roles" options. This however has the potential for privilege escalation: useradmin applies with a new username and assigns this new user Administrator privileges.
Is there intention of making role changing permissions more fine grained?
0
This discussion has been closed.
Comments
Patch below is a temporary workaround to enable applicant approval from role 0 (not DEFAULT_ROLE as that opens up another hole in case DEFAULT_ROLE != 0) to APPROVAL_ROLE. It introduces a new property OldRoleID to the UserRoleHistory class. When the user has "approve applicant" permission, the target role is APPROVAL_ROLE and the OldRoleID is zero the approval is performed.
Something like this:
From your email:
1) Users that have permission to change roles can escalate their own
role via a new user that they can approve and then assign a higher
level role than their own.
I've discussed this on here before. I've placed weights on the roles in Vanilla - but I haven't placed any meaning on those weights yet. It may come in the next revision, but it is unlikely as I've got bigger fish to fry. In the meantime you will have to either (a) trust the people who you give role management permissions implicitly or (b) handle roles yourself.
2) Users with PERMISSION_APPROVE_APPLICANTS can remove *any* user from
the system via a direct URL because of lacking permission checking in
RemoveApplicant(). Permission checking is only performed when the
control panel is being build, but this is insufficient as the URL to
remove a user is easy guessable, f.e.
http://lussumo.com/community/account.php?u=1&PostBackAction=DeclineUser
There is actually a much bigger exploit that is quite similar to this problem, and I have resolved that exploit in subversion. Coincidentally, it solves this problem as well. That url will not work for any user - even if they have the permissions. When the next rev comes out (very soon), a user will need to use Vanilla directly in order for any forms to work - posting or linking externally will not fly.
1. I changed the way approval works in Vanilla as of 1.1. You no longer go to the account page to approve people, so that would explain why you don't see the option there anymore. Instead, you should have access to the settings.php page and from there you can click the "membership applicants" option in the menu to see and approve applicants. If you want more notifications available, you should download the "New Applicants" extension which places a notification above the discussion list when there are new applicants (and you have approve applicants permission).
2. Because the only form a user with "approve applicants" permission can use to approve applicants is on that "membership applicants" page in the settings tab, there is no way for that user to "hack" the AssignRole() method. They will never be able to tell it to use some other roleid, so there is no need to enforce any extra constrictions. If you can prove me wrong, I'd be willing to change it. But otherwise, I don't see the need.