Skip to content
Access control Disclosed report Intermediate

Guest user with "Admin group member" permission can edit custom role and gain other custom permissions

A custom role with only the 'add group member' permission was later given additional permissions by the group owner, and those new permissions were automatically applied to existing users assigned that role. An attacker with that role could add a second account as a guest and then change that account's role to the custom role, gaining the extra permissions and escalating privileges.

GitLab

Originally disclosed on GitLab

  • Fixed in 4 months
  • Disclosed after 4 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 #2478469 by chotebabume on 2024-04-25, assigned to @greg:

Report | Attachments | How To Reproduce

Report

NOTE! Thanks for submitting a report! Please note that initial triage is handled by HackerOne staff. They are identified with a HackerOne triage badge and will escalate to the GitLab team any. Please replace all the (parenthesized) sections below with the pertinent details. Remember, the more detail you provide, the easier it is for us to triage and respond quickly, so be sure to take your time filling out the report!

Summary

(Summarize the bug encountered concisely)

Hi team ,

Gitlab recently add that group owner can assign multiple feature permission on single custom role see here -

As Group Owner I created A custom role with all additional permission -

bandicam_2024-04-25_10-53-28-598.mp4 From the original on GitLab

As Owner also create a custom role for add group member as level "guest role" on his group so if owner assign this add group member custom to a user then that user only was able to add member on victim group as " guest user role "

image.png
image.png From the original on GitLab

But I found there was a misconfiguration first group owner only created custom role with single permission "add group member" and assign to a user later group decided to increase permission on that custom role so he increase all permission on that custom role .

then there should be error in member tab for users to once update his user's role because these permission directly applies on first single custom role user

so exploiting this misconfiguration attacker first add his second account as "guest" role on victim user group later he change his second account role to custom role which was created from owner later if owner add that custom role with all multiple feature permission then attacker can make it privilege escalation on victim user group .

Steps to reproduce

(Step-by-step guide to reproduce the issue, including:)

(1. As Owner create a group
(2. As Owner navigate >settings >roles_and_permissions
(4. create custom role "add group member" base role "guest"
(5. now add userB on group and assign custom role "add group member"
(6. so that custom role userB should able to add group member's with guest role on victim user group
(7. now as custom role userB add his second account as guest role on victim user group
(8. now UserB change his second account user role to victim user custom role user
(9. later if owner add multiple permission to that custom role > that permission directly applies to old user with single permission custom role

here video poc -

bandicam_2024-04-25_11-47-07-176.mp4 From the original on GitLab

Impact

new additional permission should be applied to when owner add new user with that custom role and update user role not directly give access to old user with single permissions.

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, when a custom role's permissions are updated, the system applies the new permissions to all existing users assigned that role without re-checking whether those users should receive the additional permissions.

Impact

An attacker with a limited custom role could gain the additional permissions later assigned to that role.

What the attacker needed

Attacker has a custom role with 'add group member'…; group owner later adds more permissions to that custom role; attacker can add a second account as guest

How it was found

  1. As Owner, create a group.
  2. As Owner, navigate to Settings > Roles and Permissions.
  3. Create a custom role named 'add group member' with base role 'guest'.
  4. Add UserB to the group and assign the custom role 'add group member'.
  5. As UserB, add a second account as a guest to the victim group.
  6. As UserB, change the second account's role to the custom role.

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, a group owner can create custom roles that give users specific abilities, like adding new members. If the owner later adds more abilities to that role, the system automatically gives those new abilities to everyone who already has the role. An attacker who had the role with just one ability could add a second account as a guest, then switch that account to the custom role, and suddenly get all the new abilities, which might let them do more than intended.

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.