T09 · Insecure Skill Coding Practices
- Location
SKILL.md:35- Finding
API Credential Embedded in MCP Service URL
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 35–38; the same pattern is repeated at lines 73–76
Vulnerability Type: Credential 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"Technical Analysis
The setup instructions require users to replace the placeholder with a real API key embedded in the
apiKeyURL query parameter. Although the endpoint uses HTTPS, which protects the request while in transit, HTTPS does not prevent the complete URL from being exposed through other channels.The resulting credential-bearing URL may be retained in:
- Shell command history
- Claude MCP configuration files
- Process invocation records
- Application and diagnostic logs
- HTTP proxy, gateway, or server access logs
- Monitoring and error-reporting systems
- Screenshots or copied support diagnostics
URL query parameters are commonly logged as part of normal operational telemetry. Consequently, this authentication design exposes the API key to more systems and users than are necessary for the Skill's declared oncology-data retrieval functionality. The placeholder itself is not a live secret, but the documented workflow directs users to handle a real secret insecurely.
Attack Path
- A user follows the setup instructions and replaces
sk-xxxxxxxxxxxxwith a valid PatSnap API key. - The full command is retained in shell history, MCP configuration, logs, or diagnostic output.
- An attacker or lower-privileged operator obtains access to one of those records.
- The attacker extracts the value of the
apiKeyquery parameter. - The attacker submits requests to the PatSnap endpoint using the stolen key.
- Requests succeed to the extent permitted by the compromised key until it is revoked, rotated, or expi ...[truncated 512 chars]
- Remediation
View remediation
Remediation Suggestions
- Do not place API credentials in URL query parameters.
- Prefer an
Authorizationheader or another authentication header supported by the service. - Load credentials at runtime from an environment variable, operating-system credential manager, or dedicated secret store.
- Ensure MCP configuration stores only a secret reference rather than the resolved credential where possible.
- Redact authorization values and sensitive query parameters from client, proxy, gateway, and server logs.
- Issue narrowly scoped keys with the minimum datasets, operations, and usage limits required by this Skill.
- Support expiration and routine key rotation, and immediately revoke any key that may have appeared in logs or shell history.
- Update both occurrences of the setup command so users are not instructed to copy real credentials into command-line arguments.
