internal dev tokens disclosure
The public GitHub repository for Snapchat's open-source KeyDB project contained internal development data in its commit history, including a reference to an internal corporate hostname and a GitHub personal access token. An attacker who found these commits could read the exposed token and internal infrastructure details.
Originally disclosed on HackerOne
- Triaged in 7 days
- Fixed in 59 days
- Paid in 26 days
- Disclosed after 2 months
snapchat has made Keydb as opensource but its development repo on github is leaking too much internal sensitive data in commits history which should not be a good idea to be revealed in open source project. such as https://github.com/Snapchat/KeyDB/commit/157b32109854f947843366f66215ccf90809e766
[Dockerfile](https://github.sc-corp.net/Snapchat/keydb-internal/github-action-runner-docker/Dockerfile).
3. Take the token from that script. Should be in "Configure" section:
```
./config.sh --url https://github.com/EQ-Alpha/KeyDB --token ████
██████
Impact
internal dev sensitive information disclosed publicaly for example PAT token i pasted above
What the report shows
Snapchat publishes KeyDB as open source, and the researcher found that the public development repository on GitHub was exposing internal sensitive data through its commit history. The report argues that material of this kind should not be revealed in an open source project.
The researcher pointed to a specific commit as the example:
https://github.com/Snapchat/KeyDB/commit/[redacted]
Inside that commit, the text quoted a reference to an internal file, a Dockerfile held on an internal GitHub Enterprise host:
[Dockerfile](https://github.sc-corp.net/Snapchat/keydb-internal/github-action-runner-docker/Dockerfile).
The report then describes the third step of the exposure: taking the token from that script, which sits in a "Configure" section:
./config.sh --url https://github.com/EQ-Alpha/KeyDB --token ████
The token value itself is redacted in the published report, shown only as a block. The researcher states that the disclosed material is internal developer sensitive information, giving a personal access token (PAT) as the example.
The report was filed on HackerOne against the Snapchat program, rated low severity under the Cleartext Storage of Sensitive Information weakness, and paid a bounty of 250.00 USD. It was disclosed on 2023-06-14. The report does not describe a fix or a remediation timeline.
Root cause
The public commit history contains a reference to an internal file and a token. Removing a file or editing a line in a later commit does not remove it from history: anyone who clones the repository can walk back through the commits and read the earlier content. The leaked material also pointed at an internal host and an internal repository path.
Impact
The report's own framing is that internal developer sensitive information was disclosed publicly, with a PAT as the concrete example. What an attacker could do with such a token depends entirely on its scope, and the report does not establish that scope. A leaked token of this kind is only as dangerous as the permissions attached to it: read access to repositories, the ability to push code, or access to CI configuration would each change the picture considerably. The commit also references an internal host, which discloses internal infrastructure detail.
How this kind of bug works
Secrets end up in version control for ordinary reasons: a developer hardcodes a token while testing, a CI configuration file references a credential, a script is committed with a placeholder that is later replaced by the real value. Git keeps every version of every file, so the secret survives in the object database even after it is deleted from the working tree. When a private repository is made public, or when a project is forked or mirrored, the full history travels with it.
Automated scanners look for high-entropy strings and known token formats in commits, but they only help if they run across history and not just the current branch tip. The durable defences are to keep secrets out of the repository in the first place (environment variables injected at build time, secret managers, short-lived credentials), to scan history before a repository is opened up, and to rotate any credential that has ever been committed, because rewriting history is unreliable once the repository has been cloned or forked.
How to test for it
- Identify repositories that have recently changed visibility, been forked widely, or belong to an organisation with internal tooling. Public mirrors of internal projects are the highest-value targets.
- Clone the repository and search the full history rather than the checked-out files. Tools such as trufflehog, gitleaks or git-secrets can walk every commit; a manual pass with git log -p and grep for token-like patterns works on small repositories.
- Look for references to internal hostnames, internal repository paths and CI configuration files, since these often sit next to credentials.
- For each candidate secret, determine the type and scope without using it against production systems. Check whether the token is still valid, for example by calling the provider's token introspection endpoint, and record the permissions it carries.
- A positive result is a live credential with meaningful scope, or internal infrastructure detail that is clearly not meant to be public. A revoked token, a placeholder, or a test key with no privileges is a false positive and should not be reported as a vulnerability.
Common false positives: example tokens in documentation, tokens that were rotated immediately after the commit, and public identifiers that look random but carry no authority.
How it is fixed
The standard response is to revoke and rotate the exposed credential first, since history rewriting does not help once the repository is public. Then remove the secret from history if the repository can be rewritten safely, add secret scanning to CI so future commits are blocked, and move credentials into a secret manager or inject them as environment variables at build time. Internal hostnames and paths in public commits should be reviewed as well, because they disclose architecture even without a credential.
Hunting notes
This bug class hides in commit history, in CI configuration files, in Dockerfiles and shell scripts, and in documentation that was written for internal use. Recon signals worth watching: organisations that publish internal tools, repositories with a recent visibility change, forks that diverge from the upstream, and commits that reference internal domains. To get a report accepted, show that the credential is live and describe its scope, and tie the exposure to a concrete consequence rather than the mere presence of a string. Programs are far more likely to reward a token that grants access to something than one that has already been revoked.
What happened, in plain words
Snapchat publishes a database project called KeyDB as open source. Open source means the code is public: anyone can download it, read it and copy it. The researcher looked at the public development repository on GitHub and found that its history was exposing internal sensitive data. The report argues that this kind of material should not be revealed in an open source project.
A repository is the storage place where a project's files and every past change to them live. GitHub is a website that hosts such repositories. The history is the record of every change ever made, and it stays available even when a file is later edited or deleted.
The researcher pointed to one specific commit as the example. A commit is a saved snapshot of changes, a bit like a saved version of a document that keeps all earlier versions too.
https://github.com/Snapchat/KeyDB/commit/[redacted]
Inside that commit, the text quoted a reference to an internal file. The file is a Dockerfile, which is a recipe for building a software package called a container, and it was held on an internal GitHub Enterprise host, meaning a GitHub server that only the company can reach.
[Dockerfile](https://github.sc-corp.net/Snapchat/keydb-internal/github-action-runner-docker/Dockerfile).
The report then describes the third step of the exposure: taking the token from that script, which sits in a "Configure" section.
./config.sh --url https://github.com/EQ-Alpha/KeyDB --token ████
A token is a long string of characters that acts like a password for software. Instead of typing a username and password, a program presents the token and the service lets it in. The line above is a command that runs a script called config.sh, points it at a GitHub repository address with --url, and hands it a token with --token. The token value itself is redacted in the published report, shown only as a block, so the actual secret is not visible here.
The researcher states that the disclosed material is internal developer sensitive information, giving a personal access token (PAT) as the example. A PAT is a token tied to a person's account that grants a defined set of permissions, for instance reading private repositories or pushing code changes.
The report was filed on HackerOne, a platform where security researchers report bugs to companies, against the Snapchat program. It was rated low severity under the Cleartext Storage of Sensitive Information weakness, which describes secrets kept in a form anyone can read, and paid a bounty of 250.00 USD. It was disclosed on 2023-06-14. The report does not describe a fix or a remediation timeline.
In general, how this kind of bug works
Secrets end up in version control for ordinary reasons: a developer hardcodes a token while testing, a CI configuration file references a credential, a script is committed with a placeholder that is later replaced by the real value. CI, short for continuous integration, is the automated system that builds and tests code whenever someone changes it, and its configuration files often need credentials to do that work.
Git, the version control system behind GitHub, keeps every version of every file. A secret therefore survives in the stored history even after it is deleted from the current files. When a private repository is made public, or when a project is forked or mirrored, the full history travels with it. A fork is a personal copy of someone else's repository, and a mirror is a duplicate kept elsewhere.
The public commit history contains a reference to an internal file and a token. Removing a file or editing a line in a later commit does not remove it from history: anyone who downloads the repository can walk back through the commits and read the earlier content. The leaked material also pointed at an internal host and an internal repository path.
Automated scanners look for high-entropy strings, meaning strings that look random rather than like normal words, and for known token formats in commits. They only help if they run across history and not just the latest state of the main branch. The durable defences are to keep secrets out of the repository in the first place, using environment variables injected at build time, secret managers or short-lived credentials; to scan history before a repository is opened up; and to rotate any credential that has ever been committed, because rewriting history is unreliable once the repository has been cloned or forked. Rotating means replacing the secret with a new one and cancelling the old one.
Impact
The report's own framing is that internal developer sensitive information was disclosed publicly, with a PAT as the concrete example. What an attacker could do with such a token depends entirely on its scope, and the report does not establish that scope. A leaked token is only as dangerous as the permissions attached to it: read access to repositories, the ability to push code, or access to CI configuration would each change the picture considerably. The commit also references an internal host, which discloses internal infrastructure detail.
How to test for it
- Identify repositories that have recently changed visibility, been forked widely, or belong to an organisation with internal tooling. Public mirrors of internal projects are the highest-value targets.
- Clone the repository, meaning download a full copy, and search the full history rather than the checked-out files. Tools such as trufflehog, gitleaks or git-secrets can walk every commit; a manual pass with
git log -pand grep for token-like patterns works on small repositories. - Look for references to internal hostnames, internal repository paths and CI configuration files, since these often sit next to credentials.
- For each candidate secret, determine the type and scope without using it against production systems. Check whether the token is still valid, for example by calling the provider's token introspection endpoint, and record the permissions it carries.
- A positive result is a live credential with meaningful scope, or internal infrastructure detail that is clearly not meant to be public. A revoked token, a placeholder, or a test key with no privileges is a false positive and should not be reported as a vulnerability.
Common false positives: example tokens in documentation, tokens that were rotated immediately after the commit, and public identifiers that look random but carry no authority.
How it is fixed
The standard response is to revoke and rotate the exposed credential first, since history rewriting does not help once the repository is public. Then remove the secret from history if the repository can be rewritten safely, add secret scanning to CI so future commits are blocked, and move credentials into a secret manager or inject them as environment variables at build time. Internal hostnames and paths in public commits should be reviewed as well, because they disclose architecture even without a credential.
Hunting notes
This bug class hides in commit history, in CI configuration files, in Dockerfiles and shell scripts, and in documentation that was written for internal use. Recon signals worth watching: organisations that publish internal tools, repositories with a recent visibility change, forks that diverge from the upstream, and commits that reference internal domains. To get a report accepted, show that the credential is live and describe its scope, and tie the exposure to a concrete consequence rather than the mere presence of a string. Programs are far more likely to reward a token that grants access to something than one that has already been revoked.
Glossary
- Open source: software whose code is published so anyone can read, use and modify it.
- Repository: the storage place holding a project's files and the full record of their changes.
- GitHub: a website that hosts repositories and their history.
- Commit: a saved snapshot of changes in a repository, kept alongside all earlier snapshots.
- Commit history: the complete chain of commits, which lets anyone read earlier versions of files.
- Dockerfile: a text recipe for building a container, a packaged runnable piece of software.
- GitHub Enterprise: a self-hosted GitHub server that only an organisation can reach.
- Token: a string that acts like a password for software, presented instead of a username and password.
- Personal access token (PAT): a token tied to an account that grants a defined set of permissions.
- Redacted: hidden or replaced with a block so the real value is not shown.
- HackerOne: a platform where researchers report security bugs to companies.
- Bounty: a payment a company makes for a valid security report.
- Severity: a rating of how serious a bug is, here low.
- Cleartext storage of sensitive information: keeping secrets in a form anyone can read.
- Version control: a system such as Git that records every change to files over time.
- CI (continuous integration): automated building and testing of code whenever it changes.
- Fork: a personal copy of someone else's repository.
- Mirror: a duplicate of a repository kept in another place.
- High-entropy string: a string that looks random rather than like normal words, typical of secrets.
- Rotate: replace a secret with a new one and cancel the old one.
- Revoke: cancel a credential so it no longer works.
- Secret manager: a service that stores credentials securely and hands them out only when needed.
- Environment variable: a value supplied to a program from outside its code, often used to pass secrets at build time.
- False positive: a finding that looks like a bug but is not one.
- Recon: the information-gathering phase before testing, looking for promising targets.