Skip to content
Access control Disclosed report Beginner

Private merge request titles leaked to unauthorized users via pipeline widget

GitLab's pipeline view displayed related merge request titles to users who lacked permission to view merge requests, such as unauthenticated users on public projects with restricted merge requests or guest users in private projects. An attacker could read the titles of private merge requests, leaking potentially sensitive information.

GitLab

Originally disclosed on GitLab

  • Fixed in 4 months
  • Disclosed after 4 months

HackerOne report #717675 by xanbanx on 2019-10-18, assigned to @jeremymatos:

Hi GitLab Security Team,

Summary

GitLab recently added a feature to render the related merge requests on the pipelines view.
Here, GitLab is missing proper access control and always shows the related merge requests regardless if the visiting user has access to merge requests. In particular, the title of the merge requests are leaked to anyone who can visit pipelines but not the merge request. This leak can happen in two cases: First, in restricted public repos (merge requests are restricted) and for guest users in private projects. Guest users do not have access to the repository and to merge requests.

Steps to reproduce

Tested on GitLab Enterprise Edition 12.3.0-pre 0e052976891 (Canary)

  1. Create a public project and restrict merge requests to project members only
  2. Enable GitLab CI, push some code, and create a merge request
  3. As an unauthenticated user, goto https://gitlab.com/<namespace>/<project>/pipelines/<pipeline-id> to view the pipeline. In the commit widget, the title of the related merge request is shown although the user does not have access to merge requests.

The same happens to for guest users of private projects

  1. Create a private project, push some code, and create a merge request
  2. Add a guest user to the project
  3. As the guest user, visit the pipeline in the frontend via https://gitlab.com/<namespace>/<project>/pipelines/<pipeline-id>. Again, the title of the merge request is leaked to the guest user, who does not have access to the repository and merge requests.

Impact

Unauthorized users without access to merge requests can read the merge request titles showing on pipelines. Seems to have a similar impact as #435093

Examples

As an unauthenticated user, goto https://gitlab.com/wter23/test-mr-leak/pipelines/89855619 (Canary enabled). Here, you see the title of the related merge requests being leaked although you don't have access to the merge request.

What is the current bug behavior?

Users without access to merge requests can read the merge request title on the pipeline view.

What is the expected correct behavior?

The related merge request is not rendered if the visiting user does not have access to merge requests.
When looking into the code, it seems the PipelinePresenter#all_related_merge_requests in https://gitlab.com/gitlab-org/gitlab/blob/master/app%2Fpresenters%2Fci%2Fpipeline_presenter.rb#L128 returns merge requests although the user might not have access to merge requests.

Output of checks

This bug happens on GitLab.com

Best regards,
Xanbanx

Impact

See above.

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

Impact

Unauthorised users without access to merge requests could read the merge request titles shown on pipelines.

What the attacker needed

Public project with restricted merge requests; or private project with a guest user; no authentication needed for public case

The fix

The related merge request should not be rendered if the visiting user does not have access to merge requests.

How it was found

  1. Create a public project and restrict merge requests to project members only
  2. Enable GitLab CI, push some code, and create a merge request
  3. As an unauthenticated user, visit the pipeline page to see the merge request title
  4. Create a private project, push code, and create a merge request
  5. Add a guest user to the project
  6. As the guest user, visit the pipeline page to see the merge request title

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.

A merge request is a proposed code change. Normally, only project members can see them. The pipeline page, which shows automated build results, also listed the titles of related merge requests without checking if the viewer was allowed to see them. So someone who could see the pipeline page could also read those titles.

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.