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.


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

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.


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
victimcreates a groupvictim-groupand a projectvictim-projectinside.victimgoes tohttps://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.
victimgoes tovictim-groupmembership pagehttps://gitlab.com/groups/<victim-group>/-/group_membersand addsattackeras guest.attackervisitsvictim-projectand is unable to view deploy keys.
This is the expected behaviour.
attackercreates a new groupattacker-groupand a projectattacker-projectinside.attackergoes tohttps://gitlab.com/<attacker-group>/<attacker-project>/-/settings/repository, Expand Deploy keys and selects Privately accessible deploy keys.attackeris able to viewvictim-projectdeploy keys.
Information disclosure in the title of the deploy key (according to this comment).
attackerclicks on edit next to an important deploy key and changes title asUSELESS_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--------------------------->
attackerenables all the deploy keys under Privately accessible deploy keys.victimremovesattackerfromvictim-group.victimgoes tohttps://gitlab.com/<victim-group>/<victim-project>/-/settings/repository, Expand Deploy keys and changes the title of a deploy key.attackergoes tohttps://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).
attackerclicks on edit next to an important deploy key and changes title asUSELESS_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
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:
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
- Victim creates a group and project, and adds deploy keys.
- Victim adds attacker as a guest to the group.
- Attacker creates their own group and project.
- Attacker goes to their project's repository settings, expands deploy keys, and selects privately accessible deploy keys.
- Attacker can view the victim project's deploy keys and change their titles.
- 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.