Prometheus integration Google IAP details are not hidden, leaking account details from instance/group/project settings to other users
The Prometheus integration in GitLab did not mask Google IAP credentials, so any user could view the instance-wide service account token. An attacker could read the admin-configured token and also change the URL without clearing it, potentially reusing the secret.
GitLab
Originally disclosed on GitLab
- Fixed in 3 months
- Disclosed after 3 months
HackerOne report #1780770 by joaxcar on 2022-11-21, assigned to @cmaxim:
Report | How To Reproduce
Report
Summary
Hi team, this one has been bogging me for a while. It looks to obvious, but I thought I might report it anyhow to make sure you know about it.
Since a while back (14.10.1) GitLab have been masking sensitive integration information. Such as tokens and passwords. They have also made sure that other maintainers can leak the tokens by modifying the configured URLs (see 15.2.1). But one integration is still left fully unmasked, the Prometheus integration.
When a user configures the Prometheus integration the user have the option to add Google IAP credentials (from a Google IAP Service Account JSON file containing the accounts private token and other values). This fields is not masked and allows for any other maintainer in the project to access the configured values. What is worse is that these settings can be configured at group level, and even at instance level. When an admin of the GitLab instance configures an instance wide Prometheus integration, the Google IAP credentials from the admin configuration are fully accessible by any other user in any project.
I see no reason for why these tokens should be unmasked and also accessible for all users on the instance (when configured by an administrator). As with other credential fields the tokens should also be cleared if another user chose to modify the URL to prevent from leakage that way. As it is now, switching to custom configuration will allow a use to reuse the admin configured instance wide token.
Steps to reproduce
- Create an admin account and a normal user account (attacker)
- As the administrator log in to GitLab
- Go to https://gitlab.example.com/admin/application_settings/integrations/prometheus/edit
- Fill out the form, any url, any Client ID, and some token, example:
{
email: key.client_email,
key: key.private_key,
scopes: [*]
}
-
Click save
-
Log out and log back in as the attacker (normal user)
-
Create a new project
-
Go to https://gitlab.example.com/USERNAME/PROJECTNAME/-/settings/integrations/prometheus/edit
-
The instance wide token is fully visible
-
Also try switching to "custom settings" and notice that you can change the URL without the token being removed.
Impact
Any user can leak the instance wide Prometheus Google IAP credentials.
What is the current bug behavior?
Prometheus integration do not mask credential fields
What is the expected correct behavior?
The integration should work as the other integrations, keeping secrets hidden
Output of checks
This bug happens on GitLab.com
Impact
Any user can leak the instance wide Prometheus Google IAP credentials.
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 Prometheus integration's credential fields were not included in the input-masking logic applied to other integrations, and the token was not cleared when the URL was changed.
Impact
Any user could leak the instance-wide Prometheus Google IAP credentials, and the token was not removed when the URL was changed.
What the attacker needed
Admin configures instance-wide Prometheus integration; attacker has a normal user account
The fix
The integration should mask credential fields like other integrations and clear the token when the URL is modified.
How it was found
- Create an admin account and a normal user account.
- As the administrator, go to the instance-wide Prometheus integration settings.
- Fill in the form with any URL, client ID, and a token, then save.
- Log out and log back in as the normal user.
- Create a new project and open its Prometheus integration settings.
- Observe that the instance-wide token is fully visible; switching to custom settings also keeps 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.
GitLab lets administrators set up integrations. The Prometheus integration stored a Google service account token but did not hide it from ordinary users. Anyone logged in could open the settings and see the secret.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.