Skip to content
Leaked secrets Disclosed report Beginner

GITLAB_API_TOKEN Leaked publicly in github related to your Employee / [redacted]@gitlab.com

A GitLab employee's public GitHub repository exposed a GitLab API token in a dotfile, which the reporter says was not intended to be public.

GitLab

Originally disclosed on GitLab

  • Fixed in 23 hours
  • Disclosed after 23 hours

HackerOne report #1448490 by sam_exploit on 2022-01-13, assigned to @cmaxim:

Report | How To Reproduce

Report

Description :

Github is truly awesome service but its unwise to put sensitive data in public repo as i was able to find repo commited 1 hour ago contained GITLAB_API_TOKEN related to user work in Gitlab. and clearly this is not intended to be public, hope you will accept this.

Employee:

Name->[redacted] https://github.com/[redacted]

POC:

https://github.com/[redacted]/roles/dotfiles/files/.gitconfig

 ; email = [redacted]
[github]  
	user = [redacted]
[gitlab]  
  email = [redacted]  

https://github.com/[redacted]/roles/dotfiles/files/.bashrc

export GITLAB_TOKEN="[redacted]"

export NVM_DIR="$HOME/.nvm"  
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm  
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion

###  The next line updates PATH for the Google Cloud SDK.  
if [ -f '/home/m/Downloads/gcp/google-cloud-sdk/path.bash.inc' ]; then . '/home/m/Downloads/gcp/google-cloud-sdk/path.bash.inc'; fi

###  The next line enables shell command completion for gcloud.  
if [ -f '/home/m/Downloads/gcp/google-cloud-sdk/completion.bash.inc' ]; then . '/home/m/Downloads/gcp/google-cloud-sdk/completion.bash.inc'; fi  

Impact

I will leave this for your assessment but i think this is not intended to be public.
Best Regards,

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 employee committed a file containing a secret token to a public GitHub repository.

Impact

The token was publicly exposed, which the reporter believes was not intended.

What the attacker needed

Public GitHub repository; token committed in a file

The fix

The token should be treated as exposed and not kept in a public repository.

How it was found

  1. Find a public GitHub repository belonging to a GitLab employee.
  2. Inspect the repository's files and locate a dotfile containing a GitLab token.
  3. Extract the token from the file.

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 secret token is like a password that lets someone access an account. Here, an employee accidentally put their GitLab token in a public GitHub repository, so anyone could see it.

What is Leaked secrets?

Keys, tokens or passwords left in public code, apps, logs or responses, that grant real access.

More from GitLab

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Leaked secrets and credentials

The lesson behind this report.

Keys, tokens or passwords left in public code, apps, logs or responses, that grant real access.