Group integration settings sensitive information exposed to project maintainers
The GitLab integration API disclosed Discord and Slack webhook URLs to project maintainers, even though the web UI hides these sensitive URLs. An attacker with maintainer access could use the leaked webhook URL to send arbitrary messages to the group owner's Discord or Slack channels without authentication.
GitLab
Originally disclosed on GitLab
- Fixed in 3 months
- Disclosed after 3 months
HackerOne report #1796210 by vaib25vicky on 2022-12-08, assigned to GitLab Team:
Report | How To Reproduce
Report
Hi,
Summary
Integration settings such as Discord and Slack notifications require webhook url which is a unique url with token that allows access to user discord/slack.
Anyone with access to this webhook url can access discord/slack and send any content/message without authentication.
So, for this reason when Gitlab discord/slack integration is configured, then Gitlab don't show the webhook url to other members of the project in the UI.
However, I've found that integration api is disclosing the webhook url to other members of the project.
This is a security issue and an attack scenario is like:
- Group owner creates a Discord integration at group level
- Project maintainers when go to Discord integration page at project level can't see the sensitive url such as webhook url
- Project maintainers uses integration api
GET /projects/:id/integrations/discordand gain access to the group owner's Discord webhook url
Steps to reproduce
- Group owner set-up Discord integration at group level by going over
https://gitlab.com/groups/<group-name>/-/settings/integrations/discord/edit - Lets suppose there's a project inside the group and there exists a maintainer named
foo foouses the integration api and gain access to group owner Discord webhook url
curl --request GET \
--url https://gitlab.com/api/v4/projects/<PROJECT-ID>/integrations/discord \
--header 'Content-Type: application/json' \
--header 'PRIVATE-TOKEN: <USER-ACCESS-TOKEN>'
What is the current bug behavior?
Webhook url by Discord/Slack and similar apps are sensitive information. Gitlab protects this url in the UI but not in the api.
Even if there two owner in the project then second owner can't access tokens and sensitive urls set-up by the first owner in the integration settings.
What is the expected correct behavior?
Expected behavior here is to masked or not show the discord/slack webhook urls in api responses just like we don't show them in the website UI
Output of checks
This bug happens on GitLab.com
Impact
The webhook urls allow accessing and sending customs message in the channels in discord/slack without any authentication. If they are leaked to unauthorized user then he/she can send arbitrary messages and depending upon the configuration can use this same bug to run commands in the channels.
Thanks!
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 API endpoint for integrations did not mask or omit sensitive fields such as webhook URLs, unlike the web UI.
Impact
A project maintainer could obtain the webhook URL and send arbitrary messages to the group owner's Discord or Slack channels, and depending on configuration, possibly run commands.
What the attacker needed
A GitLab group with Discord/Slack integration; attacker has maintainer role on a project in the group
The fix
The API should mask or omit sensitive webhook URLs in responses, just as the web UI does.
How it was found
- Group owner sets up a Discord integration at the group level.
- A project maintainer uses the integration API to request the Discord integration settings.
- The API response includes the group owner's Discord webhook URL.
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 URL is like a secret password that lets someone post messages into a chat channel. GitLab normally hides this URL in its web interface, but the report found that the API still returned it to project maintainers. That meant a maintainer could see the secret URL and use it to post messages as if they were the group owner.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.