Webhook secret tokens leaked in webhook logs
Webhook secret tokens, which are hidden from maintainers after configuration, are still displayed in plain text in the webhook logs. An unauthorised maintainer could read the token and use it to spoof requests to the receiving service.
GitLab
Originally disclosed on GitLab
- Fixed in 29 days
- Disclosed after 29 days
HackerOne report #1757999 by joaxcar on 2022-11-01, assigned to @greg:
Report | Attachments | How To Reproduce
Report
Summary
Since this issue https://gitlab.com/gitlab-org/gitlab/-/issues/359989 was merged webhook secrets are hidden for maintainers of a project after they are saved. The UI and API gives no way of retrieving the secret after configuration. Just like hidden tokens in integrations. The issue states
Use type="password" for the Secret token field input. We also have to make sure that the values are not exposed to the frontend
After the fix the input field only show a line of dots when trying to edit a webhook. But the webhook logs at the same page still contains the secret in plain text.
The docs states this about the secret
You can specify a secret token to validate received payloads. The token is sent with the hook request in the X-Gitlab-Token HTTP header. Your webhook endpoint can check the token to verify that the request is legitimate.
This change to the input field of the UI was made intentionally to hide the secret from other maintainers (as they do not necessarily have access to the receiving service). The leaked token (LOW confidentiality) gives an unauthorized other maintainer the ability to spoof requests to the receiving server (LOW integrity). And the impacted service is the receiving service (Scope changed). This was my rating of this, feel free to edit it as see fit!
Steps to reproduce
- Log in to gitlab
- Create a new project
- Go to https://gitlab.com/GROUP/PROJECT/-/hooks and configure a webhook. Make sure to add a secret
- Click save
- Scroll to the bottom of the page to the list of configured hooks.
- Click edit on the new hook
- You can now see that the secret is hidden
- Scroll down and click "test", a test call will be made to the hook
- Bellow the hook info there should now be a log entry, click the log entry
- Scroll to the bottom of the log page to the request headers, there is the secret in plain text
Impact
The UI leaks secret tokens that should not be accessible after configuration
What is the current bug behavior?
Secret token headers are shown in webhook logs
What is the expected correct behavior?
The secret token header should be redacted in the logs
Relevant logs and/or screenshots


Output of checks
This bug happens on GitLab.com
Impact
The UI leaks secret tokens that should not be accessible after configuration, allowing unauthorised maintainers to use the token
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
The webhook log page displays request headers without redacting the secret token header.
Impact
An unauthorised maintainer could read the secret token and use it to spoof requests to the receiving service, affecting the integrity of that external service.
What the attacker needed
Access to a project as a maintainer; ability to configure webhooks
The fix
The secret token header should be redacted in the webhook logs.
How it was found
- Log in to GitLab and create a new project.
- Go to the project's hooks page and configure a webhook with a secret token.
- Save the webhook and click edit to confirm the secret is hidden.
- Scroll down and click 'test' to make a test call to the hook.
- Click the new log entry and scroll to the request headers to see the secret in plain text.
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 a way for one application to send automatic messages to another. A secret token is like a password that the receiving application checks to make sure the message really came from the expected sender. Here, the token was supposed to be hidden after it was set, but it could still be seen in the logs of test calls, so someone with access to the project could copy it and pretend to be the legitimate sender.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.