A massive security audit of GitLab Cloud has revealed a critical and widespread developer security failure. Security engineer Luke Marshall scanned all 5.6 million public repositories on the platform, discovering 17,430 verified live secrets. These hardcoded credentials include API keys, passwords, and access tokens for over 2,800 organizations. The scan, which cost only $770 to run on AWS, used the open-source tool TruffleHog to ensure high accuracy. The findings show a 35% higher density of secrets compared to a similar scan on Bitbucket, with Google Cloud Platform (GCP) credentials being the most commonly leaked type. The discovery of long-lived 'zombie secrets' and credentials for GitLab itself within its own platform underscores the systemic nature of this supply chain risk.
The threat is simple yet severe: developers are committing sensitive credentials directly into public source code repositories. This practice provides attackers with a direct path to compromise cloud infrastructure, databases, and third-party services. Luke Marshall's research quantifies the scale of this problem on GitLab Cloud. By building an automated pipeline with AWS Lambda and SQS, he was able to scan every public repository in just over 24 hours.
The scan specifically looked for verified secrets, meaning the tool confirmed their validity, eliminating false positives. The top leaked secret types were:
The leakage of GitLab's own tokens demonstrates 'platform locality,' where developers accidentally expose keys for the very service they are using. Some secrets were ancient, with one valid credential dating back to 2009, highlighting the persistent danger of 'zombie secrets' in imported repository histories.
This issue is a failure of secure coding and development practices, directly enabling several MITRE ATT&CK techniques for attackers who find these secrets.
T1552.005 - Cloud Instance Metadata API: Leaked cloud credentials (like the 5,200 GCP keys) allow attackers to directly access cloud resources and APIs, bypassing traditional network defenses.T1528 - Steal Application Access Token: This is the essence of the problem. Attackers are not stealing the tokens via active attack, but rather harvesting them from public sources.T1078 - Valid Accounts: The leaked secrets are valid credentials for various cloud services, databases, and APIs, giving attackers legitimate access.T1610 - Deploy Container: With leaked cloud credentials, an attacker could deploy malicious containers for cryptomining or to establish a further foothold in the victim's environment.This is a form of passive, reconnaissance-based initial access. Attackers can automate the scanning of public repositories to build a treasure trove of credentials, which they can then use to launch targeted attacks.
The impact of a leaked secret can range from minor to catastrophic. A leaked API key for a development environment might have limited impact, but a production GCP service account key could lead to a full infrastructure takeover, massive data breach, and significant financial loss. The 17,430 verified secrets represent thousands of potential breaches waiting to happen.
For the 2,800+ affected organizations, the immediate impact is the cost of revoking and reissuing all exposed credentials, auditing systems for signs of compromise, and the potential for regulatory fines if a breach occurred. The long-term impact is the ongoing risk from secrets that were not successfully revoked or that may have been copied by malicious actors before they were discovered.
Detection of this threat is proactive (preventing secrets from being committed) and reactive (finding secrets that have been exposed).
| Type | Value | Description |
|---|---|---|
| other | Git pre-commit hooks | Use local developer tools to scan for secret patterns before code is committed. |
| other | CI/CD pipeline scanner | Integrate tools like TruffleHog or GitGuardian into the CI/CD pipeline to block commits containing secrets. |
| url_pattern | github.com, gitlab.com |
Monitor network logs for developers accessing public code repositories, which could be a source of accidental information leakage. |
| log_source | CloudTrail, Azure Activity Log | Monitor for API key usage from unusual IP addresses or locations, which could indicate a compromised key is being used. |
File Analysis.User Geolocation Logon Pattern Analysis.Response:
Mitigation is focused on preventing secrets from being hardcoded in the first place.
Application Configuration Hardening.M1017 - User Training..gitignore files to prevent sensitive files (like .env or key files) from ever being committed to the repository.Preventing secrets from being hardcoded by using dedicated secret management solutions is a fundamental configuration best practice.
Mapped D3FEND Techniques:
Training developers on secure coding practices and the dangers of hardcoding credentials is essential to changing behavior and reducing risk.
The root cause of the 17,000+ leaked secrets is a failure in application configuration. Organizations must enforce a strict policy against hardcoding credentials in source code. Instead, adopt a centralized secrets management solution like HashiCorp Vault, AWS Secrets Manager, or Azure Key Vault. Applications should be configured to fetch secrets dynamically at runtime or deployment time using secure APIs and IAM roles. This practice decouples secrets from the codebase, ensuring that even if the code is public, the credentials remain secure. This is the most critical strategic mitigation to prevent secret leakage at scale.
Implement automated secret scanning at multiple stages of the development lifecycle. First, use pre-commit hooks on developer workstations with tools like gitleaks or TruffleHog to catch secrets before they are ever committed. Second, integrate these scanners into the CI/CD pipeline as a required check for all merge requests to prevent secrets from reaching the main branch. Finally, run periodic, automated scans across all historical data in GitLab repositories to find secrets that were missed. This multi-layered analysis approach provides defense-in-depth against accidental credential exposure.
For the cloud credentials discovered, organizations must implement robust monitoring on the cloud provider side. Use services like AWS CloudTrail, GCP Audit Logs, and Azure Activity Logs to monitor all API calls made with static credentials. Configure alerts in a SIEM or CSPM tool to trigger on anomalous usage patterns. For example, a GCP key that has only ever been used from a corporate IP range suddenly being used from a residential ISP or a Tor exit node is a high-confidence indicator of compromise. This detective control is crucial for identifying when a leaked secret is actively being abused by an attacker.

Cybersecurity professional with over 10 years of specialized experience in security operations, threat intelligence, incident response, and security automation. Expertise spans SOAR/XSOAR orchestration, threat intelligence platforms, SIEM/UEBA analytics, and building cyber fusion centers. Background includes technical enablement, solution architecture for enterprise and government clients, and implementing security automation workflows across IR, TIP, and SOC use cases.
Help others stay informed about cybersecurity threats