T09 · Insecure Skill Coding Practices
- Location
SKILL.md:33- Finding
API Credential Exposed Through URL Query Parameters
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:33-35andSKILL.md:67-70
Vulnerability Type: API credential exposure through command-line URL query parameters
Risk Level: MediumComplete Vulnerable Code Snippets
bash claude mcp add --transport http pharma_intelligence \ "https://connect.patsnap.com/096456/ogic-mcp?apiKey=sk-xxxxxxxxxxxx"bash claude mcp add --transport http pharma_intelligence \ "https://connect.patsnap.com/096456/logic-mcp?apiKey=YOUR_API_KEY"Technical Analysis
The setup instructions direct users to substitute a live PatSnap API key into a URL query parameter passed as a command-line argument. Although HTTPS protects the request in transit, it does not prevent local or intermediary disclosure of the complete URL.
The credential may be retained or exposed through:
- Shell command history
- Process command-line inspection
- MCP client configuration
- Application and diagnostic logs
- Telemetry, crash reports, or support bundles
- Reverse-proxy and HTTP access logs that record query strings
Sending authentication material to the declared PatSnap service is consistent with the Skill's remote research functionality. However, placing that material in both a query string and command argument exceeds the minimum exposure necessary for authentication. No evidence in the audited file establishes intentional transmission to an unrelated party.
Attack Path
- A user replaces the documented placeholder with a valid API key.
- The user executes the provided
claude mcp addcommand. - The command or resulting server URL is retained in shell history, process metadata, MCP configuration, logs, telemetry, or diagnostic output.
- A local user, log reader, support-system operator, or other party with access to those artifacts obtains the key.
- The party submits requests to PatSnap using the disclosed credential.
- The credential remains usable until it expires, is revoked, or is rotated.
Impact
...[truncated 603 chars]
- Remediation
View remediation
Remediation Suggestions
- Do not place API keys in URL query parameters or literal command-line arguments.
- Prefer an authorization header supported by the service, such as
Authorization: Bearer .... - Store the credential in the platform's protected secret store and configure the MCP client to reference it without embedding the value in the URL.
- If secret-store integration is unavailable, use an environment-variable reference that the client resolves without persisting the expanded value. Avoid examples that encourage users to paste the secret directly into a shell command.
- Ensure application, proxy, telemetry, and diagnostic systems redact authorization values and URL query strings.
- Restrict file permissions on MCP configuration files and confirm that exported diagnostics omit credentials.
- Issue narrowly scoped keys with minimum required permissions and quotas.
- Document credential expiration, revocation, and rotation procedures.
- Revoke and rotate any real key previously configured using the documented URL pattern.
- Correct and consolidate the inconsistent endpoint paths (
ogic-mcpversuslogic-mcp) so users are not encouraged to troubleshoot by repeatedly exposing credentials in commands or logs.
