Boards leak private label names and desciptions
An IDOR vulnerability in the boards feature allowed an attacker to create a list using a label ID from a private repository, leaking the label's name and description. The attacker could then view the leaked information on the board.
- Triaged in 2 hours
- Fixed in 10 days
- Disclosed after 11 days
Vulnerability details
In anticipation of today's release, I took a look at the new boards feature - which, unrelated to this report, is awesome! There turns out to be an IDOR vulnerability when creating a list based on a label. An attacker can create a list with a label ID that belongs to a private repository. This leaks the name and description of the label to the attacker.
Proof of concept
- Create a new, private repository
- In the created repository, create a new label - lets assume it has label ID 1
- Create another repository, doesn't matter if it's a private or public repository, and doesn't have to be scoped under the same namespace
- In the created repository, create another new label - lets assume it has label ID 2
- Go to the board of the repository created in step 3, and intercept your network traffic
- Click the label created and notice similar to the one below being sent to the GitLab instance:
Request
POST /jobertabma/test/board/lists HTTP/1.1
Host: gitlab-instance
...
{"list":{"label_id":2}}
Response
HTTP/1.1 200 OK
...
{"id":3,"list_type":"label","position":1,"title":"super secret title","label":{"id":1,"title":"super secret title","color":"#428BCA","description":null,"priority":null}}
- In the request, change the
label_idto 1, or any other label ID that doesn't belong to you and forward the request. - Refresh the board page, notice the created list - it contains the label name and description
Fix
This is a very ugly solution, but I just wanted to include it to point you to the vulnerability LoC. Line 18 (or 20, after the fix), creates a List object without making sure the provided label_id belongs to the project.
diff --git i/app/services/boards/lists/create_service.rb w/app/services/boards/l
index 5cb408b..630b05a 100644
--- i/app/services/boards/lists/create_service.rb
+++ w/app/services/boards/lists/create_service.rb
@@ -15,6 +15,8 @@ module Boards
end
def create_list_at(position)
+ params[:label_id] = project.labels.find(params[:label_id]).id
+
board.lists.create(params.merge(list_type: :label, position: position))
end
end
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
The application did not verify that the provided label_id belonged to the project before creating the list.
Impact
An attacker could leak the name and description of labels from private repositories.
What the attacker needed
Access to create boards and labels; ability to intercept HTTP requests
The fix
The fix ensures that the label_id is validated against the project's labels before creating the list.
How it was found
- Create a new private repository and a label in it.
- Create another repository (private or public) and a label in it.
- Go to the board of the second repository and intercept the network traffic.
- Click the label to trigger a request that includes the label_id.
- Change the label_id to the ID of the label from the private repository and forward the request.
- Refresh the board page to see the leaked label name and description.
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.
When you create a list on a board, the application uses a label ID to identify which label to use. The application did not check if that label ID belonged to a repository you have access to. So, by changing the ID to one from a private repository, you could see its label name and description.
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.