Skip to content
Access control Disclosed report Intermediate

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,

30jun-1.png
30jun-1.png From the original on GitLab

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

30jun-2.png
30jun-2.png From the original on GitLab

In the above example,

  • Direct members of My-other-group are Direct shared members of a-new-group
  • Inherited members of My-other-group are Inherited shared members of a-new-group

Vulnerability

According to docs, Direct shared group members cannot be shared into other projects.

30jun-3.png
30jun-3.png From the original on GitLab

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

  1. attacker creates a group attacker-group and adds victim as guest.
  2. victim creates a group victim-group.
  3. victim goes to https://gitlab.com/groups/<victim-group>/-/group_members, clicks on Invite a group and invite attacker-group.

attacker is now a Direct shared group member of victim-group.

  1. victim creates a personal project victim-project in his namespace.
  2. victim goes to https://gitlab.com/<victim-username>/<victim-project>/-/project_members, clicks on Invite a group and invite victim-group.

victim has shared his personal project victim-project with the victim-group.

  1. attacker visits victim-project.
  2. attacker continues to be able to access victim-project contrary to documentation, affecting Confidentiality and Integrity of data.

POC

poc-30jun.mp4 From the original on GitLab

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:

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

  1. Attacker creates a group and adds victim as guest.
  2. Victim creates a group.
  3. Victim invites attacker's group to victim's group, making attacker a direct shared group member.
  4. Victim creates a personal project and invites victim's group to it.
  5. 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.

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.