Last build status and coverage leaked to unauthorized users
GitLab CI badges for build status and coverage did not enforce pipeline access restrictions, allowing unauthorised users to view the status of any branch. An attacker could learn whether builds succeeded or failed and coverage percentages for branches they should not have access to.
- Fixed in 8 months
- Paid in 4 months
- Disclosed after 8 months
GitLab CI supports creating badges for the latest build/coverage on a certain branches. However, with restricted access, where users do not have access to pipelines, users still have access to the build/coverage status of any branch. This access works for different configurations:
- For public projects with restricted pipeline access, any user (the user does not need to be signed in) has access to this information
- For internal projects with restricted pipeline access, any authenticated user has access to this information
- For private projects, any Guest user of that project has access to this information
Steps to reproduce
- Create a public repo, configure CI, and push some code. Consider the project namespace to be
test/cibadgesin these steps. - Restrict the visibility of whole repo to
Project Members Onlyand disablePublic buildsin the CI settings - As a non-authenticated user visit the following page:
https://example.gitlab.com/test/cibadges/badges/master/pipeline.svg
This will return a SVG image showing the build status of the master branch. This works for any other branch as well. The same thing also works with the coverage badge accessible via the following link https://example.gitlab.com/test/cibadges/badges/master/coverage.svg
The same works for the other configurations as mentioned above.
Even if repos and therefore also pipelines are completely disabled, the last build status/coverage still can be retrieved via the badges link.
Steps to mitigate
Perform proper authorization check handling a badge request
Impact
Users with restricted pipeline access can see the build/coverage status for different branches
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 badge endpoint did not perform the same authorization checks as the pipeline pages, so it served status data regardless of the user's pipeline access.
Impact
Users with restricted pipeline access could see the build and coverage status for different branches, and this also worked even when repositories and pipelines were completely disabled.
What the attacker needed
Public project with restricted pipelines; or internal project with restricted pipelines; or private project with guest access; no authentication needed for public projects
How it was found
- Create a public repository, configure CI, and push code.
- Restrict the repository visibility to project members only and disable public builds.
- As an unauthenticated user, visit the pipeline badge URL for a branch.
- Observe that the badge returns the build status for that branch.
- Repeat with the coverage badge URL to see coverage information.
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.
GitLab CI badges are small images that show the latest build status or test coverage for a branch. The report found that these images could be viewed by people who were not allowed to see the project's pipelines, so they could still learn whether builds passed or failed. This is an information leak because access controls were not applied to the badge endpoint.
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.