Skip to content

Bug class · Beginner

Leaked secrets and credentials

Keys, tokens or passwords left in public code, apps, logs or responses, that grant real access.

median public bounty
$1,250

Covers CWE 798, 312, 522, 256, 259, 321.

How it works

Full lesson

The pattern behind every report in this class.

Leaked secrets and credentials are sensitive values such as API keys, passwords, tokens or private keys that have been exposed through public repositories, client-side code, logs, configuration files or packaged applications. Programs care because these secrets can give attackers direct access to internal systems, customer data or infrastructure, often without needing to exploit a software flaw. The reports in this dataset show that such leaks are common and frequently lead to account takeover, data exposure or further compromise.

This class of issue usually arises from mistakes like hardcoding credentials in source code, committing secret files to public repositories, or failing to redact secrets from logs and build output. It is most often found in public GitHub repositories, JavaScript bundles served to browsers, mobile and desktop application packages, CI/CD logs, and publicly accessible configuration files on staging or production hosts. The evidence also includes leaks in smart contracts, chat channels, and web archives.

For a bug bounty hunter, leaked secrets are a high-value target because they can provide immediate access to systems and data, and demonstrating impact is often straightforward: show that the secret is live and what it can access. However, hunters must be careful to stay in scope and to avoid causing harm when validating credentials. The reports here include many examples where a leaked token or key was used to access repositories, cloud resources, admin panels or user data.

The process starts with reconnaissance: searching public sources for secrets. This includes scanning public repositories on platforms like GitHub for patterns that look like credentials, such as API keys, tokens, passwords or private keys. Hunters also examine client-side JavaScript files, mobile app packages, desktop applications, and publicly accessible configuration files. The evidence shows many cases where secrets were found in dotfiles, environment files, package registries, and even training PDFs.

Things to try

All 178

Each line worked in a disclosed report. Test only what a program's scope allows.

Public repository secret hunting 28

  • Search public repositories for a leaked token in a public repository and test its scope, access, permissions or validity.
  • Search public repositories and old commits for API keys, then check validity against the vendor's key-check endpoint.
  • Search public repositories for a hardcoded username and password committed in a commit.
  • Search public repositories for a leaked API key tied to a named account and test its scope.

Smart contract hardcoded constants 25

  • Check that addresses and constants baked into contract code match the values actually used on each deployment.
  • Check whether a hard-coded currency peg can be broken by market conditions.
  • Check whether hard-coded pool fees cause incorrect cumulative tick calculations.
  • Check whether a single hard-coded cap applied to multiple tokens causes some assets to become stale.

Client-side JavaScript and web bundles 12

  • Read page source and bundled scripts for hardcoded usernames and password hashes, then try to crack weak unsalted hashes.
  • Inspect a GitHub integration module for hard-coded credentials in its source.
  • Scan public JavaScript bundles with a secret scanner for payment and media service API keys.
  • Read a JavaScript file for hard-coded credentials and infrastructure addresses, then use them against Docker Hub and code-quality services.

Mobile app binaries 10

  • Decompile an Android app and search for hardcoded HTTP basic credentials, then try them on the domain they belong to and on sibling subdomains.
  • Decompile an Android app and search the code for API keys and tokens that can be replayed against the backend.
  • Extract a Cloudinary key and secret from an Android app and test whether they allow listing, replacing or deleting uploaded files.
  • Extract a cloud storage credential from an Android app and test read and write access to the bucket used for uploads.

Token leakage through redirects and referrers 9

  • Check the permissions of cookie, HSTS and Alt-Svc cache files created by a command-line client under a permissive umask.
  • Redirect a Basic-auth request to a different host and check whether netrc credentials are sent to the new target.
  • Check whether TLS connection reuse and session cache honour the fsslctx callback and ssl_config_data flags.
  • Check the verify email endpoint for an authorisation token leak.

Bypasses and variations

  • Restrictions placed on a Google Maps API key can be bypassed.
  • A patch for hardcoded credentials can be bypassed with a variant attack.
  • An incomplete fix for TLS session handling can be bypassed with a variant.

Tips for beginners

All 15
  • Start by searching public repositories for common secret patterns. Use GitHub's code search or dedicated tools to look for strings like 'api_key', 'password', 'token', or file names like '.env', 'config.json', or 'id_rsa'. Focus on repositories belonging to the target organisation or its employees. The evidence shows many leaks in dotfiles, environment files, and configuration files.
  • Check client-side JavaScript bundles for hardcoded secrets. Modern web apps often include API keys for third-party services in their JavaScript. Look for strings that resemble keys, and test whether they are live and what they allow. Be aware that some keys are meant to be public (like some map tokens) but may still have insufficient restrictions.
  • Inspect mobile and desktop applications. Decompile Android APKs or unpack Electron apps to search for embedded credentials. The evidence includes many cases where API keys, tokens, and even private keys were found in app packages. Pay attention to third-party service credentials, which can sometimes be used to access data or send messages.
  • Look through CI/CD logs and build output for secrets. Build scripts sometimes print environment variables or command output that includes tokens. Search public build logs for strings like 'token', 'password', or 'secret'. If you find a token, test its validity carefully.
  • When you find a secret, validate it responsibly. Use the least intrusive method to confirm it is live, such as a read-only API call or a request to a key-check endpoint. Avoid actions that could modify or delete data, send messages, or disrupt services. Document exactly what you did and what access you gained.
  • Assess the full impact of the secret. Determine what permissions it has and what data it can access. For example, a cloud access key might allow listing buckets or reading objects; a GitHub token might allow accessing private repositories or modifying code. The more sensitive the access, the higher the severity.

Start here: a reading path

Open the path

Clear reports in order, easiest first.

Guides and techniques

View all

The best explainers, cheat sheets and technique posts on Leaked secrets, from around the web.

Newest reports

All 490

Most recently disclosed.

New Leaked secrets reports by email

Follow Leaked secrets and get each week's new disclosures in one short email.

Free. New reports for what you follow, weekly by default. One-click unsubscribe. Privacy