Merge request ID visible in pipeline view for users without merge request access
For public projects with merge requests restricted to project members, and for private projects where guest users lack merge request access, the pipeline view still displayed the ID of the associated merge request. An unauthenticated user or a guest could therefore learn the merge request ID, which should have been hidden.
GitLab
Originally disclosed on GitLab
- Fixed in 13 months
- Disclosed after 13 months
HackerOne report #697217 by xanbanx on 2019-09-18, assigned to @jritchey:
Hi GitLab Security Team,
Summary
For public projects, GitLab allows to restrict the visibility of merge requests to project members only. However, even this is done, merge request IDs for pipelines are publicly visible for users without merge request access. The same issue happens in private projects, where Guest users without MR access can also read the associated merge request ID.
Steps to reproduce
- Create a public project and restrict merge requests to project members only
- Push some code and a CI configuration. Note that the CI configuration requires pipelines for merge requests enabled via
only: merge_requestslike the following example:
image: busybox:latest
build1:
stage: build
script:
- echo "Do your build here"
test1:
stage: test
script:
- echo "Do a test here"
- echo "For example run a test suite"
only:
- merge_requests
test2:
stage: test
script:
- echo "Do another parallel test here"
- echo "For example run a lint test"
- Push some code and create a merge request
- As an unauthenticated user,
https://example.gitlab.com/<namespace>/<project>/pipelines/<pipeline-id>, where <pipeline-id> is the ID of the pipeline associated with this merge request. The pipeline list shows them asdetached - This page leaks the associated merge request ID
The same happens for private projects, where guest user members of the project can also see the merge request ID on the same page.
Impact
Merge request ID is visible to unauthorized users.
Examples
As an unauthenticated user, visit https://gitlab.com/wter33/test-ci/pipelines/82944750. Here, the associated merge request !1 is referenced.
What is the current bug behavior?
Merge request ID leaked to unauthorized users despite merge requests are restricted to project members only or user only has guest access to the project (thus no merge request access).
What is the expected correct behavior?
When merge requests are restricted to project members only or user is a guest member of the project, the pipelines view should not display the associated merge request ID.
Output of checks
This bug happens on GitLab.com
Best regards,
Xanbanx
Impact
See above.
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 pipeline view did not apply the same merge request visibility checks when rendering the associated merge request reference.
Impact
An unauthenticated user or a guest member could see the merge request ID, which should have been restricted to project members.
What the attacker needed
Public project with MRs restricted to members; or private project with guest user; no authentication needed for public case
The fix
The pipelines view should not display the associated merge request ID when merge requests are restricted to project members or the user is a guest.
How it was found
- Create a public project and restrict merge requests to project members only.
- Push code and a CI configuration that runs pipelines for merge requests.
- Create a merge request.
- As an unauthenticated user, visit the pipeline page for the pipeline associated with that merge request.
- Observe that the page shows the associated merge request ID.
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.
The pipeline page still showed the merge request's number, so unauthorised users could see its ID.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.