Maintainer can create a fork relationship between existing projects contrary to documentation
A maintainer of a project could create a fork relationship between that project and another project they control, even though the documentation states only project owners and administrators can do so. This allowed a maintainer to link projects in a way that contradicts intended permissions.
GitLab
Originally disclosed on GitLab
- Fixed in 3 months
- Disclosed after 3 months
⚠️ 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 #2058121 by theluci on 2023-07-08, assigned to @kmorrison1:
Report | Attachments | How To Reproduce
Report
Hello,
Background
Gitlab provides a feature to create a fork of a project.
When you create a fork of a project using UI, you become the owner of the forked project or downstream project. That is, only the owner of a project can create the fork relationship between the downstream project and upstream project.
Similarly, only the owner of a project can Remove fork relationship.
When using API as well, according to the docs, only the project owners and administrators can Create a fork relationship between existing projects as well as Delete an existing fork relationship.

Vulnerability
According to docs, only the project owners and administrators can Create a fork relationship between existing projects.

However, the above is not enforced and a Maintainer can create a fork relationship between existing projects.
This behaviour is contradictory to what happens when using UI as well as contradictory to what should happen according to docs.
Steps to reproduce
victimcreates a groupvictim-groupand a projectvictim-projectinside.victimgoes tovictim-projectmembership page,https://gitlab.com/<victim-group>/<victim-project>/-/project_membersand addsattackeras maintainer.attackercreates a personal projectattacker-project.attackergoes to his terminal and runs the following command,
curl --request POST --header "PRIVATE-TOKEN: <access_token>" "https://gitlab.com/api/v4/projects/<victim_project_ID>/fork/<attacker_project_ID>"
attacker was able to create a fork relationship between victim-project and attacker-project contrary to documentation. (victim-project as the downstream project and attacker-project as the upstream project)
Please note that above attacker created a fork relationship between victim-project and attacker-project. However, it isn’t necessary, attacker can create a fork relationship between victim-project and any project attacker has access to, including public projects.
POC
Output of checks
This bug happens on GitLab.com (Probably on instance too).
Impact
Maintainer can create a fork relationship between existing projects contrary to documentation
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
What the attacker needed
Attacker has maintainer role on victim project; attacker has access to another project
How it was found
- Victim creates a group and a project inside it.
- Victim adds the attacker as a maintainer to the project.
- Attacker creates a personal project.
- Attacker sends a POST request to the fork relationship API endpoint with the victim project ID and attacker project ID.
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 fork is a copy of a project that stays linked to the original. The documentation says only the project owner or an administrator can create that link between two existing projects. However, a user with the 'maintainer' role (a lower permission level) could still create the link using the API, which goes against the documented rules.
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.