Skip to content
Access control Disclosed report Intermediate

Privilege escalation from maintainer to owner by importing members from a project

A project maintainer could import members from another project and assign the owner role, bypassing the restriction that prevents maintainers from granting owner access. This allowed a malicious maintainer to escalate their privileges to owner and perform owner-level actions such as deleting or transferring the project.

GitLab

Originally disclosed on GitLab

  • Fixed in 48 days
  • Disclosed after 48 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 #1934811 by theluci on 2023-04-05, assigned to @greg:

Report | Attachments | How To Reproduce

Report

Hello, this bug is similar to #1576230.
The fix to https://gitlab.com/gitlab-org/gitlab/-/issues/356975 can be bypassed if a maintainer import members from a project.

Summary

A maintainer of a project can upgrade or downgrade a members role or invite new members to the project.
However, to protect against privilege escalation from maintainer to owner. Gitlab doesn't allow the maintainer to invite new members with the owner role.

m1.png
m1.png From the original on GitLab

Neither does it allow to upgrade a members role to owner.

m2.png
m2.png From the original on GitLab

The check is also implemented in the api, so that a maintainer cannot escalate privileges by changing "access_level":50
However, the check is not implemented when importing members from a project and a malicious maintainer can invite his another account as the owner of a project.

Steps to reproduce

victim is the owner of project victim-project
attacker1 is the maintainer of victim-project

  1. attacker1 creates a project attacker-project and invite his another account attacker2 as the owner.
  2. attacker1 goes to victim-project membership page.

https://gitlab.com/<victim-group>/<victim-project>/-/project_members

  1. attacker1 clicks on Import from a project
  2. attacker1 selects attacker-project

attacker2 is now the owner of the victim-project

(Optional)
5. attacker2 can now upgrade attacker1 as the owner and remove attacker2 account if he wishes.

POC

Import_from_a_project.mp4 From the original on GitLab

Impact

A malicious maintainer can escalate his privileges to that of an owner.
He gains access to owner functions such as -

  1. Delete project
  2. Archive project
  3. Transfer project to another namespace
  4. Delete merge requests etc.

Output of checks

This bug happens on GitLab.com (Probably on instance too)

Impact

A malicious maintainer can escalate his privileges to that of an owner.

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 the member import feature did not enforce the same role-assignment restrictions that are applied when adding or updating members directly.

Impact

A malicious maintainer could escalate their privileges to owner, gaining access to owner functions such as deleting, archiving, or transferring the project.

What the attacker needed

Attacker has maintainer role on victim project; attacker controls another project; attacker has a second account

How it was found

  1. The attacker creates a project and invites a second account as owner.
  2. The attacker navigates to the victim project's members page.
  3. The attacker clicks 'Import from a project'.
  4. The attacker selects their own project to import members from.

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 project maintainer is a user with some administrative rights but not full control. The owner role is the highest level and can do things like delete the project. The system normally stops maintainers from giving anyone the owner role, but when importing members from another project, that check was missing, so a maintainer could sneak in an owner account.

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.