Skip to content
Access control Disclosed report Intermediate

A removed attacker is able to invite themself again to victims project and have access

GitLab removed a member's account before expiring their session, so a removed attacker could re-invite themselves while their session was still valid. An attacker could keep access to a victim's project or organisation even after being removed.

GitLab

Originally disclosed on GitLab

  • Fixed in 3 months
  • Disclosed after 3 months

HackerOne report #1661366 by analyz3r on 2022-08-06, assigned to GitLab Team:

Report | How To Reproduce

Report

Summary

Gitlab is using a broken logic to remove members from a project or organization or team and this vulnerability let an attacker to invite himself again when the owner removed him so he will have access to the victims organization again.
When the victim tries to remove the attacker from its organization the application removes the attackers account first then expires the attackers session which bad idea because the attacker is able to invite himself again while he still has access to the organization.

Steps to reproduce with burp suite
  1. As attacker you should already be a member of the victims organization and have access to the victims organization and have access to invite users
  2. As attacker invite yourself by your username and send the request to intruder, the request should look like that:
POST /api/v4/projects/38390638/invitations HTTP/2  
Host: gitlab.com  
Cookie: _gitlab_session=4165bbce54e84c894c67e2eb96d83113; experimentation_subject_id=eyJfcmFpbHMiOnsibWVzc2FnZSI6IklqTXlPR1ZoWVdFMUxUUXhPVEF0TkRNMU5TMWhaR1ZqTFdaaVpqSTRaVFUwWm1ZMVpDST0iLCJleHAiOm51bGwsInB1ciI6ImNvb2tpZS5leHBlcmltZW50YXRpb25fc3ViamVjdF9pZCJ9fQ%3D%3D--4c52727c8fb75b6ff617b46ab474ac56d8d7067f; _sp_ses.6b85=*; _sp_id.6b85=273134bc-fdec-44fb-9845-03e714bcbc97.1659793827.1.1659795291.1659793827.31ba80f1-3972-445e-b4eb-be5d770b866d; _biz_uid=b7bd2dc29ca64e0692fdbdec93a16b6e; _biz_sid=90ed5c; _biz_nA=7; _biz_pendingA=%5B%5D; OptanonConsent=isGpcEnabled=0&datestamp=Sat+Aug+06+2022+16%3A58%3A13+GMT%2B0300+(Arabian+Standard+Time)&version=6.36.0&isIABGlobal=false&hosts=&consentId=1f8f83a9-68da-4e5b-9200-3dfef2744372&interactionCount=1&landingPath=NotLandingPage&groups=C0001%3A1%2CC0003%3A1%2CC0002%3A1%2CC0004%3A1&AwaitingReconsent=false; _ga=GA1.2.981374674.1659793828; _gid=GA1.2.1526156079.1659793828; _biz_flagsA=%7B%22Version%22%3A1%2C%22XDomain%22%3A%221%22%2C%22ViewThrough%22%3A%221%22%2C%22Frm%22%3A%221%22%7D; event_filter=all; sidebar_collapsed=false; cf_chl_2=ca1a3f835cc9fa2; cf_chl_prog=x14; cf_clearance=KEcSupVTFxDQ8fYMflh7GhMI_hG_Dt0eyiaCEBTqnFA-1659794201-0-150  
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:103.0) Gecko/20100101 Firefox/103.0  
Accept: application/json, text/plain, */*  
Accept-Language: en-US,en;q=0.5  
Accept-Encoding: gzip, deflate  
Referer: https://gitlab.com/victimgroup/Victimproject/-/project_members  
X-Csrf-Token: xKkpSS8Ik2wIkZWyCIHgXnVv6UyMMgMGMeUuxJ5w8pJrnrS3qNwzwJbO4F1TTTuxwPppucgIJN/LMpTCDalwqA==  
X-Requested-With: XMLHttpRequest  
Content-Type: application/json  
Content-Length: 179  
Origin: https://gitlab.com  
Sec-Fetch-Dest: empty  
Sec-Fetch-Mode: cors  
Sec-Fetch-Site: same-origin  
Te: trailers

{"format":"json","expires_at":"2022-08-10T21:00:00.000Z","access_level":40,"invite_source":"project-members-page","tasks_to_be_done":[],"tasks_project_id":"","user_id":"12237771"}  
  1. As attacker in intruder add 1000 null payloads and 5 threads per request
  2. As attacker start the attack before the victim remove you
  3. As victim try to remove the attacker while he started the brute force, and the attacker should be removed successfully
  4. As attacker and victim refresh your page you see the attacker is joined Just now by the attacker which means he joined again when he was doing the brute force attack and the victim removed

These steps could be automated so the attacker will never be removed and always have access to the victims organization or project.

Impact

An attacker is able to stay in the victims organization or projects due a broken logic issue that used to remove the attackers, by this way the attacker will always have access to the victims organization and could act as owner because no one is able to remove him.
As I think this logic have been used in my other functions that requires to have session or authentication.

Examples

I have tested it on gitlab website.

What is the current bug behavior?

An attacker is able to gain access to somewhere that he was been restricted from by adding himself again or inviting himself again due a logical issue that I described at summary.

POC

I have a video poc

Impact

An attacker is able to stay in the victims organization or projects due a broken logic issue that used to remove the attackers, by this way the attacker will always have access to the victims organization and could act as owner because no one is able to remove him.
As I think this logic have been used in my other functions that requires to have session or authentication.

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 removal process deleted the user's account before invalidating their active session, leaving a window where the session could still perform actions.

Impact

An attacker could stay in the victim's organisation or projects and act as owner because no one is able to remove them.

What the attacker needed

Attacker is a member of the victim's organisation; attacker has permission to invite users; victim attempts to remove the attacker

How it was found

  1. As attacker, be a member of the victim's organisation with permission to invite users.
  2. As attacker, send an invitation request to add yourself by username, and send it to Intruder.
  3. In Intruder, add many null payloads and set several threads per request.
  4. Start the attack before the victim removes you.
  5. As victim, remove the attacker while the attack is running; the attacker is removed successfully.
  6. Refresh the page and see that the attacker has joined again 'Just now by the attacker'.

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.

When you remove someone from a project, the system should immediately stop them from doing anything. Here, the system deleted the person's account but did not immediately end their logged-in session, so they could still send requests. The attacker used that short window to invite themselves back.

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.