sensitive data-creds for database - private key
A configuration file in a public GitHub repository contained plaintext database credentials and a private key. Anyone able to view the repository could read these secrets and potentially use them to access the database.
Originally disclosed on HackerOne
- Triaged in 4 days
- Fixed in 13 days
- Disclosed after 9 months
Summary by the program
A set of sensitive database credentials has been discovered in a publicly accessible GitHub repository. The exposed credentials include a username and password for a database named "█████████" along with a private key. The credentials are stored in plaintext within a configuration file, making them directly accessible to anyone who can view the repository. This exposure represents a significant security risk as it violates the principle of secure credential management.
What the report shows
The target is the Mars program's *.royalcanin.com scope, and the finding is filed under the weakness "Missing Encryption of Sensitive Data" with a medium severity (CVSS 4.6). The report itself is a short summary written by the program rather than a long researcher narrative, so the technical detail available is limited to what that summary states.
The summary describes a set of sensitive database credentials discovered in a publicly accessible GitHub repository. The exposed material consists of:
- A username and password for a database named "█████████".
- A private key.
- The credentials stored in plaintext inside a configuration file.
Because the configuration file sits in a repository that anyone can view, the credentials are directly accessible to anyone who can reach that repository. The report does not name the repository, the file, the database host, or the account the private key belongs to, and it does not describe the request or command used to locate the file. No bounty amount is recorded, and the report does not describe a remediation step.
The outcome recorded by the platform is a disclosed report, dated 2024-11-19, attributed to the researcher mosalah1102.
Root cause
The mistake the report points to is credential management: secrets that should live only in a protected store were committed in plaintext to a configuration file inside a public repository. The report states the credentials are stored in plaintext, and does not say the values were placeholders or that the repository was later made private.
Impact
The report frames the exposure as a significant security risk because it violates the principle of secure credential management. In practical terms, anyone who can view the repository can read the database username and password and the private key in cleartext. What an attacker does with them depends on reachability of the database and on what the private key authorises, neither of which the report establishes. The report does not claim that the credentials were used, that the database was accessed, or that any data was taken.
How this kind of bug works
Secrets leak into source control because the path of least resistance during development is to put connection strings, keys and tokens in a config file next to the code. Version control then does exactly what it is designed to do: it records the file and distributes it to everyone with read access. Making a repository public turns that into worldwide read access, and search engines and code search indexes make the content discoverable without any interaction with the target's own infrastructure.
Two properties make this bug class persistent. First, secrets in git history survive deletion: removing the file in a later commit leaves the blob reachable in earlier commits, in forks and in caches. Second, credentials are often long lived, so a key committed months ago may still be valid. Defences are therefore layered: secret scanning before commit and in CI, keeping secrets out of the repository entirely by injecting them at deploy time from a managed secret store, least-privilege credentials that are rotated regularly, and a response process that revokes and rotates anything found rather than only deleting the file.
How to test for it
This is a reconnaissance and review exercise rather than a request-and-response test.
- Identify the organisation's public repositories and any repositories belonging to its staff or contractors. Look at organisation pages, personal profiles and forks of the organisation's projects.
- Search the code for configuration file names and for keywords that indicate secrets: database connection settings, private key headers, cloud provider key identifiers, and authentication tokens. Code search across public repositories is the main tool here.
- Review commit history, not just the current tree. A file removed in the latest commit may still be present in earlier commits, in branches, in tags and in forks.
- For anything found, determine whether it is live. A positive result is a credential that authenticates successfully against the service it names, or a private key that matches a known public key used by the target. Confirm validity with the minimum interaction needed, and do not access data beyond what proves the finding.
- Record the exact file path, commit and repository so the program can locate it.
Common false positives are placeholder values, example configuration files with dummy values, test keys that are revoked, and credentials for third-party services unrelated to the target's scope. A string that merely looks like a key is not a finding until it is shown to work or to belong to the target.
How it is fixed
Revoke and rotate every exposed credential first, including the database password and the private key, and check logs for use of the credentials while they were exposed. Then remove the secrets from the repository and from its history, and move them into a managed secret store that injects them at runtime. Add secret scanning to pre-commit hooks and CI so the same mistake is blocked next time, restrict repository visibility where possible, and apply least privilege so a leaked credential has a narrow blast radius.
Hunting notes
This bug class hides in the seams between code and operations: sample and local configuration files, deployment scripts, CI configuration, container definitions, documentation and notebooks. Recon signals worth watching are public organisation repositories with recent activity, contributors who fork internal-looking projects into personal accounts, and repositories that reference the target's domains or internal hostnames. To get a report accepted, show that the credential is real and belongs to the target, keep the proof minimal, and describe the exposure path precisely: repository, file, commit and what the secret grants. Programs respond best when the report makes rotation and verification easy and avoids unnecessary use of the credential.
What happened, in plain words
This report is about a company called Mars and its Royal Canin websites, which fall under the address pattern *.royalcanin.com. The finding is filed under the weakness "Missing Encryption of Sensitive Data", with a medium severity and a CVSS score of 4.6. CVSS is a standard way of scoring how serious a security problem is, on a scale from 0 to 10.
The report is short: it is a summary written by the program that received it, not a long story from the researcher. So the technical detail we have is limited to what that summary says.
What the summary describes is a set of sensitive database credentials found in a GitHub repository that anyone can view. GitHub is a website where people store and share code; a repository is a project folder hosted there, and a public repository can be read by anyone on the internet, no login needed. The exposed material was:
- A username and password for a database named "█████████".
- A private key.
- The credentials stored in plaintext inside a configuration file.
A database is an organised store of data, and a username and password are what let a program log in to it. A configuration file is a small settings file that a program reads when it starts, often holding things like where the database lives and how to connect. "Plaintext" means the values are written out as readable text, with no scrambling or encryption at all. A private key is a secret piece of cryptographic material, roughly like a very long password, used to prove identity or to decrypt data.
Because the configuration file sits in a repository anyone can view, the credentials are directly readable by anyone who can reach that repository. The report does not name the repository, the file, the database host, or the account the private key belongs to, and it does not describe the request or command used to find the file. No bounty amount is recorded, and no remediation step is described.
The outcome recorded by the platform is a disclosed report, dated 2024-11-19, attributed to the researcher mosalah1102.
Root cause
The mistake here is about credential management. Secrets that should live only in a protected store were committed, meaning saved into the repository's history, in plaintext inside a configuration file in a public repository. The report does not describe how the file came to be in the repository. The report states the credentials are stored in plaintext, and does not say the values were placeholders or that the repository was later made private.
Impact
The report frames the exposure as a significant security risk because it violates the principle of secure credential management. In practical terms, anyone who can view the repository can read the database username and password and the private key in cleartext. What an attacker does with them depends on whether the database can be reached and on what the private key authorises, and the report establishes neither. It does not claim the credentials were used, that the database was accessed, or that any data was taken.
In general, how this kind of bug works
Secrets leak into source control because the easiest path during development is to put connection strings, keys and tokens in a config file next to the code. Version control, the system that tracks every change to a project, then does exactly what it is designed to do: it records the file and hands it to everyone with read access. Making a repository public turns that into worldwide read access, and search engines and code search indexes make the content findable without touching the target's own systems.
Two properties make this bug class persistent. First, secrets in git history survive deletion: removing the file in a later commit leaves the earlier version reachable in past commits, in forks (copies of the repository) and in caches. Second, credentials are often long lived, so a key committed months ago may still work. Defences are therefore layered: secret scanning before commit and in CI (automated build and test pipelines), keeping secrets out of the repository entirely by injecting them at deploy time from a managed secret store, least-privilege credentials that are rotated regularly, and a response process that revokes and rotates anything found rather than only deleting the file.
In general, how to test for it
This is a reconnaissance and review exercise rather than a request-and-response test.
- Identify the organisation's public repositories and any repositories belonging to its staff or contractors. Look at organisation pages, personal profiles and forks of the organisation's projects.
- Search the code for configuration file names and for keywords that indicate secrets: database connection settings, private key headers, cloud provider key identifiers, and authentication tokens. Code search across public repositories is the main tool here.
- Review commit history, not just the current tree. A file removed in the latest commit may still be present in earlier commits, in branches, in tags and in forks.
- For anything found, determine whether it is live. A positive result is a credential that authenticates successfully against the service it names, or a private key that matches a known public key used by the target. Confirm validity with the minimum interaction needed, and do not access data beyond what proves the finding.
- Record the exact file path, commit and repository so the program can locate it.
Common false positives are placeholder values, example configuration files with dummy values, test keys that are revoked, and credentials for third-party services unrelated to the target's scope. A string that merely looks like a key is not a finding until it is shown to work or to belong to the target.
In general, how it is fixed
Revoke and rotate every exposed credential first, including the database password and the private key, and check logs for use of the credentials while they were exposed. Then remove the secrets from the repository and from its history, and move them into a managed secret store that injects them at runtime. Add secret scanning to pre-commit hooks and CI so the same mistake is blocked next time, restrict repository visibility where possible, and apply least privilege so a leaked credential has a narrow blast radius.
In general, hunting notes
This bug class hides in the seams between code and operations: sample and local configuration files, deployment scripts, CI configuration, container definitions, documentation and notebooks. Recon signals worth watching are public organisation repositories with recent activity, contributors who fork internal-looking projects into personal accounts, and repositories that reference the target's domains or internal hostnames. To get a report accepted, show that the credential is real and belongs to the target, keep the proof minimal, and describe the exposure path precisely: repository, file, commit and what the secret grants. Programs respond best when the report makes rotation and verification easy and avoids unnecessary use of the credential.
Glossary
- Repository: a project folder hosted on a code-sharing site such as GitHub, which can be public or private.
- Public repository: a repository that anyone on the internet can read without logging in.
- Commit: a saved snapshot of changes in version control, kept in the project's history.
- Version control (git): a system that records every change to a project and lets people retrieve earlier versions.
- Fork: a personal copy of someone else's repository.
- Configuration file: a settings file a program reads at startup, often holding connection details.
- Plaintext: data written as readable text, with no encryption.
- Encryption: scrambling data so only someone with the right key can read it.
- Credential: a username and password, key or token used to prove identity and gain access.
- Database: an organised store of data that programs read from and write to.
- Private key: a secret piece of cryptographic material used to prove identity or decrypt data.
- Secret: any value that must stay confidential, such as a password, key or token.
- Token: a string that acts like a temporary password for a service or API.
- API: a way for one program to talk to another over the network.
- CI (continuous integration): automated pipelines that build and test code on every change.
- Secret scanning: automated searching for secrets in code and commit history.
- Least privilege: giving each account or key only the access it truly needs.
- Rotation: replacing a credential with a new one and invalidating the old one.
- Revoke: cancelling a credential so it no longer works.
- CVSS: a standard 0 to 10 score for the severity of a security issue.
- False positive: a finding that looks real but is not, such as a placeholder value.
- Reconnaissance: the information-gathering phase of security testing.