Groups can be transferred to groups where you have only maintainer permissions
The group transfer feature only checked that the user had maintainer permissions on the target group, not owner permissions as documented. An attacker with owner rights on one group and maintainer rights on another could transfer their group into the target group, potentially gaining more control than intended.
GitLab
Originally disclosed on GitLab
- Fixed in 3.2 years
- Disclosed after 3.2 years
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
</summary> </details> <!--IssueSummary end-->HackerOne report #1590707 by theluci on 2022-06-03, assigned to @dcouture:
Report | How To Reproduce
Report
Summary
The documentation at https://docs.gitlab.com/ee/user/group/#transfer-a-group states that
You can only transfer groups to groups you manage
By manage, documentation means that you are an owner.
When you go to transfer group settings for a group you own by going to settings>general>advanced>transfer group you will see the groups for whom you are an owner which is true as per documentation.
However, when you capture the request and change the the new_parent_group_id parameter to the id of a group in which you are a maintainer, it goes through and transfers the group.
POST /groups/test11330/-/transfer HTTP/2
Host: gitlab.com
Cookie: <COOKIE>
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:101.0) Gecko/20100101 Firefox/101.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8
Referer: https://gitlab.com/groups/test11330/-/edit
Content-Type: application/x-www-form-urlencoded
Content-Length: 154
Origin: https://gitlab.com
_method=put&authenticity_token=<AUTHENTICITY TOKEN>&new_parent_group_id=<ID>
Steps to reproduce
Setup
Attacker have owner permission in group-o and maintainer permission in group-m.
- In
group-ogo to settings>general>advanced>transfer group - choose any group and confirm but intercept the request using burp suite
- change
new_parent_group_idto the id ofgroup-m group-owill be transferred ingroup-m
What is the current bug behavior?
The owner of a group can transfer his group to any group for which he has maintainer permissions.
What is the expected correct behavior?
The owner should only be able to transfer his group to other groups in which he is the owner.
Output of checks
This bug happens on GitLab.com
Note:-
The documentation at https://docs.gitlab.com/ee/user/group/#transfer-a-group states that
You can only transfer groups to groups you manage
I'm pretty sure by manage documentation mean groups in which you are an owner because
- Only an owner can access settings of a group and perform required functions thus managing the group
- In transfer group functionality, through the UI you only see those groups in which you are an owner i.e., those that you are managing
Impact
Allows you to transfer group to another group where you have only maintainer permissions.
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 server-side authorization check for the transfer action only verified maintainer access on the target group instead of owner access.
Impact
An attacker with maintainer permissions on a target group could transfer a group they own into that target group.
What the attacker needed
Owner permission on source group; maintainer permission on target group
How it was found
- As owner of group-o and maintainer of group-m, go to group-o's settings, general, advanced, transfer group.
- Choose any group and confirm, but intercept the request.
- Change the new_parent_group_id parameter to the ID of group-m.
- The group-o is transferred into group-m.
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, groups can be moved under other groups. The documentation says you must be an owner of the destination group to do this. However, the system only checked if you were a maintainer, which is a lower permission level, so someone with limited rights could still move a group into a place they shouldn't.
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.