T09 · Insecure Skill Coding Practices
- Location
SKILL.md:36- Finding
API Credential Exposed in URL Query String
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 36–38
Vulnerability Type: API credential exposure through a 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"A corresponding user-facing command containing
apiKey=YOUR_API_KEYis repeated at lines 76–78.Technical Analysis
The setup instructions require placing a PatSnap API key directly in a URL query string passed as a command-line argument. Although the documented value is a placeholder rather than a live credential, following the instructions with a real key can expose that key through:
- Shell history files
- Process command-line listings
- MCP client configuration or diagnostic output
- Application, reverse-proxy, access, and monitoring logs
- Error reports and copied terminal output
- URL telemetry or request tracing
HTTPS encrypts the URL while it is transmitted, but it does not prevent disclosure at the client, process, logging, or server infrastructure layers. The same unsafe credential pattern appears again in the connectivity-failure guidance at lines 76–78.
Attack Path
- A user follows the setup instructions and substitutes a real PatSnap API key into the URL.
- The complete command and credential-bearing URL are recorded in shell history, process arguments, configuration, or operational logs.
- A local user, support operator, log reader, or attacker with access to one of those records extracts the API key.
- The attacker submits requests to the PatSnap service using the exposed key.
- The attacker can consume API quota and access data or operations authorized to that key until it is revoked, rotated, or expires.
Impact Assessment
Exploitation does not itself grant host-level privilege escalation. Its scope is bounded by the permissions assigned to the exposed PatSnap API key. Potential effects include:
...[truncated 338 chars]
- Remediation
View remediation
Remediation Suggestions
- Do not place API keys in URL query parameters.
- Prefer an
Authorizationheader or another MCP-supported secret-bearing header:text Authorization: Bearer <API_KEY> - Load the credential from a protected environment variable, operating-system credential store, or dedicated secrets manager rather than accepting it as a literal command-line value.
- Ensure the MCP client stores credentials separately from ordinary configuration and redacts them from logs, diagnostics, errors, and status output.
- If the service only supports query-string authentication, construct the URL internally from protected secret storage and prevent it from appearing in command history or process listings.
- Update both occurrences of the setup command, including the failure guidance at lines 76–78.
- Document credential rotation, revocation, minimum-scope permissions, expiration, and incident-response procedures.
- Advise users to rotate any key previously entered into a shell command or retained in logs.
