Skip to content
Access control Disclosed report Intermediate

Blocked IP address can still get the whole repo by using Run CI/CD for external repository to connect IP restricted repository

An IP address restriction on a GitLab group could be bypassed by using the 'Run CI/CD for external repository' feature to import the repository, allowing a blocked user to clone and view all files. The attacker could access the entire repository despite the IP block.

GitLab

Originally disclosed on GitLab

  • Fixed in 47 days
  • Disclosed after 47 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 #1941803 by ali_shehab on 2023-04-11, assigned to @dcouture:

Report | How To Reproduce

<details><summary>Original report hidden, simpler repro below</summary>

Report

Summary

Hi team, hope you are well. You may block IP address because you only want this repo to be accessible by a specific IP address. However, it is still possible to get the whole repo with all its files by connecting to the repo while creating the project.

Steps To Reproduce

  1. Create 2 accounts A and B.
  2. Login from account A.
  3. Create a group with an ultimate trail and create a project inside the group.
  4. Now add any files in the project.
  5. Go to group => settings => permission group and features and restrict ip address of account B.
  6. Now log in from account B and try to access the project created by the group.
  7. You will get 404 as your IP address is blocked, however, you can still see the project repo by the following steps.
  8. Now go to create a project and choose Run CI/CD for external repository
  9. Create the project.
  10. you will be able to all the files of the repo although your IP address was blocked.

Impact

A user that his ip is restricted can still view the repo of the project.

</details>

How To Reproduce

Please add reproducibility information to this section:

  1. Create a public group and restrict IP address in the settings
  2. Create a public project under it
  3. `git clone <project-url>.git

Try it with git clone https://gitlab.com/repro_1941803/test.git

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 repository import feature (Run CI/CD for external repository) did not enforce the group's IP address restriction when fetching the repository.

Impact

A user whose IP address is restricted could still view and clone the entire repository of the project.

What the attacker needed

A GitLab account; IP restriction configured on a group; access to the 'Run CI/CD for external repository' feature

How it was found

  1. Create a public group and restrict IP address in the settings
  2. Create a public project under it
  3. Clone the project using git clone with the project URL

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.

GitLab lets administrators restrict access to a group so that only certain IP addresses can view its projects. This report shows that a user from a blocked IP address could still copy the whole repository by using a feature that imports external repositories, because that feature did not check the IP restriction. So the protection could be bypassed.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

More from GitLab

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.