T09 · Insecure Skill Coding Practices
Error
- Location
- README.md:18
- Finding
- Hard-Coded Tavily API Credential in Documentation## Vulnerability Details **File Location**: `README.md`, lines 18–19 **Vulnerability Type**: Hard-coded secret and plaintext credential exposure **Risk Level**: High ### Vulnerable Code ```bash export TAVILY_API_KEY="tvlY-dev-4WhK0Z-GBC7w91QlmfFozImB6ZG7hU6gCaUai2fQStmwlL5rk" mcporter config add tavily "https://mcp.tavily.com/mcp/?tavilyApiKey=$TAVILY_API_KEY" ``` ### Technical Analysis The README contains a Tavily API credential in plaintext and instructs users to configure the MCP endpoint with it. Anyone who can access the repository can recover and reuse the credential without authorization. The configuration command also inserts the credential into a URL. If executed as documented, the secret may be copied into shell history, process arguments, command logs, MCP configuration, diagnostic output, or other records that capture URLs. This increases the exposure beyond the repository itself. Because the credential has already been included in project content, merely deleting it from the current file is insufficient. It must be treated as compromised and rotated. If the repository has version history or external mirrors, the old value may remain recoverable. ### Attack Path 1. An attacker accesses `README.md` in the repository or a published package. 2. The attacker extracts the plaintext Tavily API key from line 18. 3. The attacker submits requests to Tavily using the exposed credential. 4. Those requests consume the credential owner's quota and are attributed to the associated account. 5. If users execute the documented command, additional copies of the credential may be recovered from local shell history, configuration, logs, or process-monitoring data. ### Impact Assessment Exploitation does not grant local host privileges or direct access to wallets and private keys based on the reviewed evidence. It can, however, provide unauthorized use of the Tavily account associated with the credential. Potential effects include: - Unauthorized API request ...[truncated 287 chars]
- Remediation
- ## Remediation Suggestions 1. Revoke the exposed Tavily API credential immediately and issue a replacement. 2. Replace the literal credential in `README.md` with a non-secret placeholder: ```bash export TAVILY_API_KEY="<YOUR_TAVILY_API_KEY>" mcporter config add tavily "https://mcp.tavily.com/mcp/?tavilyApiKey=$TAVILY_API_KEY" ``` 3. Require each user to generate and configure an individual API key rather than distributing a shared credential. 4. Prefer a credential mechanism that does not place secrets in URLs or command-line arguments. Use a supported secret store, protected environment configuration, or authenticated header mechanism where available. 5. Review repository history, releases, package archives, mirrors, CI logs, and documentation caches for copies of the exposed key. History rewriting may reduce accidental discovery but does not replace revocation. 6. Add automated secret scanning to pre-commit hooks and CI, using a tool such as Gitleaks, TruffleHog, or an equivalent platform feature. 7. Ensure local configuration files containing replacement credentials are excluded from version control and have restrictive filesystem permissions.
