Skip to content
Info disclosure Disclosed report Beginner

No security warning when you submit MR from project with restricted repository visibility

When a user creates a merge request from a fork with restricted repository visibility to a public parent project, no warning is shown that the merge request will expose the fork's private code to everyone. An attacker could accidentally disclose private code by submitting such a merge request.

GitLab

Originally disclosed on GitLab

  • Fixed in 50 days
  • Disclosed after 50 days

⚠️ 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 #2015919 by shells3c on 2023-06-07, assigned to GitLab Team:

Report | Attachments | How To Reproduce

Report

Summary

Follow up #1851858

[@]ameya_gitlab told me to submit this report and he would triage it. Hi [@]ameya_gitlab!

Steps to reproduce
  1. Create a public project
  2. Using another account, fork the project, set the fork's repository visibility to Only Project Members.
  3. Make a commit to the fork
  4. Create a merge request to the parent fork, and while creating it, you won't see any warning like this:
image.png
image.png From the original on GitLab

Which might make users unaware of security risks that they don't know.

With #1851858 not being fixed, I also suggest updating the error message to warn users that their code is going to be exposed to EVERYONE, in case they think that their MRs are only going to be exposed to the project members because Merge Requests visibility has been set to Only Project Members

Impact

Disclosure of private code by accident

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 interface does not check or warn when the source project's repository visibility is more restrictive than the target project's, so users are not alerted that their code will become public.

Impact

Private code could be disclosed by accident because users are not warned that their merge request will expose it to everyone.

What the attacker needed

A public project; a fork with restricted visibility; a commit in the fork

The fix

The error message should be updated to warn users that their code will be exposed to everyone when they create a merge request from a project with restricted visibility to a public project.

How it was found

  1. Create a public project.
  2. Using another account, fork the project and set the fork's repository visibility to Only Project Members.
  3. Make a commit to the fork.
  4. Create a merge request to the parent project; no warning is shown.

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 merge request is a way to propose changes to a project. If you fork a project, you get your own copy. If your copy is private but the original project is public, creating a merge request from your copy can make your private code visible to everyone. This report says the system does not warn you about that risk.

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.