Direct shared group member can be shared into other projects contrary to documentation
GitLab did not enforce its documented rule that direct shared group members cannot be shared into other projects. An attacker who is a direct shared member of a group could access projects shared with that group, gaining read and write access contrary to the documentation.
GitLab
Originally disclosed on GitLab
- Fixed in 32 days
- Disclosed after 32 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 #2044867 by theluci on 2023-06-30, assigned to @kmorrison1:
Report | Attachments | How To Reproduce
Report
Hello,
Background
Gitlab provides various types of memberships,

For Direct shared or Inherited shared membership, one may use Invite a group option,

In the above example,
- Direct members of
My-other-groupare Direct shared members ofa-new-group - Inherited members of
My-other-groupare Inherited shared members ofa-new-group
Vulnerability
According to docs, Direct shared group members cannot be shared into other projects.

That is, a member that has Direct shared membership in a group should not have access to projects shared with the group.
However, the above is not enforced.
Steps to reproduce
attackercreates a groupattacker-groupand addsvictimas guest.victimcreates a groupvictim-group.victimgoes tohttps://gitlab.com/groups/<victim-group>/-/group_members, clicks on Invite a group and inviteattacker-group.
attacker is now a Direct shared group member of victim-group.
victimcreates a personal projectvictim-projectin his namespace.victimgoes tohttps://gitlab.com/<victim-username>/<victim-project>/-/project_members, clicks on Invite a group and invitevictim-group.
victim has shared his personal project victim-project with the victim-group.
attackervisitsvictim-project.attackercontinues to be able to accessvictim-projectcontrary to documentation, affecting Confidentiality and Integrity of data.
POC
Output of checks
This bug happens on GitLab.com (Probably on instance too).
Impact
Direct shared group member can be shared into other projects (contrary to documentation) and continues having read & write access.
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 access control check for project access did not properly exclude direct shared group members when a project is shared with a group.
Impact
An attacker who is a direct shared group member could read and modify projects shared with that group, contrary to documented access rules.
What the attacker needed
Attacker has a GitLab account; victim invites attacker's group to victim's group; victim shares a project with victim's group
How it was found
- Attacker creates a group and adds victim as guest.
- Victim creates a group.
- Victim invites attacker's group to victim's group, making attacker a direct shared group member.
- Victim creates a personal project and invites victim's group to it.
- Attacker visits the victim's project and can still access it.
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, you can share a group with another group, giving members of the second group access to projects. The documentation says that if someone is only a 'direct shared' member (not a full member) of a group, they should not get access to projects that are shared with that group. This report shows that GitLab did not enforce that rule, so such a user could still access those projects.
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.