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
- Create a private project in a group as user A.
- Add User B as a reporter to this project.
- As User B create a fork of the project on you personal namespace.
- As User A demote User B to guest from the group settings.
- 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.
- As User A add a new commit message to the parent branch.
- 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
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:
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
- Create a private project in a group as user A.
- Add user B as a reporter to the project.
- As user B, create a fork of the project in their personal namespace.
- As user A, demote user B to guest from the group settings.
- 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.
- 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.