User with "admin_group_members" can still invite other groups to gain owner access (CVE-2023-6396 bypass)
A user holding a custom role based on Guest that grants group-member administration could still invite a group at the owner role, or raise an existing member to owner, despite a prior fix restricting such invitations. This let the attacker escalate from a low custom role to full owner of the target group.
GitLab
Originally disclosed on GitLab
- Fixed in 3 months
- Disclosed after 3 months
⚠️ Please read the process on how to fix security issues before starting to work on the issue. Vulnerabilities must be fixed in a security mirror.
HackerOne report #2270898 by joaxcar on 2023-12-03, assigned to @rshambhuni:
Report | How To Reproduce
Report
Summary
GitLab 16.6.1 patched a fix where users with the custom role "admin_group_membsers" could invite users at a higher role than the custom roles base role. This restriction is now in place, but in groups that allow for users to request access (public or internal groups) a user with this custom role can still take ownership of the group by inviting a group instead of inviting a "member"
An attack would look like this
- A user gets assigned a custom role based on Guest that allows for
admin_group_user - The user creates another group where it will become
owner - Then the attacker invites this new group at "max membership role" as
owner - The attacker will now be owner of the target group
Steps to reproduce
Preconditions:
- Start a new Ultimate trial on Gitlab.com
- Create two users
victim_user,attacker_user - Create a
privategroupprivate_ultimate_groupasvictim_user - Go to https://gitlab.com/groups/GROUPNAME/-/settings/roles_and_permissions
- Create a custom role with
admin_group_memberchecked, based onguest. Call it "guest manager" - Go to https://gitlab.com/groups/GROUPNAME/-/group_members and invite
attacker_useras "guest manager"
The attack:
7. Log in as attacker_user
8. Create a new group called attacker_group
9. Go to https://gitlab.com/groups/private_ultimate_group/-/group_members
Scenario 1
- Click "Invite group"
- Search for
attacker_groupand select it. Also select "Role" asowner - Click invite
- Refresh the page and the attacker should now be
ownerof the group with full owner access
Scenario 2
- Find existing group member (it can be attacker's second account they added as guest)
- Change it to any role higher than guest, eg. owner
- Refresh the page and the existing member should now be
ownerof the group with full owner access
Impact
Privilege escalation from low custom role to group owner
What is the current bug behavior?
Custom role users can invite groups at higher role level than itself
What is the expected correct behavior?
Custom roles should only be allowed to invite groups at max their own level
Output of checks
This bug happens on GitLab.com
Impact
Privilege escalation from low custom role to group owner
Impact
Privilege escalation from low custom role to group owner
How To Reproduce
Please add reproducibility information to this section:
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the permission check on inviting a group (and on changing an existing member's role) did not compare the requested role against the inviter's own maximum role, only the member-invite path was restricted.
Impact
Privilege escalation from a low custom role to full group owner, giving the attacker owner access to the group.
What the attacker needed
Ultimate tier group; attacker holds a custom Guest-based role; custom role grants group-member admin
How it was found
- Create a private group as the victim and add a custom role based on Guest with group-member administration enabled.
- Invite the attacker as that custom role.
- As the attacker, create a new group where the attacker is owner.
- In the target group's members page, invite the attacker's group with the owner role.
- Refresh and the attacker is now owner of the target group.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A custom role is a set of extra permissions layered on top of a basic role such as Guest. The earlier fix stopped these users from inviting people at a higher role, but it did not cover inviting whole groups or changing existing members. So the attacker could still make themselves owner, which means full control of the group.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.