Skip to content
Access control Disclosed report Beginner

Github project import restriction bypass

An administrator can disable the GitHub import source in GitLab's settings, but a user can bypass this restriction by using the import API instead of the web interface. This allows the user to import a GitHub repository despite the administrator's restriction.

GitLab

Originally disclosed on GitLab

  • Fixed in 16 months
  • Disclosed after 16 months

HackerOne report #497975 by xanbanx on 2019-02-19, assigned to estrike:

A GitLab administrator can restrict the import sources and disable the Github import from the admin interface.

However, this restriction can be bypassed by any user by importing the Github project via the import API rather than using the web interface: https://docs.gitlab.com/ee/api/import.html#doc-nav

Steps To Reproduce:

Tested on a local installation of GitLab 11.8.0-pre (gitlab-ce@3dca5b307683e9f91941d6ddafaace6d856f8c7b)

  1. As the administrator, go to http://example.gitlab.com/admin/application_settings and disable the Github import source as shown in the screenshot below
  2. As a user named, e.g., user, perform the following API call:
Bash
curl --request POST --header "PRIVATE-TOKEN: <your-GL-Token> --data "personal_access_token=<GH-Token>&repo_id=1&target_namespace=user" https://example.gitlab.com/api/v4/import/github  
  1. Instead of raising an error message, the API correctly imports the repository from GitHub

Impact

The user bypasses the restriction of import sources setup by the administrator

Attachments

Warning: Attachments received through HackerOne, please exercise caution!

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 API endpoint for GitHub import does not check whether the GitHub import source is enabled in the application settings, while the web interface does.

Impact

A user can bypass the administrator's restriction on import sources and import a GitHub repository.

What the attacker needed

GitLab instance with GitHub import disabled by admin; A GitLab user account; A GitHub personal access token

How it was found

  1. As the administrator, go to the application settings and disable the GitHub import source.
  2. As a regular user, send a POST request to the import API endpoint with a GitHub personal access token and repository details.
  3. The API imports the repository from GitHub without error, bypassing the restriction.

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 disable import sources like GitHub. However, a user could still import from GitHub by calling the import API directly, ignoring the administrator's restriction.

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.