T09 · Insecure Skill Coding Practices
- Location
SKILL.md:34- Finding
API Credential Passed Through a URL Query Parameter
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 34-36
Vulnerability Type: API credential exposure through insecure configuration
Risk Level: MediumVulnerable Code
bash claude mcp add --transport http pharma_intelligence \ "https://connect.patsnap.com/096456/Logic-mcp?apiKey=sk-xxxxxxxxxxxx"The same credential-handling pattern is repeated in the troubleshooting instructions at lines 74-76:
bash claude mcp add --transport http pharma_intelligence \ "https://connect.patsnap.com/096456/Logic-mcp?apiKey=YOUR_API_KEY"Technical Analysis
The documentation instructs users to place a PatSnap API key directly in a URL query parameter. The checked-in values are placeholders rather than active credentials, but users are expected to replace them with real secrets.
HTTPS protects the request while it is in transit, but it does not prevent the credential-bearing URL from being exposed through other channels. Depending on the client and operating environment, the URL may be retained in:
- Shell history
- MCP client configuration
- Process arguments
- Debugging and diagnostic output
- HTTP proxy, gateway, or server access logs
- Terminal recordings and copied support logs
Query strings are commonly logged as complete request targets. Consequently, using them for authentication unnecessarily increases the number of places in which the secret may persist.
Attack Path
- A user creates a valid PatSnap API key.
- The user substitutes the key into the documented URL and runs the command.
- The credential-bearing command or URL is retained in shell history, MCP configuration, process telemetry, or service logs.
- A local user, administrator, support operator, monitoring system, or other party with access to those records obtains the URL.
- That party extracts the
apiKeyvalue and submits authenticated requests to the PatSnap service. - The exposed key rem ...[truncated 660 chars]
- Remediation
View remediation
Remediation Suggestions
- Do not place API keys in URL query parameters.
- Prefer an authorization header, such as
Authorization: Bearer ..., if supported by the MCP service. - Load the key from a protected environment variable, operating-system credential store, or dedicated secret manager.
- Ensure the MCP client stores credentials separately from ordinary endpoint configuration and applies restrictive filesystem permissions.
- Redact authorization values and sensitive query parameters from client, proxy, gateway, and server logs.
- Update the setup example so users are not encouraged to paste secrets directly into commands that may enter shell history.
- If query-parameter authentication is unavoidable, use short-lived, narrowly scoped keys; disable command history for setup; document the residual exposure; and rotate the key after suspected disclosure.
- Review existing logs and configurations for previously exposed keys and revoke or rotate affected credentials.
