GitHub Leaked Secrets
Find and triage potential secrets in an authorized GitHub scope without attempting to use them.
On this page · 5 sections
Where secrets appear
- Environment and example configuration files.
- CI/CD workflows, build logs, and deployment scripts.
- Infrastructure-as-code variables and state references.
- Documentation, issue bodies, sample requests, and notebooks.
- Removed files in commit history and long-lived forks.
- Generated bundles, source maps, and mobile configuration.
GitHub search syntax
Combine one scope qualifier with content or path terms. Add language, path, fork, or archive constraints to reduce noise. Exact repository qualifiers require the full owner/name.
org:example-corp ("BEGIN PRIVATE KEY" OR "client_secret")
org:example-corp path:.github/workflows ("secrets." OR "permissions:")
repo:example-corp/sample (path:.env OR path:config)
org:example-corp "AKIA" NOT path:test NOT path:fixtures- Prefer provider or configuration vocabulary over generic words such as password.
- Exclude tests, fixtures, vendored, and generated content when appropriate.
- Review archived repositories and relevant forks separately.
- Record the exact query and discovery timestamp.
Authorized query builder
Compose an encoded GitHub Code Search URL locally. Authorization confirmation is required before the external search button is enabled.
Enter a valid authorized scope to build a query.The query is assembled locally. This site does not receive search results, credentials, or repository data.
Triage without using the secret
- 01
Identify provider and secret type from documented format.
- 02
Confirm the repository and value belong to the authorized organization.
- 03
Notify the provider or internal owner through the agreed channel.
- 04
Have the owner revoke or rotate the secret.
- 05
Review provider logs for use from creation until revocation.
- 06
Remove current and historical exposure where appropriate.
| State | Meaning | Action |
|---|---|---|
| Unknown | Pattern match only | Escalate privately; do not test |
| Revoked | Owner confirms invalid | Remove history and prevent recurrence |
| Active | Owner confirms validity | Revoke immediately and investigate use |
| False positive | Documented non-secret fixture | Tune scanning with context |
Rotation, cleanup & prevention
- Revoke before rewriting Git history.
- Rotate downstream credentials derived from the exposed secret.
- Invalidate sessions and review audit logs.
- Enable GitHub secret scanning and push protection.
- Add custom patterns for organization-specific tokens.
- Move secrets to a managed store and prefer short-lived identity federation.