Skip to content
Info disclosure Disclosed report Beginner

Webhook logs leak integration access tokens to other maintainers

The webhook log details page for integrations displayed the full call URL, including the secret access token, to any project maintainer. An attacker with maintainer access could view the token and potentially gain full access to external systems.

GitLab

Originally disclosed on GitLab

  • Fixed in 2 days
  • Disclosed after 2 days

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.

hiddentoken.jpg
hiddentoken.jpg From the original on GitLab

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!

token.jpg
token.jpg From the original on GitLab

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
  1. Create two users victim and attacker
  2. Log in as victim
  3. Create a new project and go to https://gitlab.com/GROUPNAME/PROJECTNAME/-/project_members
  4. Invite attacker as a maintainer to the project
  5. Go to https://gitlab.com/GROUPNAME/PROJECTNAME/-/integrations/drone_ci/edit
  6. fill in the url https://example.com (this does not matter) and the access token HIDDEN_TOKEN
  7. Click save
  8. Click Test settings, a test hook call will be made
  9. Refresh the page
  10. There will be a failed hook call in the logs. Click view details
  11. The page will display the access token in a <h1> title
  12. Copy the URL, log in with attacker and go to the same page
  13. Confirm that the attacker can 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:

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

Impact

Leakage of sensitive tokens to other maintainers could give the attacker full access to external systems.

What the attacker needed

Attacker has maintainer access to the project; victim configures an integration with a token; a test hook call is made

The fix

Tokens should not be shown in the details page.

How it was found

  1. Create two users, victim and attacker.
  2. Log in as victim and create a new project.
  3. Invite attacker as a maintainer to the project.
  4. Go to the Drone CI integration edit page and fill in a URL and an access token.
  5. Click save, then click Test settings to make a test hook call.
  6. Refresh the page, click view details on the failed hook call, and confirm the token is displayed; then log in as attacker and verify the same page shows the token.

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 set up an integration, you provide a secret token so the service can verify requests. The logs of test calls showed the full URL, which included that token, to anyone with maintainer rights. So another maintainer could see the secret and use it to access the external service.

What is Info disclosure?

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.

More from GitLab

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Information disclosure

The lesson behind this report.

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.