Skip to content
Info disclosure Disclosed report Intermediate

Last commit message, description & sha1 hash of a private repo in a private group is leaked to guest users through merge request

A demoted guest user could still see commit messages, descriptions, and SHA1 hashes from a private project's default branch through a previously created fork. This allowed the attacker to snoop on confidential commit information even after losing repository access.

GitLab

Originally disclosed on GitLab

  • Fixed in 56 days
  • Disclosed after 56 days

HackerOne report #1465994 by albatraoz on 2022-01-31, assigned to GitLab Team:

Report | Attachments | How To Reproduce

Report

Summary

Commit related details like commit message, description, sha1, etc are leaked to demoted guest users who should not have access to the repository of a private project according to the permission model. This information is leaked through a fork of the project created by the user(reporter/developer) before being demoted to guest. Once being demoted to guest, the user is able to sneak all the latest commits to the parent branch.

Steps to reproduce
  1. Create a private project in a group as user A.
  2. Add User B as a reporter to this project.
  3. As User B create a fork of the project on you personal namespace.
  4. As User A demote User B to guest from the group settings.
  5. As User B visit the forked repo & go to the create new merge request. In the target branch you will see the parent branch is selected & the commit message is being leaked.
  6. As User A add a new commit message to the parent branch.
  7. As User B refresh the page opened in step 5 & you will see the latest commit added by User A in step 6.
POC

Attaching a video as POC for easier reproduction of the issue

commit_leak.mp4 From the original on GitLab

Impact

An attacker would be able to snoop into commit messages on the default branch even after being demoted to guest user. These commit messages or descriptions may include confidential information to the repo like unreleased features/ vulnerability information, etc

Attachments

Warning: Attachments received through HackerOne, please exercise caution!

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

Root cause

Likely the merge request creation page for a fork did not properly check the user's current permission on the parent project before displaying commit information from the parent branch.

Impact

An attacker could snoop into commit messages on the default branch even after being demoted to guest, potentially exposing confidential information such as unreleased features or vulnerability details.

What the attacker needed

Private project in a group; attacker was a reporter and created a fork; attacker demoted to guest

How it was found

  1. Create a private project in a group as user A.
  2. Add user B as a reporter to the project.
  3. As user B, create a fork of the project in their personal namespace.
  4. As user A, demote user B to guest from the group settings.
  5. As user B, visit the forked repository and start creating a new merge request; the target branch shows the parent branch and its commit message is leaked.
  6. As user A, add a new commit to the parent branch; as user B, refresh the merge request page to see the latest commit.

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.

In GitLab, a guest is a low-permission user who normally cannot see a private project's code. A fork is a personal copy of a project. The report shows that after a user was demoted to guest, their old fork still showed the latest commit messages from the original private project, which should have been hidden.

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.