Over 543,000 Active GitHub Credentials Exposed Publicly

More than 543,000 distinct credentials stored in public GitHub repositories were still valid when tested on July 27–28, 2026, according to a major analysis of exposed secrets. These credentials were found in a massive code snapshot, underscoring longstanding lapses in secret management despite recent safeguards.

Scope of the Exposure

Researchers examined The Stack v3, a public-code archive containing over 224 million repositories and nearly 58.5 billion files. Cache metadata spanned 4,096 shards, and the data collection concluded on August 7, 2025. The analysis deduplicated credentials by value and identified 1,103,438 instances across files and forks associated with 543,699 unique credentials.

Age and Persistence of Leaks

The median leaked credential had sat in a publicly accessible default branch for 784 days. Ten percent were exposed for at least 6.3 years. The single oldest credential dated back to June 2009—an Erlang server database credential that remained valid more than 16 years later. Because the dataset preserves only default-branch snapshots, many leaks—those removed, hidden, or in older forks—went undetected, meaning the true total is almost certainly higher.

New Protections, But Gaps Remain

GitHub rolled out free secret-scanning alerts for public repositories in February 2023. A year later, default push protection began for free users—blocking commits containing known credential types before they’re made public. Nonetheless, 199,843 valid credentials were tied to dates after push protection began. Another 245,959 predated alert availability, while 97,897 appeared in the interim period.

What Types of Credentials Slip Through?

Push protection covers many common credential formats, but about 51.8% of live secrets used types that aren’t blocked by default. These include private keys, database connection strings, and API keys. Among the most common: over 69,000 Google Cloud service-account credentials; more than 51,000 MongoDB connection strings; and over 33,000 Google API keys. There were also tens of thousands of other Google-prefixed keys, many sharing formats with Atlas of large AI workloads, muddying automated blocks.

Revocation Is Key

Not all exposed credentials are treated equally. For example, only 1 of over 100,000 committed npm tokens was still valid. By contrast, virtually all database connection strings discovered for PostgreSQL or MySQL, as well as most Google Cloud service-account credentials, remained active. The difference? Automated revocation tools, which help more for some credential types than others.

Recommendations for Organizations

Once a credential is committed publicly, it should be considered compromised. Organizations should immediately revoke or rotate exposed credentials, then clean up repositories—rather than deleting first, which leaves past leaks accessible. Complete history scanning is essential, along with custom pattern detection. Best practices also include using short-lived credentials, integrating alerts with automatic revocation, and restricting ways to bypass protections.

Why this matters: credentials that date back years and yet still function pose massive risk—unauthorized access, data leaks, breaches. Despite GitHub’s improved tools, the persistent presence of valid exposed credentials reveals how lagging secret hygiene leaves developers and organizations vulnerable.