Skip to content
Info disclosure Disclosed report Beginner

Missing warnings that GPG keys are exposing users verified email

The GitLab GPG documentation does not warn that the public key exposes the verified email used in it. These emails are visible to unauthenticated visitors, so users might accidentally reveal them.

GitLab

Originally disclosed on GitLab

  • Fixed in 36 days
  • Disclosed after 36 days

HackerOne report #1335671 by joaxcar on 2021-09-10, assigned to @ngeorge1:

Report | Attachments | How To Reproduce

Report

Summary

This might not be that much of an implementation problem rather than a documentation problem. The documentation for creating and using GPG keys for verifying commits fail to mention that any email used in a GPG will be publicly available (even for public users that does not have an account on the instance). The documentation for GPG keys on GitLab mentions that you have to use a verified email from your account:

One of the emails in the GPG key must match a verified email address used by the committer in GitLab.

gitlab.png
gitlab.png From the original on GitLab

and

Enter your real name, the email
address to be associated with this key (should match a verified email address you use in GitLab) and an optional comment

The site does not contain any warning that the public GPG key will expose this email. As a reference, GitHub has a note:

To keep your email address private, use your GitHub-provided no-reply email address. For more information, see "Verifying your email address" and "Setting your commit email address."

github.png
github.png From the original on GitLab

This kind of warning should be present in GitLab as well. As GitLab actually provides a "private" no-reply email for all users (see documentation) which does count as a verified email, this should be mentioned in the GPG instructions.

The problem is that public GPG keys contain the linked email address. And as this email is enforced to be a verified email on the user account, the risk is that a user adds its primary email without realizing that this will now be exposed publicly even for unauthenticated visitors. If a user is only contributing verified commits in a private project the user might use a regular email as the commits would be out of reach for non-members of the project. The GPG key is still displayed on the user's profile page for everyone to see.

As mentioned, this is how GPG works, so it's up to the users to decide if they want to expose their email. But the information should be clearly mentioned in the documentation. As the key is visible by unauthenticated visitors to the instance even if registration is restricted.

Steps to reproduce
  1. Log in as a user "user01"
  2. Add a GPG key following this guide: link
  3. Log out of gitlab
  4. Go to https://gitlab.domain.com/user01.gpg
  5. Save the key in a file on your local machine
  6. Run this command in a terminal
gpg --list-packets <FILE_PATH> | grep '@'  

The email will be shown in the terminal

Impact

Users might accidentally revel their verified emails through public GPG keys

Examples

Test on my account key https://gitlab.com/joaxcar-test03.gpg

What is the current bug behavior?

There is no warnings about GPG keys reveling verified emails

What is the expected correct behavior?

The documentation should mention that adding a GPG key will break the privacy of the email used

Output of checks

This bug happens on GitLab.com

Impact

Missing warnings could lead to users accidentally reveling their verified emails through public GPG keys

Attachments

Warning: Attachments received through HackerOne, please exercise caution!

How To Reproduce

Please add reproducibility information to this section:

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 documentation for GPG keys lacks a warning that the public key will expose the verified email address.

Impact

Users might accidentally reveal their verified emails through public GPG keys, which are visible to unauthenticated visitors.

What the attacker needed

A GitLab account; a GPG key with a verified email

The fix

The documentation should mention that adding a GPG key will break the privacy of the email used.

How it was found

  1. Log in as a user.
  2. Add a GPG key following the guide.
  3. Log out of GitLab.
  4. Go to the user's public GPG key URL.
  5. Save the key to a file.
  6. Run a command to list the key packets and search for an email.

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.

GPG keys are used to sign commits and prove they come from you. Each key contains an email address, and when you upload your public key to GitLab, anyone can see that email. The report says GitLab's instructions don't warn users about this, so people might accidentally share their private email.

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.