Skip to content
Access control Disclosed report Intermediate

Unauthorized member is able to view project deploy keys as well as change its title misleading the maintainers/owners of project.

An unauthorised member (guest) of a project could view the project's privately accessible deploy keys and change their titles. This could mislead maintainers into deleting important deploy keys, affecting dependent services.

GitLab

Originally disclosed on GitLab

  • Fixed in 8 months
  • Disclosed after 8 months

⚠️ 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 #2037814 by theluci on 2023-06-25, assigned to @greg:

Report | Attachments | How To Reproduce

Report

Hello,
This report is similar to CVE-2022-2095 in the sense that an unauthorized member can view project deploy keys.
But this report also shows that the unauthorized member is also able to make changes to the deploy key’s title.

Background

Gitlab provides a feature to set up Deploy Keys.
Only the owner/maintainer of a project can view project’s deploy keys.
Changing deploy key’s title is also something that only maintainer/owner of a project can do.

Vulnerability

While fetching the Privately accessible deploy keys, gitlab doesn’t check whether the member has access to the deploy keys or not.
As a result,
An unauthorized member, for example, a guest (attacker) of a victim-project can create a new project attacker-project goes to its Settings->Repository, Expand Deploy keys and can view victim-project deploy keys under Privately accessible deploy keys.

25jun-1.png
25jun-1.png From the original on GitLab
25jun-2.png
25jun-2.png

attacker is also able to change deploy key’s title misleading the maintainers/owners of victim-project.

25jun-3.png
25jun-3.png From the original on GitLab

Moreover,
After the deploy keys
has been enabled in attacker-project, even if the attacker is removed from victim-project, the attacker can continue to view deploy keys as well as change their title.

25jun-3.5.png
25jun-3.5.png From the original on GitLab
25jun-4.png
25jun-4.png

That is a removed member can continue to view victim-project deploy keys as well as change their title misleading maintainers/owners of victim-project.

<--------------------------------------------------------Important------------------------------------------------------->

This comment led me to believe that there is information exposure in the deploy key’s title (“deploy key for internal_server_name”).
Also, an unauthorized member changing the deploy key’s title to USELESS_DEPLOY_KEY,KEY_TO_BE_DELETED, DELETE_KEY_ON_23rd etc. can mislead the other maintainers/owners into deleting the deploy key, which will affect the services that depend on the key.

<------------------------------------------------------------------------------------------------------------------------->

Steps to reproduce

  1. victim creates a group victim-group and a project victim-project inside.
  2. victim goes to https://gitlab.com/<victim-group>/<victim-project>/-/settings/repository, Expand Deploy keys and adds a few deploy keys.

In a real-world scenario, there will already be a few keys added to the project.

  1. victim goes to victim-group membership page https://gitlab.com/groups/<victim-group>/-/group_members and adds attacker as guest.
  2. attacker visits victim-project and is unable to view deploy keys.

This is the expected behaviour.

  1. attacker creates a new group attacker-group and a project attacker-project inside.
  2. attacker goes to https://gitlab.com/<attacker-group>/<attacker-project>/-/settings/repository, Expand Deploy keys and selects Privately accessible deploy keys.
  3. attacker is able to view victim-project deploy keys.

Information disclosure in the title of the deploy key (according to this comment).

  1. attacker clicks on edit next to an important deploy key and changes title as USELESS_KEY_TO_BE_DELETED.

attacker is able to mislead one of the maintainers or owner of the project into deleting an important deploy key, affecting the services that depend on the key.

<----------------------------Important - Removing attacker--------------------------->

  1. attacker enables all the deploy keys under Privately accessible deploy keys.
  2. victim removes attacker from victim-group.
  3. victim goes to https://gitlab.com/<victim-group>/<victim-project>/-/settings/repository, Expand Deploy keys and changes the title of a deploy key.
  4. attacker goes to https://gitlab.com/<attacker-group>/<attacker-project>/-/settings/repository, Expand Deploy keys and can view the updated deploy keys.

Information disclosure in the title of the deploy key (according to this comment).

  1. attacker clicks on edit next to an important deploy key and changes title as USELESS_KEY_TO_BE_DELETED.

attacker is able to mislead one of the maintainers or owner of the project into deleting an important deploy key, affecting the services that depend on the key.

As can be seen, a non-project member attacker is able to view victim-project deploy keys, as well as make changes to its title.

POC

poc-25jun.mp4 From the original on GitLab

Output of checks

This bug happens on GitLab.com (Probably on instance too).

Impact

Unauthorized member (Members with insufficient role or Removed member) is able to view project deploy keys as well as change its title to mislead the maintainers/owners of project.

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 application does not properly check whether a user has permission to access a project's deploy keys when listing privately accessible deploy keys.

Impact

An unauthorised member could view deploy keys and change their titles, potentially misleading maintainers into deleting important keys and disrupting services that depend on them.

What the attacker needed

Attacker is a guest member of victim project; attacker has their own project

How it was found

  1. Victim creates a group and project, and adds deploy keys.
  2. Victim adds attacker as a guest to the group.
  3. Attacker creates their own group and project.
  4. Attacker goes to their project's repository settings, expands deploy keys, and selects privately accessible deploy keys.
  5. Attacker can view the victim project's deploy keys and change their titles.
  6. Victim removes attacker from the group, but attacker can still view and change titles of the deploy keys.

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.

Deploy keys let automated systems access a repository. Normally only maintainers or owners can see or manage them. Here a guest, or even a removed member, could still see and rename them, which might trick maintainers into deleting a key other systems rely on.

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.