Back to skill

Security audit

pharmaceuticals-exploration-zhcn

Security checks for vulnerabilities and agentic risk

Overview

This is a Chinese-language PatSnap pharmaceutical research skill with expected MCP setup and data-search behavior, but users should handle the API key carefully.

Install only if you intend to use PatSnap's life-science MCP service. Treat the PatSnap API key as a secret, avoid sharing terminal transcripts or MCP config, and rotate the key if you previously pasted a real key into logs, screenshots, chat, or source control.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:35
Finding

API Key Exposure Through a Command-Line Query String

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 35–37
Vulnerability Type: API key exposure in command-line arguments and URL query parameters
Risk Level: Medium

Vulnerable Code

bash
claude mcp add --transport http pharma_intelligence \
  "https://connect.patsnap.com/096456/Logic-mcp?apiKey=sk-xxxxxxxxxxxx"

The same insecure configuration pattern is repeated in SKILL.md, lines 74–77:

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 replace the placeholder with a live PatSnap API key and place it directly in a URL passed on the command line. Although HTTPS protects the URL while it is transported over the network, it does not protect the credential at the local endpoint or from application and infrastructure logging.

The complete key-bearing URL may be exposed through:

  • Shell history files
  • MCP client configuration
  • Process inspection or command-line telemetry
  • Debug output and diagnostic bundles
  • Proxy, gateway, and server access logs
  • Terminal transcripts, screenshots, and copied error reports
  • Backups containing command history or configuration files

Authentication is necessary for the Skill's declared functionality, and the endpoint belongs to the disclosed PatSnap service. Therefore, the evidence does not establish malicious exfiltration. However, transmitting the credential as a query parameter and command-line argument creates unnecessary exposure and does not follow least-disclosure practices. Authorization headers or protected secret references are safer alternatives.

Attack Path

  1. A user replaces sk-xxxxxxxxxxxx or 你的API_KEY with a valid API key.
  2. The user executes the documented command.
  3. The full command or resulting endpoint is retained in shell history, MCP configuration, process telemetry, or logs.
  4. An attacker with access to any exposed ...[truncated 1061 chars]
Remediation
View remediation

Remediation Suggestions

  1. Prefer an authorization header

    • Use a provider-supported Authorization: Bearer ... header rather than a URL query parameter.
    • Ensure the MCP client does not print authentication headers in ordinary logs.
  2. Use protected secret injection

    • Read the API key from a protected environment variable, operating-system credential manager, or MCP secret store.
    • Store only a secret reference in the MCP configuration, not the credential value.
  3. Avoid command-line exposure

    • Use an interactive secret prompt or protected configuration input.
    • If environment variables are supported, document secure variable expansion without placing the resolved secret into persisted configuration or logs.
  4. Harden logging

    • Redact apiKey and other credential-bearing query parameters from client, proxy, gateway, and server logs.
    • Exclude credentials from diagnostics, error messages, and telemetry.
  5. Protect local artifacts

    • Restrict permissions on MCP configuration and shell-history files.
    • Do not include credential-bearing configuration in source control, support archives, or shared terminal transcripts.
  6. Rotate exposed credentials

    • Revoke and rotate any production key previously configured using this command.
    • Review usage records for unexpected requests or quota consumption.
  7. Update both documented examples

    • Replace the patterns at lines 35–37 and 74–77 so users are not instructed to insert real credentials into URLs.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (1)

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill is explicitly labeled zhcn and its description is entirely in Simplified Chinese, indicating a Chinese-language skill behavior. There is no accompanying statement that users may choose another language or opt in to this locale, which can violate language/locale policy requirements for natural-language behavior.

Content

No source excerpt is available for this finding.