T09 · Insecure Skill Coding Practices
- Location
SKILL.md:34- Finding
API Credential Exposed Through MCP Connection URL
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 34–36 and 73–75
Vulnerability Type: API credential exposure through a URL query parameter
Risk Level: MediumVulnerable Code
Lines 34–36:
bash claude mcp add --transport http pharma_intelligence \ "https://connect.patsnap.com/096456/logic-mcp?apiKey=sk-xxxxxxxxxxxx"Lines 73–75 repeat the unsafe configuration pattern:
bash claude mcp add --transport http pharma_intelligence \ "https://connect.patsnap.com/096456/logic-mcp?apiKey=YOUR_API_KEY"Technical Analysis
The Skill instructs users to place a PatSnap API key directly in the MCP endpoint's query string. Authentication is necessary for the declared pharmaceutical research functionality, but putting credentials in URLs is an insecure secret-handling practice.
The command and complete credential-bearing URL may be retained or exposed through:
- Shell history
- MCP client configuration files
- Process inspection or diagnostic output
- Proxy and server access logs
- Application telemetry and error reports
- Support bundles, screenshots, or copied configuration
- URL logging by intermediary infrastructure
HTTPS protects the URL while it is transmitted over the network, but it does not prevent disclosure through local command history, client configuration, endpoint logging, or operational telemetry.
The example key is a placeholder rather than a confirmed live secret. The vulnerability is the documented configuration pattern, which directs users to substitute a real credential into the URL.
Attack Path
- A user follows the setup instructions and replaces the placeholder with a valid PatSnap API key.
- The user runs the command, causing the complete credential-bearing URL to be stored in shell history or MCP configuration.
- The URL may additionally appear in process diagnostics, logs, telemetry, or support artifacts.
- An attacker with access to one of these sources extracts the
apiKeyquery parame ...[truncated 972 chars]
- Remediation
View remediation
Remediation Suggestions
- Do not place API keys in URL query parameters.
- Use an MCP client credential field, authorization header, or protected secret store if supported by the service.
- Prefer an environment-variable reference rather than placing the literal secret in the command, for example:
bash export PATSNAP_API_KEY='...'The MCP configuration should resolve that variable through a protected credential mechanism without serializing the resulting key into a logged URL.
- Store credentials in a file or secret manager with access restricted to the current user when environment-variable or header-based authentication is unavailable.
- Ensure MCP configuration files containing credentials have restrictive filesystem permissions.
- Redact query strings and authentication values from client, proxy, server, telemetry, and diagnostic logs.
- Avoid printing credential-bearing endpoints in error messages or connection-status output.
- Document immediate key revocation and rotation procedures for users who have already followed the unsafe setup pattern.
- Apply server-side least privilege, key expiration, usage limits, and anomaly monitoring to reduce the impact of a leaked key.
- If the service only accepts query-string authentication, clearly disclose the residual risk and ensure the client stores and displays the endpoint in redacted form.
