Full updates read for an ex-staff via Webhooks
GitLab did not remove webhooks created by a staff member when that staff member was removed from a private project. An attacker with a former staff account could continue receiving all project updates, including confidential information, through the webhook.
GitLab
Originally disclosed on GitLab
- Fixed in 43 hours
- Disclosed after 43 hours
HackerOne report #1398619 by scaramouche31 on 2021-11-12, assigned to @nmalcolm:
Report | Attachments | How To Reproduce
Report
Summary
Gitlab doesn't delete webhooks after the staff is removed from private project, which allows attacker to get all project updates, including:
- Push events
- Tag push events
- Comments
- Confidential comments
- Issues events
- Confidential issues events
- Merge request events
- Job events
- Pipeline events
- Wiki page events
- Deployment events
- Feature flag events
- Releases events
Steps to reproduce
- As a project creator give
Maintainerrole to some staff account. - As a staff go to Settings -> Webhooks -> Create a webhook (you can use https://webhook.site)
- Remove the staff as a project creator. Note, that prompt says
Also unassign this user from related issues and merge requests, but doesn't say anything about the existing webhooks. - As an admin, for instance, add some comment to any issue.
- As a staff notice that webhooks still fire with every event and leak confidential information.
What is the current bug behavior?
Video PoC:
What is the expected correct behavior?
Either webhooks of ex-staff should be removed or at least the project maintainer should be notified in prompt that they exist while removing a staff.
Results of GitLab environment info
I believe it also works in the .com edition.
Impact
Full access to project updates details.
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 did not clean up or disable webhooks created by a user when that user's project membership was removed.
Impact
An attacker with a former staff account could receive all project updates, including confidential comments and issues, through the webhook.
What the attacker needed
Attacker has a staff account; attacker is given Maintainer role; attacker creates a webhook; attacker is removed from project
The fix
Webhooks created by a removed staff member should be deleted, or the project maintainer should be warned about them during removal.
How it was found
- As a project creator, give the Maintainer role to a staff account.
- As the staff member, go to Settings -> Webhooks -> Create a webhook.
- Remove the staff member from the project.
- As an admin, add a comment to any issue.
- As the staff member, observe that the webhook still fires and leaks confidential information.
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 webhook is an automatic message sent from a service to a URL when something happens. In GitLab, a staff member could set up a webhook to send project updates to an external site. When the staff member was removed from the project, the webhook was not deleted, so the external site kept receiving updates, including private information.
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.