T09 · Insecure Skill Coding Practices
- Location
SKILL.md:34- Finding
API Credential Exposed Through URL Query Parameter
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 34–36 and 74–76
Vulnerability Type: API credential exposure through an insecure 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 same pattern is repeated in the connectivity-error guidance:
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 users to substitute a real PatSnap API key directly into a URL query parameter. Although the endpoint uses HTTPS and belongs to the service declared by the Skill, embedding authentication secrets in URLs is unsafe.
The complete URL may be retained in shell history, MCP client configuration, command diagnostics, proxy or gateway logs, telemetry, crash reports, and support bundles. HTTPS protects the request while it is in transit, but it does not prevent credential disclosure through endpoint-side logging or local persistence of the command and configuration.
The external communication is necessary for the Skill's declared target-intelligence functionality. However, transmitting and storing the credential as part of the URL exceeds secure minimum-privilege practices because safer secret-delivery mechanisms can authenticate the same request without placing the key in commonly logged URL data.
Attack Path
- A user replaces the placeholder with a valid PatSnap API key.
- The user executes the documented
claude mcp addcommand. - The complete URL, including the key, is retained in shell history, MCP configuration, diagnostics, telemetry, or infrastructure logs.
- A local user, administrator, support-bundle recipient, log reader, or compromised monitoring component obtains access to that stored URL.
- The exposed ...[truncated 876 chars]
- Remediation
View remediation
Remediation Suggestions
- Do not place API credentials in URL query parameters.
- Prefer an
Authorizationheader, such as a bearer-token header, where supported by the MCP client and service. - Load the credential from a protected environment variable, operating-system credential store, or dedicated secrets manager.
- Ensure generated MCP configuration references the secret indirectly rather than persisting its plaintext value.
- Redact authentication headers, URLs, and configuration secrets from logs, telemetry, errors, crash reports, and support bundles.
- Use narrowly scoped, short-lived credentials with explicit expiration and minimum required API permissions.
- Document immediate key revocation and rotation procedures for users who previously followed the URL-based setup instructions.
- Review shell histories, MCP configuration files, and relevant service or proxy logs for previously exposed keys and rotate affected credentials.
