Hardcoded credentials exposed in MCP files on GitHub: 12% of cases at risk
A Hush Security investigation revealed that 12% of authentication fields in public MCP configuration files on GitHub contain hardcoded credentials, potentially exposing connected systems and services. The analysis, conducted on 82,000 files, reveals a significant criticality in the management of machine identities (MCP), with direct implications for NIS2 compliance and digital operational resilience.
Quick Response
- 12% of MCP files on GitHub contain hardcoded credentials
- 55% of these credentials do not follow recognizable standard formats
- 24% of exposed credentials are non-expiring and broad-spectrum
- Credentials remain accessible even after deletion from the current version
- Machine identities (MCP) require continuous monitoring to mitigate risks
Research methodology: how vulnerabilities were identified
Researchers analyzed public GitHub repositories for configuration files used by main encoding agents, examining environmental values and authentication headers. They classified credential fields based on how authentication information was stored: hardcoded values, references to environment variables, client-managed prompts, references to secret managers, placeholders, and empty fields.
Analysis techniques: from Shannon entropy to specific patterns
To identify probable secrets in hardcoded values, researchers used provider-specific patterns and Shannon entropy, which measures randomness. The results indicate that 55% of exposed credentials had no recognizable vendor token format, with 31% classified as opaque bearer tokens for internal MCP servers. Values without provider-specific formats were evaluated based on key names, length, entropy, and character patterns.
The persistence of deleted secrets: a Git history problem
A critical aspect emerged from the study is that removing sensitive information from the current version of a file does not eliminate it from the repository. Git maintains previous versions, making deleted values still accessible through commit history. Out of 7,681 configurations with credentials, researchers found 243 cases where a secret had been removed from the current version but remained in a previous commit.
The problem of long-term credentials: risks and implications
24% of the identified hardcoded credentials were of non-expiring and broad-spectrum types by design. 53% of credentials with a classified scope provided access at the organizational, account, workspace, or database level. For those with a defined expiration policy, 80% did not expire by default. These long-term credentials with broad authorizations increase the impact of exposure, as a single credential can provide access to multiple sensitive resources or functions.
MCP and the challenge of non-human machine identities
MCP connections allow AI agents to interact with source code, databases, cloud infrastructures, and other services on behalf of users or organizations. These agents operate as non-human identities, using credentials to authenticate to systems without requiring human access for each interaction. As the use of these agents grows, organizations must track which agents have access, what permissions they hold, who is responsible for them, and when that access should end.
The importance of proactive credential management
Micha Rave, CEO of Hush Security, emphasizes that the traditional response to the discovery of exposed secrets—scanning, blocking the commit, and rotating—is not sufficient. "These files are meant to be committed; the secret should never be there. When it is, the high-risk credentials in them match no known pattern, and the identities behind them have no owner and do not expire. It's an entire population of access tokens in public Git with no one controlling them," says Rave.
Implications for business security and compliance
The discovery of these vulnerabilities highlights the need for advanced Security Information and Event Management (SIEM) and Managed Detection and Response (MDR) solutions to monitor and respond to these exposures. Additionally, organizations should consider implementing Data Loss Prevention (DLP) to prevent the loss of sensitive data and ensure compliance with regulations such as the NIS2 Directive and the DORA Regulation.
Best practices to mitigate risks
To reduce credential exposure, organizations should adopt robust identity access management (IAM) practices and consider implementing a managed Security Operations Center (SOC as a Service) for timely incident response. Additionally, regular credential rotation and adoption of zero trust architecture can help minimize risks associated with machine identities.
For further insights on how to protect business infrastructures, explore our guide on ransomware protection and see also: how to ensure NIS2 compliance.
The market for machine identity solutions
The exposure of hardcoded credentials is accelerating demand for specialized identity management (IAM) solutions focused on machine identities. According to Gartner, the global market for these technologies will reach $2.3 billion by 2025, with a 27% annual growth rate. In this context, vendors like Venafi, DigiCert, and Keyfactor are developing advanced platforms for MCP credential lifecycle management, offering continuous monitoring and risk analysis features.
Impact on cyber insurance
The discovery of these vulnerabilities is already influencing the cyber insurance market. Underwriters like Coalition and Beazley are reviewing their underwriting criteria, with particular attention to the management of hardcoded credentials in public repositories. According to an S&P Global report, 38% of cyber policies issued in the first quarter of 2024 include explicit clauses related to machine identity management, with premiums that can increase up to 15% for organizations with evident security gaps.
Challenges in implementing solutions
The adoption of MCP credential management solutions is not without obstacles. 62% of organizations surveyed by Hush Security reported integration problems with legacy infrastructures, while 45% reported internal resistance to migrating from traditional credential management methods. These factors are slowing the adoption of best practices, despite growing awareness of risks.
Critical use cases for MCP credentials
The exposed credentials are not just about generic infrastructures. According to Hush Security's analysis, 33% of detected cases involved DevOps development environments, 28% multi-tenant cloud infrastructures, and 19% industrial automation systems (ICS). In particular, credentials exposed in DevOps environments could allow access to build pipelines and source code repositories, representing a critical vector for supply chain attacks.
Evolution of related threats
Threat groups are already exploiting these vulnerabilities. According to the Cybersecurity and Infrastructure Security Agency (CISA), 17% of incidents detected in the first quarter of 2024 involved the use of exposed MCP credentials to gain initial access. Of these, 42% led to compromises of sensitive data, while 31% conducted ransomware-type attacks. Broad-spectrum and non-expiring credentials are particularly valuable for attackers, as they allow persistent access to systems.
Open-source tools for detection
The open-source community is responding to these challenges with specific tools for detecting exposed credentials. Projects like GitLeaks and TruffleHog are increasingly used to analyze Git repositories for secrets. According to a survey conducted by GitLab, 58% of organizations using open-source security tools detected at least one critical vulnerability in their repositories in the past year. These tools represent a crucial first step, although they must be integrated with more comprehensive managed Security Operations Center (SOC as a Service) solutions for effective response.
Implications for the financial sector
The financial sector is particularly exposed to these risks, with 47% of institutions using AI agents for process automation. According to a Deloitte report, 23% of security incidents in the financial sector in 2023 involved the exposure of automation credentials. The MiCA regulation and guidelines from the Basel Committee are pushing institutions to implement stricter controls, with a specific focus on machine identity management.
Future perspectives and forecasts
Hardcoded credentials in MCP files represent only the tip of the iceberg of a broader challenge in managing machine identities. According to Forrester's forecasts, by 2026, 60% of organizations will experience at least one security incident related to improperly managed automation credentials. This scenario underscores the urgent need to adopt advanced incident response and breach remediation solutions, integrated with NIS2 compliance and DORA Regulation frameworks.
Investments in research and development
In response to these challenges, leading security vendors are significantly increasing their investments in research and development. According to CB Insights, investments in startups focused on machine identities increased by 120% in 2023, with a particular focus on real-time monitoring solutions and behavioral analysis. These promising developments could soon offer new options for organizations seeking to mitigate risks associated with MCP credentials.
Frequently Asked Questions
What is the economic impact of an MCP credential exposure?
According to an IBM report, the average cost of a security incident related to exposed credentials is $4.45 million, with costs that can reach $10 million for large companies. These costs include not only incident response but also fines for non-compliance and loss of customer trust.
How can I verify if my Git repository contains exposed credentials?
Open-source tools like GitLeaks and TruffleHog can be used to analyze repositories for secrets. For a more in-depth analysis, it is advisable to use commercial Data Loss Prevention (DLP) solutions or rely on an MDR service specialized in machine identity management.
What are the relevant regulations for MCP credential management?
The main regulations include the NIS2 Directive for critical infrastructures, the DORA Regulation for the financial sector, and the guidelines of the Basel Committee for banking institutions. Additionally, the MiCA regulation is introducing new requirements for machine identity management in the cryptocurrency sector.
Editorial Note and Disclaimer
The guides and content published on GoYou are the result of independent research and analysis activities, for informational, educational, and in-depth purposes.
GoYou does not constitute a journalistic publication nor an editorial product pursuant to Law No. 62/2001 and does not provide real-time information.
The GoYou project does not provide professional, technical, legal, or financial advice and disclaims all responsibility for the improper use of the published information.
In the Crypto sector, every investment involves risks: readers are invited to always inform themselves independently before making any decision.