User can get access to a Private Project again even after being removed from the Project
When a project member was removed, invitations they had already sent to unregistered email addresses stayed valid instead of being revoked. The removed member could accept their own pending invitation and regain access to the private project.
GitLab
Originally disclosed on GitLab
- Fixed in 18 months
- Disclosed after 18 months
HackerOne report #492621 by rgupt on 2019-02-07, assigned to dappelt:
Summary:
When a user invites a new member via email and the invitation is still pending to be accepted and the invited person gets removed from the project, then the pending invitation is not automatically removed and is still active. As a result, a bad actor can send invitations to himself (i.e. his alias email) and can join the project again, even after being removed.
Steps To Reproduce:
- Assume there is a private project Project1 and the owner of the project is User1.
- User1 invites a new member User2 ([email protected]) and gives him maintainer permission.
- User2 navigates to Project1 Settings & sends out an invitation to a new email account which has not been registered in Gitlab yet.
- Assume User2 sent out an invitation to [email protected]
Note in this case anything, the email is still sent to [email protected] as anything after + sign is ignored by gmail.
5. Now when User1 removes User2 from the Project, the pending email invitation sent by User2 is still not removed automatically and is active.
6. Now when the User2 clicks on the Accept Invitation link in the email sent, the link is still not expired/removed and user can click & confirm to accept the invitation.
Note: Another flaw which I found was that even though the invitation was sent to [email protected], the invitation can still be accepted by User2's account who has an email [email protected].
Hence with the above mentioned flaws, a user can get access to the private project, even after being removed from the Project.
Comparison of this behavior with Github:
I did the same steps mentioned above in the Github platform, and the Github platform handles this really well. Whenever a user is removed from the Organization (or) a Private Project, all the pending invitations sent by that user is also automatically removed. However in case of Gitlab, it is not removed.
Impact
If a user gets a maintainer permission to a private project, the user can still get access to the private project again, even when that user was being removed from the project.
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
Impact
A removed maintainer could regain access to a private project, and an invitation sent to one address could be accepted by a different account.
What the attacker needed
Maintainer role on a private project; invitation to an unregistered email; member is then removed
How it was found
- The owner invites a second user as a maintainer of a private project.
- That second user sends an invitation to an email address not yet registered on the platform.
- The owner removes the second user from the project.
- The second user opens the still-valid invitation link and accepts it, regaining access.
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 project owner can invite people by email, and those invitations stay open until accepted. The report shows that removing a member does not cancel the invitations that member already sent. So the removed person can use one of those old invitations to get back into the private project.
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.