543,699 GitHub Credentials Still Valid: Find and Rotate Your Exposed Secrets Now
Reach 50,000+ security professionals
Sponsor a newsletter slot and put your brand in front of CISOs, engineers, and IT decision-makers.
543,699 valid API keys, tokens, and cloud credentials are sitting in public GitHub repositories right now, and automated scanners harvest them faster than security teams can rotate them. Truffle Security validated 543,699 unique credentials against their issuing services on July 27 and 28, 2026, confirming each one still authenticated successfully. The median credential had been publicly accessible for 784 days before anyone revoked it.
The credential types include AWS IAM access keys that can control entire cloud environments, Google Cloud Platform service accounts with broad permissions, MongoDB connection strings providing direct database access, Google API keys billable on the victim's account, and GitHub personal access tokens that can access private repositories and modify CI/CD pipelines. The oldest validated credential had been live and functional for more than 16 years.
GitHub secrets sprawl accelerated in 2025. GitGuardian's State of Secrets Sprawl 2026 report found 29 million new hardcoded secrets hit public GitHub commits in 2025, a 34% year-over-year increase. AI-assisted coding tools generate secrets-touching code faster than most teams audit it. AI service credentials, including OpenAI keys, Gemini keys, and Anthropic API keys, leaked at 81% higher rates than the year before.
Organizations with any public GitHub presence, open-source contributions, or developer workflows that touch public repositories face direct exposure. Attackers and initial access brokers run continuous automated sweeps of GitHub and public training datasets using tools like TruffleHog, Gitleaks, and GitRob. A credential found this morning can be validated and weaponized within minutes.
How GitHub Secrets Become Public Attack Surface
Developers commit secrets to GitHub through a predictable set of mistakes: hardcoding credentials directly in application code, leaving API keys in configuration files checked into version control, storing database connection strings in test fixtures, and embedding cloud service account keys in CI/CD workflow files. Each mistake exposes the credential to anyone who accesses the repository, and in public repos that means the entire internet.
The problem compounds because git preserves history. Deleting a file from the current branch does not remove it from prior commits. An AWS access key committed three years ago and deleted in the next commit still exists in every clone of the repository and in every service that archived the repository state at that time. GitHub's default secret scanning operates on current-branch content; history scanning requires separate tooling.
Public training datasets amplify the exposure beyond GitHub itself. The Stack v3, a 7.6-petabyte dataset of public GitHub code used to train large language models, was scanned by Truffle Security in July 2026. Researchers identified and validated 543,699 credentials that remained live against production systems. These datasets are downloaded by researchers, developers, and organizations worldwide, meaning exposed credentials propagate to machines and environments far outside the original repository's reach.
AI coding tools introduce a newer leak vector. When developers ask coding assistants to generate configuration templates, environment setup scripts, or connection examples, the AI frequently produces code with real-credential formatting. Developers sometimes fill in actual credentials without adjusting git ignore rules or pre-commit scanning, then commit the result.
What the Research Reveals About the Scale of Exposure
Truffle Security scanned 224 million repositories and 58 billion files in The Stack v3 dataset, then validated every candidate credential against its issuing service. The validation confirmed 543,699 unique credentials still authenticated on July 27 and 28, 2026.
The scale of the remediation failure is the most alarming finding. The median credential had been publicly accessible for 784 days -- more than two years -- before any action was taken. Ten percent of the live credentials had been exposed for at least 6.3 years. The oldest active credential had been functional for more than 16 years.
A GitGuardian revalidation study reinforces the pattern. 64% of credentials confirmed valid in 2022 were still valid when retested in January 2026, four years after their initial exposure. Revocation rates remain low because most organizations lack visibility into what leaked, when it leaked, and which services the credentials can access. Without active scanning, secrets discovered today stay live for years.
Hugging Face training datasets compound the exposure further. A separate Truffle Security scan of public Hugging Face datasets found 221,303 live unique credentials across 6,003 datasets, including 349 live GitHub tokens. Researchers and AI engineers who download these datasets for model training inadvertently receive valid credentials alongside the training data, creating secondary exposure vectors outside GitHub's security perimeter entirely.
Briefings like this, every morning before 9am.
Threat intel, active CVEs, and campaign alerts, distilled for practitioners. 50,000+ subscribers. No noise.
Which Credential Types Face the Highest Risk
AWS IAM access keys represent the highest-value target. A long-term access key with AdministratorAccess or PowerUserAccess policy grants control over entire cloud infrastructure -- S3 buckets, EC2 instances, Lambda functions, RDS databases, and IAM itself. Attackers use compromised AWS keys to exfiltrate data, create persistent backdoor IAM users, run cryptominers across every available region, and pivot to connected SaaS environments. AWS keys appear frequently in public repos because developers test them locally and forget them in environment variable files.
Google Cloud Platform service accounts are the second-highest value target. GCP JSON key files are frequently committed to infrastructure-as-code repositories and Terraform modules. A service account key with project Editor or Storage Admin permissions grants full data access and resource control. GCP service account keys do not expire by default, and they remain valid until explicitly deleted from the service account, meaning an exposed key from three years ago can still work today.
MongoDB connection strings provide direct, authenticated database access. A connection string in the format mongodb+srv://user:password@cluster.mongodb.net/dbname gives an attacker immediate read and write access to all collections in the target database without any additional exploitation steps. AI service credentials -- OpenAI, Gemini, Anthropic -- are consumed for inference at the victim's billing cost, with some cases reaching five-figure charges within hours of credential discovery.
Private RSA and EC keys are the longest-lived exposure category. An SSH private key committed to a repository grants access to every server configured to trust the corresponding public key. Unlike API tokens with auditable usage logs, SSH connections blend with legitimate traffic and are difficult to detect retroactively.
“Organizations that treat secret scanning as a one-time audit are missing the point. The threat model is continuous -- new secrets are committed every day, and automated scanners harvest them within minutes of each push.”
Truffle Security, Secrets Sprawl Research 2026
Why GitHub Push Protection Has Not Closed This Gap
GitHub push protection was designed to intercept high-confidence, low-false-positive secret types at the moment of commit -- specifically tokens with fixed prefixes and strong checksum properties, like GitHub personal access tokens and AWS access keys in the format AKIA[A-Z0-9]{16}. The feature works as intended for the categories it covers. The 543K finding reveals where the coverage ends.
36.8% of the confirmed-live credentials were exposed after push protection began rolling out as a default, meaning they were committed by developers who bypassed the protection, fell into categories push protection does not block, or existed in private repositories later made public. 51.8% of live credentials fall into categories push protection does not block by default: generic database connection strings, private RSA keys, and many Google API keys without recognizable prefixes.
Historical commits receive no retroactive protection. A key committed two years ago and never deleted from history is invisible to push protection. Organizations that enabled the feature recently have no coverage for credential exposure that predates activation.
Private-to-public transitions bypass all pre-commit checks. A developer who stores credentials in a private repository and later changes the visibility to public exposes every historical commit instantly. GitHub's secret scanning can detect and alert on this transition, but only if the alert is reviewed and acted on promptly -- and the 784-day median exposure time suggests most are not.
Subscribe to unlock Indicators of Compromise
Free subscribers unlock full IOC lists, Sigma detection rules, remediation steps, and every daily briefing.
Sigma Detection Rules for GitHub Secrets Sprawl
These rules detect credential scanning tool execution and cloud metadata service probing -- the two behaviors most directly linked to attackers validating stolen GitHub credentials. Both carry experimental status; validate against your environment's log format before enabling automatic blocking.
Subscribe to unlock Sigma Detection Rules
Free subscribers unlock full IOC lists, Sigma detection rules, remediation steps, and every daily briefing.
Subscribe to unlock Sigma Hunt Queries
Free subscribers unlock full IOC lists, Sigma detection rules, remediation steps, and every daily briefing.
How to Find and Rotate Your Exposed Secrets Right Now
Every organization with public GitHub repositories or developers who have contributed to public projects should treat this as an active incident requiring immediate action. Automated credential scanners have already processed The Stack v3 and its derivatives. If your credentials appear in this dataset and are not revoked, assume they are known to threat actors.
The sckit supply chain worm campaign published September 25 demonstrated that developer credential theft is an active criminal priority, with attackers compromising npm and PyPI packages to steal credentials at build time. Public GitHub repositories extend that attack surface to any code ever committed by any developer, making proactive scanning non-negotiable.
Subscribe to unlock Remediation & Mitigation steps
Free subscribers unlock full IOC lists, Sigma detection rules, remediation steps, and every daily briefing.
Why GitHub Secrets Sprawl Matters for Your Security Posture
The secrets sprawl problem represents a durable, low-noise attack surface that requires no zero-day exploit and no social engineering. An attacker needs only to download a public training dataset and run a validator against the credentials found. At 543,699 confirmed-live credentials and 29 million new secrets hitting GitHub annually, the probability that an organization with any public GitHub presence has at least one exposed credential is not theoretical.
MITRE ATT&CK maps this threat to T1552.001 (Credentials in Files) and T1078 (Valid Accounts). The attacker obtains valid credentials through passive collection from public sources, then uses those credentials to access cloud systems directly. There is no initial intrusion phase, no vulnerability to patch, and no alert from a perimeter control. The first sign of compromise is often billing anomalies in AWS or GCP, unexpected API calls in application logs, or a threat intelligence feed flagging your organization's cloud account ID in attacker infrastructure.
The 784-day median exposure time reveals an organizational pattern: most teams discover exposed credentials only when something goes wrong. Proactive rotation cadences and continuous scanning replace reactive discovery. Organizations that scan for exposed cloud credentials and enforce short key lifetimes reduce the window between exposure and detection to days, not years.
The 81% year-over-year increase in AI service credential leaks signals that the problem is accelerating alongside AI adoption. Every new AI API key, every new model provider integration, and every AI coding tool session is a potential credential leak vector. Secrets hygiene is now an AI security requirement, not just a developer operations best practice.
The bottom line
GitHub secrets sprawl is an active attack surface affecting every organization with a public code presence: 543,699 credentials confirmed live in public repos, exposed a median of 784 days, with 36.8% leaked after push protection was enabled. Run TruffleHog against your entire GitHub organization today, prioritize AWS and GCP keys in the verified results, and rotate every confirmed credential before end of business. Continuous scanning and a 90-day key rotation cadence prevent point-in-time audits from going stale within weeks.
This analysis is generic. create a free account to score threats like this against your own stack.
Frequently asked questions
What is secrets sprawl?
Secrets sprawl is the uncontrolled proliferation of API keys, tokens, passwords, and cryptographic credentials accidentally committed to version control systems, configuration files, or documentation. The term covers credentials embedded in source code, CI/CD pipeline files, container images, and training datasets that become accessible beyond their intended audience. Once committed to a git repository, a credential persists in the commit history indefinitely -- even if the file is later deleted -- and propagates to every clone, fork, and archive of the repository.
How do credentials end up in public GitHub repositories?
Developers commit credentials through a predictable set of mistakes: hardcoding API keys directly in application source code, committing .env files with real credentials instead of .env.example templates, embedding service account keys in Terraform or Ansible configuration, and including cloud credentials in Docker build scripts. AI coding tools introduce a newer vector by generating configuration templates with real-credential formatting that developers fill in without updating their git ignore rules. Git history retains every credential even after the file is deleted from the current branch.
How do I know if my organization's secrets are exposed?
Run TruffleHog with the --only-verified flag: trufflehog github --org=YOUR_ORG_NAME --only-verified. This validates each candidate credential against its issuing service and returns only credentials that currently authenticate, eliminating stale keys already rotated. Enable GitHub secret scanning in Organization Settings and review the alerts queue. For historical exposure that predates your monitoring, Truffle Security's enterprise offering and GitGuardian's platform scan historical git commits and cross-reference against known public leaks.
Does GitHub push protection prevent all secret leaks?
No. GitHub push protection intercepts a specific set of high-confidence, low-false-positive token types at commit time. 36.8% of the 543,699 confirmed-live credentials in the Truffle Security study were exposed after push protection was enabled because they fell into uncovered categories, were committed to private repositories later made public, or existed in historical commits before push protection was activated. Generic database connection strings, RSA private keys, and many AI service credentials require separate tooling beyond push protection defaults.
How quickly do attackers find and use exposed GitHub credentials?
Automated scanning tools harvest newly committed secrets within minutes of a push. GitGuardian's research shows most secrets found in public repositories are detected and validated by external parties within four hours of initial commit. Attackers run continuous scrapers against GitHub's public event stream and major training datasets. For secrets exposed for days or longer, assume the credential is already known to multiple parties and treat rotation as urgent remediation, not precautionary hygiene.
What should I rotate first after discovering exposed credentials?
Prioritize by blast radius. Rotate first: AWS IAM access keys with broad policies, because they provide control over entire cloud environments. Second: GCP service account keys with Editor or Admin roles. Third: GitHub personal access tokens with write access to repositories, because an attacker can use them to inject malicious code into your CI/CD pipeline. Fourth: database connection strings with write permissions. Fifth: any credential for an identity provider, SSO system, or secrets manager, since these provide leverage over all downstream credentials.
What is TruffleHog and how do I run it?
TruffleHog is an open-source credential scanning tool from Truffle Security that searches git repositories, S3 buckets, file systems, and other sources for credentials and validates them against issuing services. Install it with: brew install trufflehog or pip install trufflehog3. For a full organization scan with verification: trufflehog github --org=YOUR_ORG_NAME --include-forks=false --only-verified. The --only-verified flag filters to credentials that still authenticate, eliminating stale keys that have already been rotated.
How do I remove a secret from git history?
Deleting the file from the current branch does not remove the credential from git history -- every prior commit that included the file still contains the secret. Rotate the credential first to eliminate immediate risk, then purge the history using git filter-repo: git filter-repo --path .env --invert-paths removes all commits containing the .env file. Force-push the cleaned history to origin and require all collaborators to re-clone, because their local copies still contain the old history with the exposed credential.
Sources & references
- Truffle Security: 543,699 Live Secrets Found in The Stack v3 GitHub Dataset
- GitGuardian: State of Secrets Sprawl 2026
- GitHub Secret Scanning Coverage Updates -- August 2026
- The Hacker News: State of Secrets Sprawl 2026 -- 9 Takeaways for CISOs
- SecurityBoulevard: State of Secrets Sprawl 2026 -- AI-Service Leaks Surge 81%
Free resources
Critical CVE Reference Card 2025–2026
25 actively exploited vulnerabilities with CVSS scores, exploit status, and patch availability. Print it, pin it, share it with your SOC team.
Ransomware Incident Response Playbook
Step-by-step 24-hour IR checklist covering detection, containment, eradication, and recovery. Built for SOC teams, IR leads, and CISOs.
Daily briefings + Google Top Stories in one step.
Enter your email and we'll subscribe you to the daily briefing and add Decryption Digest to your Google Search feed at the same time.

Founder & Cybersecurity Evangelist, Decryption Digest
Cybersecurity professional with expertise in threat intelligence, vulnerability research, and enterprise security. Covers zero-days, ransomware, and nation-state operations for 50,000+ security professionals every morning.
