Skip to content
Info disclosure Disclosed report Beginner

Google Cloud Logging private key showed in plain text in GitLab UI leaking to other group owners

GitLab's Google Cloud Logging audit stream configuration displayed the private key in plain text to other group owners. An attacker with owner access could view the key and use it to access Google Cloud as the user who configured the service.

GitLab

Originally disclosed on GitLab

  • Fixed in 36 days
  • Disclosed after 36 days

⚠️ Please read the process on how to fix security issues before starting to work on the issue. Vulnerabilities must be fixed in a security mirror.

HackerOne report #2079154 by joaxcar on 2023-07-21, assigned to GitLab Team:

Report | Attachments | How To Reproduce

Report

Summary

GitLab 16.2 added functionality to use Google Cloud Logging for audit streams. See https://docs.gitlab.com/ee/administration/audit_event_streaming/#google-cloud-logging-streaming

When configuring this feature a group owner will add a Google Cloud private key to authenticate towards Google Cloud. This private key is not hidden from other owners of the group (or in other situations where others might see the screen).

This is something that GitLab usually hides (see reports https://hackerone.com/reports/1791331 and https://hackerone.com/reports/1557992 for examples of plain text webhook tokens and keys, and this https://hackerone.com/reports/1780770 for leaking google keys). The privilege required is high, but as the impact is access to another system the scope changes.

Steps to reproduce
  1. Create a user with Ultimate access (either by starting a trial or using a self hosted server)
  2. Create a new group https://gitlab.com/groups/new
  3. Go to https://gitlab.com/groups/YOUR_GROUP/-/audit_events?tab=streams
  4. Click "add streaming destination" and select Google Cloud Logging
  5. Add some fake information in all fields, add something looking like a Google Cloud key in the key field
{
  "type": "service_account",  
  "project_id": "demo-project",  
  "private_key_id": "f871b60d0617be19393bb66ea142887fc9621360",  
  "private_key": "-----BEGIN RSA PRIVATE KEY-----  
...  
-----END RSA PRIVATE KEY-----",  
  "client_email": "[email protected]",  
  "client_id": "102234449335144000000",  
  "auth_uri": "https://accounts.google.com/o/oauth2/auth",  
  "token_uri": "https://oauth2.googleapis.com/token",  
  "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",  
  "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/look-no-keys%40demo-project.iam.gserviceaccount.com"  
}
  1. Click save

  2. Expand the created stream and see that the secret key is shown in plain text

  3. optional, add another user as an owner of the group, login as that user and go to the same page to see the key

Impact

Other owners can access Google Cloud as the user that has configured the service

What is the current bug behavior?

Not redacting secrets from UI

What is the expected correct behavior?

The key fields should be considered a secret input as other similar fields

Relevant logs and/or screenshots
Output of checks

This bug happens on GitLab.com)

Impact

Leakage of Google Cloud private key

Attachments

Warning: Attachments received through HackerOne, please exercise caution!

How To Reproduce

Please add reproducibility information to this section:

Design

When user open a destination to try to edit When user click on add a new private key When user put the new private key Gif of interaction
Link of google cloud service link to the place where user can login to their google cloud account after user want to add a new key, a text field and a cancel button show up after user put in the key, the update destination button is enabled

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

Root cause

Likely the UI did not treat the private key field as a secret input, so it was displayed in plain text.

What the attacker needed

Ultimate access; Group owner role; Google Cloud Logging configured

How it was found

  1. Create a user with Ultimate access.
  2. Create a new group.
  3. Go to the group's audit events streams page.
  4. Add a streaming destination and select Google Cloud Logging.
  5. Fill in fake information and add a Google Cloud key in the key field.
  6. Save and expand the stream to see the key 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.

When you set up a connection to Google Cloud, you provide a secret key. GitLab showed that key in plain text to other group owners, so they could copy it and use it to access Google Cloud. This is like leaving your password on a shared screen.

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.