Skip to content
Access control Disclosed report Intermediate

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

  1. A user gets assigned a custom role based on Guest that allows for admin_group_user
  2. The user creates another group where it will become owner
  3. Then the attacker invites this new group at "max membership role" as owner
  4. The attacker will now be owner of the target group
Steps to reproduce

Preconditions:

  1. Start a new Ultimate trial on Gitlab.com
  2. Create two users victim_user, attacker_user
  3. Create a private group private_ultimate_group as victim_user
  4. Go to https://gitlab.com/groups/GROUPNAME/-/settings/roles_and_permissions
  5. Create a custom role with admin_group_member checked, based on guest. Call it "guest manager"
  6. Go to https://gitlab.com/groups/GROUPNAME/-/group_members and invite attacker_user as "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

  1. Click "Invite group"
  2. Search for attacker_group and select it. Also select "Role" as owner
  3. Click invite
  4. Refresh the page and the attacker should now be owner of the group with full owner access

Scenario 2

  1. Find existing group member (it can be attacker's second account they added as guest)
  2. Change it to any role higher than guest, eg. owner
  3. Refresh the page and the existing member should now be owner of 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:

The original report as published on GitLab. Images and videos are our own copies; raw HTML is shown as text. View it on GitLab.

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

  1. Create a private group as the victim and add a custom role based on Guest with group-member administration enabled.
  2. Invite the attacker as that custom role.
  3. As the attacker, create a new group where the attacker is owner.
  4. In the target group's members page, invite the attacker's group with the owner role.
  5. 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.

More from GitLab

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

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.