How to resolve
- Use specific tooling for secure credential management: Remove all hardcoded credentials from source code, configuration files, and metadata immediately. Store credentials securely using environment variables, configuration management systems, or dedicated secrets management solutions like HashiCorp Vault, AWS Secrets Manager, Azure Key Vault, or Google Cloud Secret Manager.
- Update credentials regularly: Implement credential rotation procedures to regularly update secrets and ensure rotated credentials are automatically distributed to applications. Make sure leaked credentials are rotated immediately. This helps mitigating the scope of a leaked credential to a given timeframe.
- Proactively detect leaked credentials: Implement secret scanning in CI/CD pipelines using tools like GitGuardian, TruffleHog, or git-secrets to prevent future commits of hardcoded credentials. Audit version control history to identify and remediate historical credential exposures, and rotate any exposed credentials. For credentials already committed to repositories, treat them as compromised and rotate immediately.
- Corporate training: Establish policies and developer training to prevent hardcoded credentials in future development.
Risk
Governance/Compliance Hardcoded credential vulnerabilities violate multiple security standards:- NIST SP 800-53 Rev. 5 (IA-5): Fails to implement authenticator management controls that require secure storage and regular rotation of credentials.
- OWASP MCP Top 10 (MCP01:2025 - Token Mismanagement & Secret Exposure): Enables token mismanagement and secret exposure through credentials embedded in MCP server code or configuration.
- NIST Cybersecurity Framework (CSF) 2.0 (PR.PS-01, PR.DS-01): Requires a configuration that protects the integrity of the assets, and that data is protected at rest.
- OWASP Top 10 2025 (A07:2025 Authentication Failures): Violates the requirement of not storing the password in plaintext.
Explanation
This rule is triggered when credentials such as API keys, passwords, tokens, or other authentication secrets are embedded directly in MCP server tool code, configuration files, or metadata. Hardcoded credentials can be discovered by attackers through source code inspection, configuration file access, memory dumps, or reverse engineering. The scanner detects common secret patterns, known API key prefixes, and plaintext credentials in code, configuration files, and server metadata.Specifications
Trigger- MCP server scan detects hardcoded secret patterns, API key prefixes (e.g., sk_, api_key=), passwords, tokens, or other credentials embedded in source code, configuration files, or metadata.
- CRITICAL