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
- Create 2 accounts A and B.
- Login from account A.
- Create a group with an ultimate trail and create a project inside the group.
- Now add any files in the project.
- Go to group => settings => permission group and features and restrict ip address of account B.
- Now log in from account B and try to access the project created by the group.
- You will get 404 as your IP address is blocked, however, you can still see the project repo by the following steps.
- Now go to create a project and choose
Run CI/CD for external repository - Create the project.
- 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:
- Create a public group and restrict IP address in the settings
- Create a public project under it
- `git clone <project-url>.git
Try it with git clone https://gitlab.com/repro_1941803/test.git
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
- Create a public group and restrict IP address in the settings
- Create a public project under it
- 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.