Skip to content
Access control Disclosed report Intermediate

Maintainer user can view and assign members to custom roles(New feature) on gitlab.com [ Privilege escalation ]

A maintainer user could view and assign custom roles after adding a new member to a project, even though custom roles should only be manageable by group owners. This allowed privilege escalation by letting a maintainer assign custom roles to other users.

GitLab

Originally disclosed on GitLab

  • Fixed in 29 days
  • Disclosed after 29 days

⚠️ 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 #2277810 by indoappsec on 2023-12-08, assigned to @cmaxim:

Report | Attachments | How To Reproduce

Report

Summary :

In recent releases gitlab.com has introduced custom group level roles . Creating , deleting , assigning custom roles to members etc. can only be done by Owner of the group.
In my testing i found normally maintainer role users are not able to access custom roles but if they add new member in the project , they start accessing the custom roles and also assign members to custom roles which is only allowed by group owner.

Permission and documentation :

https://docs.gitlab.com/ee/user/permissions.html
https://docs.gitlab.com/ee/user/custom_roles.html

image.png
image.png From the original on GitLab
image.png
image.png

Steps to reproduce :

You will need 2 accounts to reproduce the issue.
1.Login owner account , create a group and take a ultimate trial license.
2.Now create a new project. (Ex: owner project )
3.Now go to groups -- > settings -- > roles and permissions .
4.Create few custom roles for testing.

image.png
image.png From the original on GitLab

5.Now go to group -- > members .
6.Add a test user with maintainer role.
7.Now login from test user account and you will notice that this user doesn't have access to custom roles.
8.Now go to owner project -- > members.
9.Since you are maintainer you can add new members .
10.Add a new member with any role. (Ex: test 2 user )
11.Once the test 2 user is added , you will notice that you are able to view the custom roles through permission list of new user.

image.png
image.png From the original on GitLab

12.Now you can assign test 2 user with custom roles which is only allowed by owner of the group/project.

Video POC :

I have created a small POC for demonstration .

custom_role_gitlab.mov From the original on GitLab

Output of checks :

This bug happens on GitLab.com

Impact

Maintainer user can view and assign members to custom roles(New feature) on gitlab.com

Attachments

Warning: Attachments received through HackerOne, please exercise caution!

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 a permission check flaw where adding a new member triggers a view that exposes custom roles to maintainers, bypassing the intended owner-only restriction.

What the attacker needed

GitLab.com account; Owner account to set up group and custom roles; Maintainer account to exploit

How it was found

  1. Login as owner, create a group and take an ultimate trial license.
  2. Create a new project.
  3. Go to group settings, roles and permissions, and create custom roles.
  4. Add a test user with maintainer role to the group.
  5. Login as the test user and confirm no access to custom roles.
  6. As maintainer, add a new member to the project, then view and assign custom roles to that member.

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.

In GitLab, custom roles let you give users specific permissions beyond their standard role. Normally only a group owner can create and assign these custom roles. This report shows that a maintainer could see and assign custom roles after adding a new member, which they should not be able to do.

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.