T09 · Insecure Skill Coding Practices
- Location
SKILL.md:18- Finding
Tavily API Key Exposed in an Endpoint URL
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:18
Vulnerability Type: API key exposure through command-line arguments and URL query parameters
Risk Level: MediumVulnerable Code
bash mcporter config add tavily https://mcp.tavily.com/mcp/?tavilyApiKey=<YOUR_KEY>Technical Analysis
The documented configuration method directs users to substitute a real Tavily API key directly into a URL passed as a command-line argument. This may expose the credential through shell history, process inspection while the command is running, terminal session recording, diagnostic output, command auditing, and any configuration or logs that retain the complete endpoint URL.
The endpoint belongs to the declared Tavily integration, so this is not evidence of unauthorized exfiltration. The vulnerability is the insecure handling of the secret rather than the intended transmission of the key to Tavily.
Attack Path
- A user replaces
<YOUR_KEY>with a valid Tavily API key. - The user executes the documented
mcporter config addcommand. - The command containing the key is retained in shell history, exposed temporarily through process arguments, or saved and logged as a complete endpoint URL.
- A local user, support operator, diagnostic collector, or other party with access to the resulting history, logs, or configuration retrieves the key.
- The exposed credential is reused to submit Tavily API requests under the victim's account.
Impact Assessment
An attacker who obtains the key can consume the victim's Tavily request quota and issue Tavily API requests associated with the affected account. The likely scope is limited to the permissions and resources granted to that API key; the reviewed code does not establish operating-system privilege escalation, arbitrary local code execution, or access beyond Tavily. Credential exposure could nevertheless cause service disruption, unexpected usage, an ...[truncated 61 chars]
- A user replaces
- Remediation
View remediation
Remediation Suggestions
- Do not place API keys in endpoint URL query parameters.
- Use
mcporter's supported secret-management or authentication configuration mechanism, if available. - Prefer a protected environment variable, operating-system credential store, or interactive standard-input prompt that does not echo or persist the secret.
- Store the non-sensitive MCP endpoint separately from its authentication credential.
- Ensure configuration files containing credentials have restrictive filesystem permissions and are excluded from source control.
- Redact credentials and sensitive query parameters from logs, diagnostics, and error output.
- Update the example to use a secure mechanism rather than merely replacing the key with another inline placeholder.
- Advise users who followed the existing instructions to remove affected shell-history entries and rotate any key that may have been exposed.
