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:
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
- Find a public GitHub repository belonging to a GitLab employee.
- Inspect the repository's files and locate a dotfile containing a GitLab token.
- 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.