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.

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

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
attacker1creates a projectattacker-projectand invite his another accountattacker2as the owner.attacker1goes tovictim-projectmembership page.
https://gitlab.com/<victim-group>/<victim-project>/-/project_members
attacker1clicks on Import from a projectattacker1selectsattacker-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
Impact
A malicious maintainer can escalate his privileges to that of an owner.
He gains access to owner functions such as -
- Delete project
- Archive project
- Transfer project to another namespace
- 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:
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
- The attacker creates a project and invites a second account as owner.
- The attacker navigates to the victim project's members page.
- The attacker clicks 'Import from a project'.
- 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.