Skip to content
IDOR Disclosed report Beginner

IDOR in adding groups to protected environments

A project maintainer could add any private group to a protected environment by changing the group ID in the request, even if the group was not shared with the project.

GitLab

Originally disclosed on GitLab

  • Fixed in 4 months
  • Disclosed after 4 months

HackerOne report #566216 by ashish_r_padelkar on 2019-05-04, assigned to estrike:

Summary

Hello,

This issue is similar to https://gitlab.com/gitlab-org/gitlab-ce/issues/52409. However, there is No API for protected environment which leaks this group names yet but i think you should fix this before any API releases for the same.

There is an IDOR issue while adding groups to protected environment and any private groups can be added.

Steps to reproduce

  1. As a project Maintainer, go to `https://gitlab.com/<UserName>/<ProjectName>/settings/ci_cd#js-protected-environments-settings1

  2. Add any group first to protect which is already shared with this project. and capture the belwo request.

POST /<UserName>/<ProjectName>/protected_environments HTTP/1.1  
Host: gitlab.com  
Connection: close  
Content-Length: 213  
Accept: application/json, text/plain, */*  
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/json;charset=UTF-8  
Referer: 1  
Accept-Encoding: gzip, deflate  
Accept-Language: en-GB,en-US;q=0.9,en;q=0.8  
Cookie: 1

{"authenticity_token":"1","protected_environment":{"name":"qqqqqqw","deploy_access_levels_attributes":[{"group_id":4962333}]}}  
  1. Now change the value of group_id parameter in above request to private group ID

  2. This will add the protected environment

  3. You can verify that the group has been added by inspecting element of the browser like below

Screenshot_2019-05-04_at_17.22.42.png
Screenshot_2019-05-04_at_17.22.42.png From the original on GitLab

What is the current bug behavior?

IDOR which allows adding any private group to protected environments

What is the expected correct behavior?

Only groups which are shared with projects should be allowed

Output of checks

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

Regards,
Ashish

Impact

IDOR in adding any group to protected environments. This doesn't reveal the group name yet as there is no API for protected environment but i think you should fix this before you implement one!

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 application does not verify that the group being added to a protected environment is shared with the project, allowing any group ID to be used.

Impact

A maintainer could add any private group to a protected environment, though the group name is not revealed because there is no API for protected environments yet.

What the attacker needed

A GitLab account; Maintainer role on a project; knowledge of a private group ID

How it was found

  1. As a project Maintainer, go to the project's CI/CD settings page for protected environments.
  2. Add a group that is already shared with the project to a protected environment and capture the request.
  3. Change the group_id parameter in the request to a private group's ID.
  4. The protected environment is updated with the private group.
  5. Verify by inspecting the page that the group has been added.

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.

An IDOR is when a web application uses an identifier, like a group ID, without checking if the user is allowed to access that resource. Here, a user could change the group ID to any private group's ID and add it to a protected environment, even though that group was not shared with the project.

What is IDOR?

One user can read or change another user's data, usually by changing an identifier the server trusts without checking who is asking. One of the most paid bug classes on web programs.

More from GitLab

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Insecure direct object reference (IDOR)

The lesson behind this report.

One user can read or change another user's data, usually by changing an identifier the server trusts without checking who is asking. One of the most paid bug classes on web programs.