T09 · Insecure Skill Coding Practices
- Location
SKILL.md:34- Finding
API Key Exposed Through MCP Endpoint Query String
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 34–35 and 73–74
Vulnerability Type: API credential exposure through a URL query parameter
Risk Level: MediumVulnerable Code
bash claude mcp add --transport http pharma_intelligence \ "https://connect.patsnap.com/096456/logic-mcp?apiKey=sk-xxxxxxxxxxxx"The connection-error guidance repeats the same insecure pattern:
bash claude mcp add --transport http pharma_intelligence \ "https://connect.patsnap.com/096456/logic-mcp?apiKey=YOUR_API_KEY"Technical Analysis
The setup instructions require the user to substitute a real PatSnap API key directly into an MCP endpoint URL. Although the endpoint uses HTTPS, transport encryption does not protect the credential from exposure at locations where the complete URL may be retained or processed.
The expanded URL may be recorded in:
- Shell command history
- MCP client configuration
- Process diagnostics or support bundles
- Application, proxy, gateway, and observability logs
- Authentication and connection error messages
URL query parameters are commonly logged as part of request targets. Therefore, they are unsuitable for long-lived secrets unless every component guarantees query-string redaction. The external PatSnap connection is relevant to the Skill's declared biomarker-research functionality, but placing its credential in the URL is not required by least-privilege credential-handling practices.
The reviewed content uses a placeholder rather than a hardcoded live credential, and there is no evidence that the key is sent to an attacker-controlled domain. The risk arises when a user follows the instructions and replaces the placeholder with a valid key.
Attack Path
- A user creates a valid PatSnap API key.
- The user substitutes that key into the documented MCP endpoint URL and executes the command.
- The complete URL, including the API key, is retained in ...[truncated 904 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove the API key from the endpoint URL.
- Prefer an
Authorizationheader, such as a bearer token, if supported by the MCP client and service. - Otherwise, use a protected operating-system secret store, MCP secret facility, or unexpanded environment-variable reference.
- Ensure that the secret is not written in expanded form to shell history or persistent configuration.
- Configure clients, proxies, gateways, telemetry systems, and error handlers to redact credentials and sensitive query parameters.
- Assign narrowly scoped permissions and quotas to the key, with an expiration period appropriate to its use.
- Rotate or revoke any API key previously configured using the documented query-string method.
- Update both the initial setup example and the connection-error guidance so they use the same secure credential mechanism.
