T09 · Insecure Skill Coding Practices
- Location
SKILL.md:36- Finding
API Credential Exposed Through a URL Query Parameter
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:36-38; repeated atSKILL.md:76-78
Vulnerability Type: Credential exposure through insecure configuration
Risk Level: MediumVulnerable code:
bash claude mcp add --transport http pharma_intelligence \ "https://connect.patsnap.com/096456/logic-mcp?apiKey=sk-xxxxxxxxxxxx"The same pattern is repeated in the connection-error guidance:
bash claude mcp add --transport http pharma_intelligence \ "https://connect.patsnap.com/096456/logic-mcp?apiKey=YOUR_API_KEY"Technical Analysis
The documented setup procedure instructs users to place a PatSnap API key directly in a URL query parameter. The included values are placeholders rather than confirmed live credentials, but users are expected to replace them with real credentials.
HTTPS protects the URL while it is in transit, but it does not prevent local or endpoint-side disclosure. A URL containing a credential can be retained in:
- Shell command history
- Process argument listings
- MCP client configuration
- Application, proxy, gateway, and diagnostic logs
- Telemetry and support bundles
- Screenshots or copied configuration output
Query parameters are also more likely than authorization headers to be logged without redaction. This is an insecure secret-handling pattern and violates credential-minimization practices.
Attack Path
- A user follows the setup instructions and replaces the placeholder with a valid API key.
- The complete command and credential-bearing URL are saved in shell history, process metadata, client configuration, or logs.
- A local user, administrator, support operator, telemetry recipient, or compromised logging system obtains the URL.
- The exposed API key is extracted from the
apiKeyparameter. - The attacker reuses the key against PatSnap services until the credential is revoked or expires.
Impact Assessment
Successful ...[truncated 372 chars]
- Remediation
View remediation
Remediation Suggestions
- Do not place API credentials in URL query parameters.
- Pass the key through an
Authorizationheader or another provider-supported authenticated header. - If the MCP client supports secret references, store the key in an operating-system credential store or dedicated secret manager and reference it without expanding it into the command line.
- If an environment variable is required, ensure it is supplied to the process without printing it, and restrict access to the environment and configuration files.
- Configure clients, proxies, telemetry systems, and support bundles to redact authorization material.
- Warn users not to commit credential-bearing configuration or share diagnostic output containing connection URLs.
- Document key rotation and revocation procedures for potentially exposed credentials.
