Skip to content
Access control Disclosed report Intermediate

Guest with manage group access tokens can rotate and see group access token with owner permissions

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 #2356976 by ashish_r_padelkar on 2024-02-06, assigned to @rshambhuni:

Report | How To Reproduce

Report

Summary

It is possible for guest with custom role of manage group access tokens to rotate access token of group owner privileges using this vulnerability.

Steps to reproduce

1.1.Create a group (with ultimate licence trial).
2.Create a group access token with owner role and api scope at https://Yourinstance/groups/groupjan2024/-/settings/access_tokens
3.Now use your personal access token to create a custom role of guest role with manage_group_access_tokens permission.

curl --request POST --header "Content-Type: application/json" --header "Authorization: Bearer glpat-1233" --data '{"name" : "Custom guest1", "base_access_level" : 10, "manage_group_access_tokens" : true}' "http://Yourinstance/api/v4/groups/34/member_roles"  

4.Now apply this custom role to group member at https://Yourinstance/groups/groupjan2024/-/group_members.
5.Login as above member and you see that you can see the group access token entry at https://Yourinstance/groups/groupjan2024/-/settings/access_tokens but cant see the token itself.
6.Now use below curl to rotate the token.

curl --request POST --header "PRIVATE-TOKEN: glpat-123" "http://Yourinstance/api/v4/groups/34/access_tokens/13/rotate"  

PRIVATE-TOKEN is your personal token which can be created at https://Yourinstance/-/user_settings/personal_access_tokens
access_tokens ID (in this case, its 13) can be obtained from http://Yourinstance/api/v4/groups/34/access_tokens
7.Response will show you the token which has owner permission despite you having just guest role.

What is the current bug behavior?

Guest with manage group access tokens can rotate and see group access token with owner permissions

What is the expected correct behavior?

Guest with manage group access tokens can rotate but shouldn't see the group access token with higher permissions

Output of checks

Gitlab enterprise ultimate 16.8
creation of group access tokens are not enabled on gitlab.com yet

Regards,
Ashish

Impact

Guest with manage group access tokens can rotate and see group access token with owner permissions

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.

What is known

A medium-severity access control bug in gitlab.com. GitLab made it public on 6 March 2024. Fixed in version 16.10.

About 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.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

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.