Skip to content
Info disclosure Disclosed report Beginner

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
  1. Create a project with the repository visibility set to Only Project Members
  2. Create a branch, let's say fix-123-abcd
  3. From another browser, without logging in, go to https://gitlab.com/-/graphql-explorer and paste this payload (replace with your project path):
JSON
   query {  
     project(fullPath: "<YOUR PROJECT PATH HERE>") {  
       protectableBranches  
     }  
   }

  1. 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:

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

What the attacker needed

No authentication required; target project has confidential repository

How it was found

  1. Create a project with repository visibility set to Only Project Members
  2. Create a branch with a descriptive name
  3. From another browser without logging in, open the GraphQL explorer
  4. Send a query for protectableBranches of the project
  5. 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.

More from GitLab

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Information disclosure

The lesson behind this report.

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.