Leak branch names of projects with confidential repository
The GraphQL API exposed branch names of projects with confidential repositories to unauthenticated users. An attacker could query the protectableBranches field and learn branch names, which may contain sensitive issue titles.
GitLab
Originally disclosed on GitLab
- Fixed in 4 months
- Disclosed after 4 months
⚠️ Please read the process on how to fix security issues before starting to work on the issue. Vulnerabilities must be fixed in a security mirror.
HackerOne report #2666216 by shells3c on 2024-08-16, assigned to @cmaxim:
Report | How To Reproduce
Report
Steps to reproduce
- Create a project with the repository visibility set to Only Project Members
- Create a branch, let's say
fix-123-abcd - From another browser, without logging in, go to
https://gitlab.com/-/graphql-explorerand paste this payload (replace with your project path):
query {
project(fullPath: "<YOUR PROJECT PATH HERE>") {
protectableBranches
}
}
- Now you will see the branch you just created
Output of checks
This bug happens on GitLab.com
Impact
Branch names can contain sensitive information, especially when the default branch name template of all projects is %{id}-%{title}, therefore branches that address issues contain the title of the issues themself, which can be sensitive a lot of the time.
An example where the impact could be critical is gitlab-org/security/gitlab, as it has security-${title} as its branch name template (Luckily the project is private, so it's not vulnerable).
How To Reproduce
Please add reproducibility information to this section:
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
What the attacker needed
No authentication required; target project has confidential repository
How it was found
- Create a project with repository visibility set to Only Project Members
- Create a branch with a descriptive name
- From another browser without logging in, open the GraphQL explorer
- Send a query for protectableBranches of the project
- Observe the branch name in the response
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 project's repository can be set to private, so only members can see its code. However, a part of the website that lists branch names did not check if the person asking was allowed to see them. This meant anyone could ask for branch names and get them, even without logging in.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.