Skip to content
Access control Disclosed report Beginner

CI metrics for MRs are accessible for users without CI access

GitLab displayed CI job metrics in merge request widgets to users who lacked CI access, including anonymous visitors when public pipelines were disabled. An attacker could view the output of CI jobs without permission.

GitLab

Originally disclosed on GitLab

  • Fixed in 4 months
  • Disclosed after 4 months

HackerOne report #546860 by xanbanx on 2019-04-23, assigned to estrike:

Summary

GitLab added a new feature to upload a metrics file as part of a CI job. GitLab parses this file and displays the changes in metrics as part of the merge request widget. These metrics are output of the CI job and should only be displayed if the visiting user has access to CI. However, right now GitLab displays the metric changes regardless of this permission.

For public projects, GitLab allows to restrict CI pipelines to project members only (public pipelines disabled). However, in this case, the merge request widget still renders the metrics result, which is the outcome of a CI pipeline.

Steps to reproduce

This is reproducible on gitlab.com. It requires at least a silver plan to have the metrics feature available.

  1. Create a public project and push a .gitlab-ci.yml with following content:
metrics:  
  script:  
    - echo 'my_metric value' > metrics.txt  
  reports:  
    metrics: metrics.txt  
  1. Create a merge request (assuming with iid 1) by changing the .gitlab-ci.yml file, especially by changing the metrics line, e.g., to - echo 'my_metric new_value' > metrics.txt
  2. Restrict the visibility of CI pipelines to project members only and disable public pipelines
  3. As an anonymous user, visit the page https://example.gitlab.com/<namespace>/<public-project-name>/merge_requests/1/merge_requests/1
  4. You see the metrics widget rendered although the user does not have access to CI. Behind the scenes, the JSON endpoint https://example.gitlab.com/<namespace>/<public-project-name>/merge_requests/1/merge_requests/1/metrics_report.json loads this data and reveals the metrics information to unauthorized users.

What is the current bug behavior?

Users without access to CI have access to metrics, which are tied to a merge request and are an output of CI.

What is the expected correct behavior?

Users without proper access level should not have access to metrics.

Best regards,
Xanbanx

Impact

Users without proper access level have access to metrics information.

Security Workflow Issue: https://dev.gitlab.org/gitlab/gitlabhq/issues/2895

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

Root cause

Likely the merge request metrics widget and its JSON endpoint did not check the viewer's CI access permission before returning CI job output.

Impact

Users without proper access level could view CI metrics information, including anonymous visitors when public pipelines were disabled.

What the attacker needed

Public project; silver plan or higher; CI metrics feature enabled; public pipelines disabled

How it was found

  1. Create a public project and add a CI configuration that writes a metrics file.
  2. Open a merge request that changes the metrics value.
  3. Restrict CI pipeline visibility to project members only.
  4. As an anonymous user, visit the merge request page.
  5. Observe the metrics widget and its JSON endpoint returning data without CI access.

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 proposal to change code. GitLab can show a small chart of numbers (metrics) produced by an automated test job. The report says that even people not allowed to see those jobs could still see the chart and its data.

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.