Webhook logs leak integration access tokens to other maintainers
HackerOne report #1557472 by joaxcar on 2022-05-03, assigned to @rshambhuni:
Report | Attachments | How To Reproduce
Report
Summary
The latest patch 14.10.1 added masking to sensitive input fields to prevent leakage of access tokens through the UI. This prompted me to look a bit closer to those integrations.
It turns out that the integration settings page contains a worse leakage of these tokens, and is still present after the latest patch.
When a maintainer/owner configures integrations that adds a webhook event to the project (such as CI/CD integrations like Buildkite and Drone) the user is prompted to add an URL to the integration and an access token. The access token field is write only (and as of 14.10.1 also a password field) and will not display the present integration setting. So after saving the integration the token field will be empty to not leak this token.
The problem is that after saving and activating the integration, a list is displayed in the bottom of the screen where the webhook log is displayed. If any maintainer of the project click to view details on any of these log entries the user will be presented with a page displaying the call that was made. Including the secret tokens!
I will come back with a full list of affected integrations if needed. I have tested 4 which are affected at the moment
Steps to reproduce
- Create two users
victimandattacker - Log in as
victim - Create a new project and go to https://gitlab.com/GROUPNAME/PROJECTNAME/-/project_members
- Invite
attackeras a maintainer to the project - Go to https://gitlab.com/GROUPNAME/PROJECTNAME/-/integrations/drone_ci/edit
- fill in the url
https://example.com(this does not matter) and the access tokenHIDDEN_TOKEN - Click save
- Click
Test settings, a test hook call will be made - Refresh the page
- There will be a failed hook call in the logs. Click
view details - The page will display the access token in a
<h1>title - Copy the URL, log in with
attackerand go to the same page - Confirm that the
attackercan see the token
Impact
Leakage of sensitive tokens to other maintainers. Potentially giving the attacker full access to external systems
What is the current bug behavior?
Webhook log details pages display full call URL containing secret tokens
What is the expected correct behavior?
Tokens should not be shown in the details page
Output of checks
This bug happens on GitLab.com
Impact
Leakage of sensitive tokens to other maintainers. Potentially giving the attacker full access to external systems
Attachments
Warning: Attachments received through HackerOne, please exercise caution!
How To Reproduce
Please add reproducibility information to this section:

