Protected Tags Bypass During Pipeline Mirroring
Protected tags were not validated during pull mirroring, allowing a user to bypass protected tag rules by creating a tag in the source project and mirroring it into the target project.
GitLab
Originally disclosed on GitLab
- Fixed in 13 months
- Disclosed after 13 months
HackerOne report #1097232 by vaib25vicky on 2021-02-06, assigned to @rchan-gitlab:
Report | Attachments | How To Reproduce
Report
Summary
Protected tags are not validated during pull mirroring which results into protected tags rules bypass
Steps to reproduce
- Create a public project
projAand choose initialize withReadme.mdat time of creation - Create another public project
projBbut keep this empty and don't choose initialize withReadme.mdat time of creation - Define pull mirror in
projBwhich will pull repository fromprojA
https://gitlab.com/<owner>/<project>/-/settings/repository#js-push-remote-settings

- After successful pull, go to
projBsettings>repository>protected_tags
and define rule such as
Tags: test*
Allowed to create: None

- Now, tags such as
test123,testabcfailed because protected tags rule don't allow creating tags with rulestest* - Go to
projAcreate a tag such astest123 - You can either wait for 5 minutes for auto pull or can manually pull by going over
projB/-/settings/repository#js-push-remote-settings - After success,
test123will be created in theprojBand thus bypass the previously defined protected tags rule
What is the current bug behavior?
Protected tags are not validated during pull mirroring which results into protected tags rules bypass. In push mirror, protected tags are validated but not in pull mirror.
What is the expected correct behavior?
Just like push mirror validating protected tags rules, the pull mirroring should also validate the protected tags.
Output of checks
This bug happens on GitLab.com
Impact
Protected tags are not validated during pull mirroring which results into protected tags rules bypass
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 pull mirroring code path does not enforce protected tag rules, unlike the push mirroring path.
What the attacker needed
Ability to create projects and configure mirroring; Access to a source project to create tags
The fix
Pull mirroring should validate protected tag rules in the same way as push mirroring.
How it was found
- Create a public project projA with a README.
- Create an empty public project projB.
- Set up pull mirroring in projB to pull from projA.
- After the pull, define a protected tag rule in projB that disallows creation of tags matching test*.
- Create a tag named test123 in projA.
- Wait for the automatic pull or trigger a manual pull in projB; the tag test123 is created in projB despite the protected tag rule.
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.
Protected tags are rules that stop certain tags from being created or changed. The report shows that when a project pulls changes from another repository, those rules are not checked, so a tag that should be blocked can still appear.
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.