T09 · Insecure Skill Coding Practices
- Location
SKILL.md:37- Finding
API Credential Exposed in MCP Server URL
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 37–39 and 77–79
Vulnerability Type: API key exposure through URL query parameters
Risk Level: MediumVulnerable Code
bash claude mcp add --transport http pharma_intelligence \ "https://connect.patsnap.com/096456/Logic-mcp?apiKey=sk-xxxxxxxxxxxx"The failure guidance repeats the same insecure credential-placement 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 users to embed a PatSnap API key in a URL query parameter. HTTPS protects the URL while it is transmitted, but it does not prevent exposure at either endpoint or on the local system.
A URL containing the credential may be retained in:
- Shell command history
- MCP client configuration
- Process arguments or diagnostic output
- Proxy, gateway, and web-server access logs
- Crash reports and support bundles
- Configuration backups or synchronization services
The request is sent to the declared PatSnap service and is necessary for the Skill's external data access. No evidence indicates deliberate credential exfiltration to an unrelated party. Nevertheless, placing a reusable secret in a query string exceeds secure minimum-exposure practices because safer authorization headers or protected secret mechanisms should be used.
Attack Path
- A user follows the documented setup command and substitutes a real PatSnap API key.
- The complete URL, including the key, is stored in shell history and potentially in MCP configuration.
- The URL may also appear in process inspection, debug output, telemetry, proxy logs, or server access logs.
- A local user, compromised logging system, leaked support bundle, or exposed configuration backup obtains the URL.
- The attacker extracts the
apiKeyvalue and submits authenticated requests to the PatSnap service. - The attacker retai ...[truncated 680 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove API credentials from URL query parameters.
- Use an
Authorizationheader, such as a bearer token, if supported by the MCP service and client. - Prefer the MCP client's protected secret store or environment-variable interpolation rather than placing a literal key in commands or configuration files.
- If URL-based authentication cannot immediately be removed:
- Use narrowly scoped and short-lived credentials.
- Restrict keys by service, account, source, or network where supported.
- Redact query parameters from client, proxy, gateway, and server logs.
- Prevent credential-bearing commands from being retained in shell history.
- Apply restrictive permissions to MCP configuration files.
- Update both setup examples so users are not instructed to copy an insecure pattern.
- Document key revocation and rotation procedures for users who may already have followed these instructions.
- Review existing logs, configurations, backups, and support artifacts for previously exposed keys and rotate affected credentials.
