Repository Analytics historic test coverage data obtainable by guest users
A guest user in a private group could still download a CSV export of historic test coverage data through a direct endpoint, even though the repository analytics page itself had been restricted to return a 403. This let a low-privileged member obtain analytics data they were not meant to see.
GitLab
Originally disclosed on GitLab
- Fixed in 10 months
- Disclosed after 10 months
This is a followup to Group Repository Analytics visible for guest users.
The HackerOne reporter confirmed that guest access has been limited for /groups/<GROUP_NAME>/-/analytics/repository_analytics (it displays a 403 now for guest users). This properly fixes the permissions problem from the perspective of #262094.
However they have noted that a guest user can still download the direct export of historic test coverage data via https://gitlab.com/groups/<GROUP_NAME_HERE>/-/analytics/coverage_reports.csv?ref_path=refs%2Fheads%2Fmaster&start_date=2020-10-10&end_date=2020-11-09 (note: start_date and end_date params may need to be updated to match an appropriate date range based on when testing). The link is also available by visiting /groups/<GROUP_NAME>/-/analytics/repository_analytics and copying the link from the Download historic test coverage data (.csv) button:
Recreation steps:
- Create a private group, add another user as a Guest member
- As the guest user, directly visit
https://gitlab.com/groups/<GROUP_NAME_HERE>/-/analytics/coverage_reports.csv?ref_path=refs%2Fheads%2Fmaster&start_date=2020-10-10&end_date=2020-11-09, adjusting thestart_dateandend_dateOR as the group owner visit/groups/<GROUP_NAME>/-/analytics/repository_analyticsand copy the link from theDownload historic test coverage data (.csv)button - As the guest user you will be allowed to download the data
Given that to fix #262094 we have disallowed guest access for repository analytics, we should probably disable guest access to this endpoint as well.
NOTE: Although this issue is confidential, the fix does not need to go through the security process and an MR again be made against the canonical GitLab repository.
Proposal
-
Users need Reporter+ access to download test coverage history using the link https://gitlab.com/groups/<GROUP_NAME_HERE>/-/analytics/coverage_reports.csv?ref_path=refs%2Fheads%2Fmaster&start_date=<START_DATE>&end_date=<END_DATE>
-
Update https://docs.gitlab.com/ee/user/group/repositories_analytics/ to indicate the permission level required to access the Repository Analytics page.
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 CSV export endpoint did not enforce the same Reporter-level permission check that was added to the repository analytics page.
Impact
A guest member of a private group could download historic test coverage data that should require Reporter access.
What the attacker needed
A private group; a guest account in that group; knowledge of the CSV endpoint URL
The fix
The endpoint should require Reporter or higher access, and the docs should state the required permission level.
How it was found
- Create a private group and add another user as a Guest member.
- As the guest, visit the coverage reports CSV URL directly with a date range.
- The guest is allowed to download the data.
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 guest is the lowest level of member in a private group, so they should see very little. The main analytics page was locked down, but the separate download link for a CSV file was not, so a guest could still fetch the data directly. This is a common pattern: fixing one page but forgetting the endpoint behind a button.
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.