Skip to content
Access control Disclosed report Beginner

Projects can be transferred to groups where you have developer role only

The transfer feature allowed moving a project into a group where the user had only Developer role, contrary to the documented Maintainer requirement.

GitLab

Originally disclosed on GitLab

  • Fixed in 6 months
  • Disclosed after 6 months

HackerOne report #542685 by ashish_r_padelkar on 2019-04-19, assigned to estrike:

Summary

Hello,

Again, not sure if its documentation error or a security issue but though i should report it anyways.

The documentation here at https://docs.gitlab.com/ee/user/project/settings/#transferring-an-existing-project-into-another-namespace states

You can transfer an existing project into a group if:

1. you have at least Maintainer permissions to that group  
2. you are an Owner of the project.  

The first case is NOT true because you can transfer the project into any group where you have Developer role too.

When you go to transfer project settings in any of your owner project at https://gitlab.com/<UserName>/<ProjectName>/edit , You will only see the groups that you either own or have maintainers permissions in a dropdown which is true as per documentation.

However, when you capture the request and change the new_namespace_id parameter ID in below request to a group where you have Developer role, it goes through and move the project into the group.

POST /<UserName>/<ProjectName>/transfer HTTP/1.1  
Host: gitlab.com  
Connection: close  
Content-Length: 75  
Accept: */*;q=0.5, text/javascript, application/javascript, application/ecmascript, application/x-ecmascript  
Origin: https://gitlab.com  
X-CSRF-Token: 1  
X-Requested-With: XMLHttpRequest  
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36  
Content-Type: application/x-www-form-urlencoded; charset=UTF-8  
Referer: 1  
Accept-Encoding: gzip, deflate  
Accept-Language: en-GB,en-US;q=0.9,en;q=0.8  
Cookie: 1

utf8=%E2%9C%93&_method=put&new_namespace_id=4962333&commit=Transfer+project  

This probably happens when you have a setting at target group level which allows Developers to create projects

Screenshot_2019-04-19_at_20.37.09.png
Screenshot_2019-04-19_at_20.37.09.png From the original on GitLab

The document was updated as a result of #446683.

Steps to reproduce

  1. As a project owner, go to your settings at https://gitlab.com/<UserName>/<ProjectName>/edit where transfer projects is available.

  2. You will find list of groups that you own or have maintainer role in a dropdown. This works fine as per documentation.

  3. Now select any group and click Transfer Project and at this point capture the request in burp suit.

The request looks like shown above.

  1. You can see that there is a new_namespace_id parameter in request. Change it to a Group ID where you have only Developer role. and send the request.

  2. Projects will be transferred to the group where you have developer role which contradicts the documentation!

What is the current bug behavior?

Allows you to transfer the project to groups where you have developer role.

What is the expected correct behavior?

As per documentation and UI, Projects should be transferred to groups which you own or have Maintainer permissions!

Output of checks

This bug happens on GitLab.com and probably on omnibus installations too!

Regards,
Ashish

Impact

Allows you to transfer the projects to groups where you have developer permissions!

Attachments

Warning: Attachments received through HackerOne, please exercise caution!

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 server-side authorization check for project transfer only verified Developer role instead of the documented Maintainer role.

Impact

A user with Developer role in a group could transfer projects into that group, contrary to the documented permissions.

What the attacker needed

A GitLab account; Developer role in target group; Owner role on the project

The fix

The transfer should require Maintainer role or higher in the target group, as the documentation states.

How it was found

  1. As a project owner, go to the project settings page where transfer is available.
  2. Select a group from the dropdown (only groups where you are owner or maintainer are shown).
  3. Capture the transfer request in a proxy tool.
  4. Change the new_namespace_id parameter to a group ID where you only have Developer role.
  5. Send the request and observe the project is transferred.

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.

GitLab lets you move projects between groups. The docs say you need Maintainer rights in the target group, but a project can be moved into a group where you only have Developer rights.

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.