Labels created in private projects are leaked
The label assignment code for issues and merge requests did not check that a label belonged to a project the user could access. An attacker could attach a label from a private project to their own issue by supplying its numeric ID, revealing the label's name and description.
- Triaged in 3 days
- Fixed in 13 days
- Disclosed after 13 days
Vulnerability details
An insecure direct object reference vulnerability exists in the code that assigns labels to issues and merge requests, that allows an attack to read labels of private projects. This probably doesn't leak a lot of super confidential data, but since it's hard to predict how people use labels, it'd be good to fix this issue.
Proof of concept
Note: this proof of concept demonstrates the attack with an issue, but the same issue exists when a merge request is created. To start off, sign in as a victim (jane) and create a project (private-project). Set the visibility level to private for this project. When this is set up, create a label at http://gitlab-instance/jane/private-project/labels. When I reproduced this issue for myself, I used SomeCompany Secret feature as label name. The label had ID 1. Now sign in as the attacker (john). John wants access to the label that Jane created for her private program. John creates a new project called random-project and creates a new issue at http://gitlab-instance/john/random-project/issues. No need to select a label in the New issue form.
Now intercept the traffic before you click the "Submit issue" button. The request that is sent to the GitLab server looks something like this:
POST /john/random-project/issues HTTP/1.1
Host: 159.xxx.xxx.xxx
...
utf8=%E2%9C%93&authenticity_token=zD0fqQphsFSNP6gl6KWhTw5iaTtk3cGlDz1Gn563roNyiSq2ACIXGp8%2FmBMo9q70ZP3M0mCWmsq7XJCmzkdADg%3D%3D&issue%5Btitle%5D=a&issue%5Bdescription%5D=a&issue%5Bassignee_id%5D=&issue%5Bmilestone_id%5D=&issue%5Blabel_ids%5D%5B%5D=
Now add the label ID that you want access to as value to the issue[label_ids][] array. The request will now look something like this (note the appended 1):
POST /john/random-project/issues HTTP/1.1
Host: 159.xxx.xxx.xxx
...
utf8=%E2%9C%93&authenticity_token=zD0fqQphsFSNP6gl6KWhTw5iaTtk3cGlDz1Gn563roNyiSq2ACIXGp8%2FmBMo9q70ZP3M0mCWmsq7XJCmzkdADg%3D%3D&issue%5Btitle%5D=a&issue%5Bdescription%5D=a&issue%5Bassignee_id%5D=&issue%5Bmilestone_id%5D=&issue%5Blabel_ids%5D%5B%5D=1
Forward the request and go back to the browser. You'll see that the label that belongs to the private project shows up as attached label:

Impact
An attacker could easily iterate over all existing label IDs to attach all labels to an issue. This way potential confidential information (either in the name or description) is revealed to an attacker. Like said in the introduction, because you don't know how people use these labels, this can contain confidential information.
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 label assignment endpoint looked up labels by ID without verifying that the requesting user had access to the label's project.
Impact
An attacker could iterate over label IDs to attach and read labels from private projects, potentially exposing confidential information in their names or descriptions.
What the attacker needed
Victim has a private project with labels; attacker can intercept HTTP requests
How it was found
- As the victim, create a private project and add a label to it.
- As the attacker, create your own project and start a new issue.
- Intercept the issue submission request before it is sent.
- Add the victim's label ID to the label IDs field in the request.
- Forward the request and observe the private label attached to your issue.
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.
Every label in the system has a number (an ID). When you create an issue, the server trusts the label numbers you send and attaches those labels without checking whether you are allowed to see them. By guessing numbers, an attacker can pull labels from other people's private projects into their own issue and read them.
What is IDOR?
One user can read or change another user's data, usually by changing an identifier the server trusts without checking who is asking. One of the most paid bug classes on web programs.