Skip to content
Access control Disclosed report Beginner

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 projA and choose initialize with Readme.md at time of creation
  • Create another public project projB but keep this empty and don't choose initialize with Readme.md at time of creation
  • Define pull mirror in projB which will pull repository from projA

https://gitlab.com/<owner>/<project>/-/settings/repository#js-push-remote-settings

prot2.png
prot2.png From the original on GitLab
  • After successful pull, go to projB settings>repository>protected_tags
    and define rule such as

Tags: test*
Allowed to create: None

prot1.png
prot1.png From the original on GitLab
  • Now, tags such as test123, testabc failed because protected tags rule don't allow creating tags with rules test*
  • Go to projA create a tag such as test123
  • 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, test123 will be created in the projB and 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:

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 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

  1. Create a public project projA with a README.
  2. Create an empty public project projB.
  3. Set up pull mirroring in projB to pull from projA.
  4. After the pull, define a protected tag rule in projB that disallows creation of tags matching test*.
  5. Create a tag named test123 in projA.
  6. 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.

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.