Admin Login Credential Leak for DoD Gitlab EE instance
A password for a private GitLab Enterprise Edition instance was committed to a public GitHub repository, and the default administrative username combined with that password gave full administrative access. An attacker with the leaked credentials could read private source code, secrets and user data, and create or modify repositories.
- Triaged in under an hour
- Fixed in 44 hours
- Disclosed after 3 months
Summary
A DoD employee/contractor exposed the ███ password in a GitHub repository (█████████) leading to full ███ access in a DoD DISA-associated private Gitlab EE instance (███).
Description
The IP address ████ recently hosted the subdomain █████████ (as of 2019-09-23).
██████
Now port 80 points to a private Gitlab Enterprise Edition instance. The current hostname is ██████ and the TLS certificate points to ████.
HTTP/1.1 301 Moved Permanently
Server: nginx
Date: Tue, 18 Feb 2020 12:30:01 GMT
Content-Type: text/html
Content-Length: 162
Connection: keep-alive
Location: https://████:443/
Going to https://██████████/explore shows no projects, groups, or snippets exposed publicly.
However, a Github search for █████████ as displayed in the TLS certificate leads to a few interesting code commits. This commit (████████) for a project titled "██████ (█████)" contains █████ credentials for a particular Jenkins instance.
- name: JENKINS_OC_USER
value: ███████
- name: JENKINS_OC_PASSWD
value: ████████
The default Gitlab EE username ████████ with the password ██████, as shown in GitHub commit, gains full █████████istrative access.
After confirming valid login, I made no further attempts to escalate privileges on the machine, nor attempted deeper access into the private contents of this Gitlab EE instance.
Suggested Mitigation/Remediation Actions
In addition to updating security credentials to this Github commit, you might want to review any other DoD applications that are possibly using the same password.
Other
In addition to updating ██████ credentials for this Gitlab EE application, you might want to review any other DoD applications that are possibly using the same password.
Impact
Exploited by a malicious actor, the security impact of this leak could include:
- Leverage valid credential to gain access to other DoD applications
- View sensitive source code in private repositories
- Access potential secret tokens, API keys, passwords contained in source code
- Change user information
- Access other user accounts
- Create new unauthorized repositories
- Host malicious content
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 a secret was committed to a public GitHub repository and the same password was reused for the default administrative account of the GitLab instance.
Impact
An attacker with the leaked credentials could gain full administrative access to the private GitLab instance, exposing private source code, secrets and user accounts, and allowing the creation of repositories hosting malicious content.
What the attacker needed
Leaked password in a public repo; default admin username in use; internet access to the GitLab host
The fix
The credentials should be rotated and the secret removed from the public repository, and other applications reusing the same password should be reviewed.
How it was found
- Search GitHub for the hostname shown in the TLS certificate.
- Find a commit containing credentials.
- Log in to the GitLab instance with the default username and the leaked password.
- Confirm that the login grants administrative access.
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 developer saved a password inside a code repository that anyone on the internet can read. That password happened to work for the administrative account of a private code-hosting server, so anyone who found it could log in as an administrator. This is dangerous because private code often contains further passwords and keys.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.