Maintainer can leak Datadog API key by changing Datadog site
A maintainer could leak the Datadog API key by setting an invalid Datadog site and clicking 'Test settings', causing the full URL with the API key to appear in error logs. An attacker with maintainer access could then read the key from recent events and use it to perform unauthorised actions on the victim's Datadog instance.
GitLab
Originally disclosed on GitLab
- Fixed in 38 days
- Disclosed after 38 days
HackerOne report #1836466 by akadrian on 2023-01-16, assigned to @fvpotvin:
Report | Attachments | How To Reproduce
Report
Summary
This is similar to https://gitlab.com/gitlab-org/gitlab/-/issues/377799.
This time URL is leaked when maintainer intentionally set Datadog Site field into invalid host and reviews logs after clicking "Test settings" button.
Gitlab will try to connect to the host but since the host name is invalid it will return information that "Host cannot be resolved or invalid"
and full URL will be added with API token.
Steps to reproduce
(Step-by-step guide to reproduce the issue, including:)
1 Create Victim Account
2 Create Attacker Account
3 Create victim-project in Victim Account
4 Invite Attacker Account to the victim-project as Maintainer
5 As Victim Go to Settings->Integration->Datadog and set Datadog Site to your Datadog Site
6 As Victim Go to Settings->Integration->Datadog and set Api Key to your Key
7 As Attacker Go to Settings->Integration->Datadog and set Datadog Site to invalid hostname such as lalalelelinvalidforsure123321.com
8 As Attacker Click "Test Settings"
9 As attacker review Recent events and notice that victim key is attached to the error
Impact
Datadog API key can be leaked. This could result in unauthorized actions on victim Datadog instance.
Impact
Datadog API key can be leaked. This could result in unauthorized actions on victim Datadog instance.
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
Likely the application logs the full request URL, including the API key, when a connection error occurs, without redacting sensitive information.
Impact
The Datadog API key could be leaked, potentially allowing unauthorised actions on the victim's Datadog instance.
What the attacker needed
Attacker has maintainer access to a project; victim has configured Datadog integration with API key
How it was found
- Create a victim account and an attacker account.
- Create a project in the victim account and invite the attacker as a maintainer.
- As the victim, set the Datadog site and API key in the integration settings.
- As the attacker, set the Datadog site to an invalid hostname.
- Click 'Test Settings' and review recent events to see the victim's key in the error.
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 project maintainer can change integration settings. If they enter a bad web address, the system tries to connect and fails, but it shows the full web address including a secret key in the error message. Anyone who can see that error message can steal the key and use it to access the victim's Datadog account.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.