Skip to content
Access control Disclosed report Intermediate

Unauthorized Access to Container Registry of other groups / CVE-2019-12825

A user could access another group's container registry images after the original group was renamed and a new group with the old name was created. This allowed unauthorised access to Docker images belonging to other groups.

GitLab

Originally disclosed on GitLab

  • Fixed in 6 months
  • Disclosed after 6 months

HackerOne report #615168 by atomic111 on 2019-06-14, assigned to gitlab_cmaxim:

Unauthorized Access to Container Registry of other groups

created two users

pentest1

username = pentest1
mail = [email protected]
pw = Pentest1]

pentest2

username = pentest2
mail = [email protected]
pw = Pentest2]

Login as pentest1

YML
build:docker:  
  stage: build  
  image: docker:18  
  services:  
    - docker:dind  
  before_script:  
    - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY  
  script:  
    # fetches a image, this could also be built here  
    - docker pull centos:7  
    - docker pull centos:6  
    - docker pull oraclelinux:7  
    # instead of docker build, we are using docker tag here, but it does not really   
    # - >  
    #   DOCKER_BUILDKIT=1  
    #   docker build  
    #   --tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA  
    #   --tag $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME  
    #   -f Dockerfile  
    #   .  
    - docker tag docker.io/centos:7 $CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA  
    - docker tag docker.io/centos:7 $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME  
    - docker tag docker.io/centos:6 $CI_REGISTRY_IMAGE:2.12.1  
    - docker tag docker.io/oraclelinux:7 $CI_REGISTRY_IMAGE:2.13.1

    # push image to gitlab registry  
    - docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA  
    - docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME  
    - docker push $CI_REGISTRY_IMAGE:2.12.1  
    - docker push $CI_REGISTRY_IMAGE:2.13.1  
  • you should see the published repos
  • Logout as pentest1

Login as pentest2

  • Login with user pentest2
  • Create a new group called grouppentest1
  • Create a new project called trial1
  • See docker images from previous user

Impact

  • get access to docker registries of other groups without having the rights

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 container registry did not properly check permissions after a group was renamed, so a new group with the same name inherited access to the old group's images.

Impact

An attacker could gain access to Docker registries of other groups without having the rights.

What the attacker needed

Two user accounts; ability to create groups and projects; CI pipeline to push images

How it was found

  1. Create two users, pentest1 and pentest2.
  2. As pentest1, create a private group and a private project, then add a CI configuration that builds and pushes Docker images to the container registry.
  3. Run the CI pipeline to publish images to the registry.
  4. Rename the group from grouppentest1 to grouppentest2.
  5. As pentest2, create a new group named grouppentest1 and a project named trial1.
  6. View the container registry and see the images from pentest1's original group.

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.

A container registry is a place where Docker images are stored. When a group was renamed, its old name became free, and another user could create a new group with that name and see the old group's images. This means private images were exposed to someone who should not have access.

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.