T09 · Insecure Skill Coding Practices
- Location
SKILL.md:40- Finding
API Credential Exposed Through URL Query Parameters
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 40–42 and 77–81
Vulnerability Type: API credential exposure through URL-based authentication
Risk Level: MediumVulnerable Code
Lines 40–42:
bash claude mcp add --transport http pharma_intelligence \ "https://connect.patsnap.com/096456/Logic-mcp?apiKey=sk-xxxxxxxxxxxx"Lines 77–81:
bash claude mcp add --transport http pharma_intelligence \ "https://connect.patsnap.com/096456/Logic-mcp?apiKey=你的API_KEY"Technical Analysis
The setup instructions require users to place a PatSnap API key directly in the query string of an MCP endpoint URL. Although the endpoint uses HTTPS, transport encryption does not protect the credential from disclosure through local command history, MCP configuration files, process diagnostics, copied commands, screenshots, telemetry, proxy logs, or server access logs that retain complete URLs.
The example does not contain an active hardcoded credential, but it instructs users to substitute a real credential into an insecure location. Query parameters are generally unsuitable for secrets because infrastructure and diagnostic systems commonly record request URLs.
Connecting to PatSnap is consistent with the Skill's declared life-science research functionality. However, exposing the credential through the URL exceeds the minimum credential-disclosure scope necessary to authenticate if a protected authorization header, secret store, environment reference, or secure prompt is available.
Attack Path
- A user creates a valid PatSnap API key.
- The user substitutes that key into the documented MCP endpoint and executes the command.
- The complete URL is retained in shell history, MCP configuration, diagnostic output, telemetry, or network infrastructure logs.
- An attacker or unauthorized local user gains read access to one of those records.
- The attacker extracts the
apiKeyquery parame ...[truncated 949 chars]
- Remediation
View remediation
Remediation Suggestions
- Replace query-string authentication with an
Authorizationheader or another header-based mechanism supported by the PatSnap MCP service. - If the MCP client supports secret references, load the credential from an operating-system keychain, managed secret store, or protected environment variable rather than embedding its value in the command or endpoint.
- Avoid examples that instruct users to paste real secrets into shell commands. Provide a secure interactive setup flow where possible.
- Ensure MCP configuration files containing credentials have restrictive file permissions and are excluded from source control, backups with broad access, and diagnostic bundles.
- Configure clients, proxies, telemetry systems, and server logs to redact
apiKeyand other authentication parameters. - Warn users that previously configured URL-based keys may remain in shell history and logs. Recommend deleting exposed records where feasible and rotating affected keys.
- Assign each key only the permissions and quotas required for disease-research queries, and provide straightforward revocation and expiration controls.
- Replace query-string authentication with an
