Back to skill

Security audit

TCM Prescription API

Security checks for vulnerabilities and agentic risk

Overview

This skill does what it says, but users should review it because it sends health-related symptoms to an external API and documents an unsafe API-key-in-URL pattern.

Install only if you are comfortable sending TCM search terms and symptom descriptions to the documented external API. Do not put real API keys in URL query parameters, avoid sharing identifying medical details, and treat recommendations as informational rather than medical advice.

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
references/api-reference.md:33
Finding

API Key Exposure Through URL Query Parameters

Content
View full analysis

Vulnerability Details

File Location: references/api-reference.md:18-19, 28-33, 232-239
Vulnerability Type: API credential exposure through URL query strings
Risk Level: Medium

The API reference documents query-string authentication and provides a command that expands the API key directly into a URL:

markdown
### API Key Authentication

Transmission methods:
- Request header: `X-API-Key: $TCM_API_KEY` (environment variable recommended)
- Query parameter: `?api_key=$TCM_API_KEY`

### API Key Status Query

Check whether an API key is valid:

```bash
curl -s "https://119.91.226.122/api/api-keys/status?key=$TCM_API_KEY"
text

The same unsafe status-query example is repeated later in the reference:

```bash
curl -s "https://119.91.226.122/api/api-keys/status?key=$TCM_API_KEY"

Technical Analysis

Secrets should not be transmitted in URL query parameters. When the shell expands $TCM_API_KEY, the resulting URL contains the plaintext credential. URLs are routinely captured by shell command histories, process inspection or auditing facilities, HTTP server and reverse-proxy access logs, monitoring systems, debugging output, and URL telemetry.

HTTPS encrypts the request in transit but does not prevent disclosure through endpoint logs or local operational records. The documentation already identifies the X-API-Key request header as a supported alternative, making query-string transmission unnecessary for the Skill's declared functionality and contrary to least-exposure principles.

Attack Path

  1. A user follows the documented API-key status command.
  2. The shell expands $TCM_API_KEY into the request URL.
  3. The complete URL is retained in shell history, process or audit records, API access logs, reverse-proxy logs, or monitoring telemetry.
  4. An attacker or lower-privileged operator with access to one of those records retrieves the API key.
  5. The attacker supplies the stolen ...[truncated 954 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove query-parameter authentication from the API reference and server implementation.

  2. Remove both examples using ?key=$TCM_API_KEY or ?api_key=$TCM_API_KEY.

  3. Require authentication through the X-API-Key header exclusively. For example:

    bash
    curl -s "https://119.91.226.122/api/api-keys/status" \
      -H "X-API-Key: $TCM_API_KEY"
    
  4. Configure application servers, reverse proxies, observability platforms, and diagnostic tooling to redact the X-API-Key header.

  5. Prevent credentials from appearing in command traces and debugging output; warn users against enabling shell tracing while running authenticated commands.

  6. Review access logs for historical URLs containing key or api_key parameters, restrict access to those logs, and securely purge retained credential-bearing records where feasible.

  7. Rotate or revoke API keys that may previously have been transmitted in URLs.

  8. Add automated documentation and source checks that reject examples placing secrets in URLs.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (26)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 130)May include surrounding context.

md
根据识别的意图,构建对应的 API 请求。参考 `scripts/query_prescriptions.sh` 脚本中的实现方式。

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 156)May include surrounding context.

md
根据识别的意图,构建对应的 API 请求。参考 `scripts/query_prescriptions.sh` 脚本中的实现方式。

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 159)May include surrounding context.

md
根据识别的意图,构建对应的 API 请求。参考 `scripts/query_prescriptions.sh` 脚本中的实现方式。

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 160)May include surrounding context.

md
根据识别的意图,构建对应的 API 请求。参考 `scripts/query_prescriptions.sh` 脚本中的实现方式。

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 161)May include surrounding context.

md
根据识别的意图,构建对应的 API 请求。参考 `scripts/query_prescriptions.sh` 脚本中的实现方式。

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 162)May include surrounding context.

md
根据识别的意图,构建对应的 API 请求。参考 `scripts/query_prescriptions.sh` 脚本中的实现方式。

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 163)May include surrounding context.

md
根据识别的意图,构建对应的 API 请求。参考 `scripts/query_prescriptions.sh` 脚本中的实现方式。

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · scripts/query_prescriptions.sh (reported line 39)May include surrounding context.

sh
echo ">>> 搜索方剂: 关键词='${keyword}' 分类='${category}' 页码=${page} 每页=${limit}"
  if [ -n "$API_KEY" ]; then
    curl -s "$url" -H "X-API-Key: $API_KEY" | python3 -m json.tool
  else
    curl -s "$url" | python3 -m json.tool
  fi

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · scripts/query_prescriptions.sh (reported line 41)May include surrounding context.

sh
if [ -n "$API_KEY" ]; then
    curl -s "$url" -H "X-API-Key: $API_KEY" | python3 -m json.tool
  else
    curl -s "$url" | python3 -m json.tool
  fi
}

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · scripts/query_prescriptions.sh (reported line 57)May include surrounding context.

sh
echo ">>> 获取方剂详情: ID=${id}"
  if [ -n "$API_KEY" ]; then
    curl -s "${API_BASE}/prescriptions/${id}" -H "X-API-Key: $API_KEY" | python3 -m json.tool
  else
    curl -s "${API_BASE}/prescriptions/${id}" | python3 -m json.tool
  fi

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · scripts/query_prescriptions.sh (reported line 59)May include surrounding context.

sh
if [ -n "$API_KEY" ]; then
    curl -s "${API_BASE}/prescriptions/${id}" -H "X-API-Key: $API_KEY" | python3 -m json.tool
  else
    curl -s "${API_BASE}/prescriptions/${id}" | python3 -m json.tool
  fi
}

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · scripts/query_prescriptions.sh (reported line 66)May include surrounding context.

sh
# 获取方剂分类
get_categories() {
  echo ">>> 获取方剂分类列表"
  curl -s "${API_BASE}/prescriptions/categories" | python3 -m json.tool
}

# 症状推荐方剂

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · scripts/query_prescriptions.sh (reported line 94)May include surrounding context.

sh
" 2>/dev/null)

  echo ">>> 症状推荐方剂: ${symptoms_input}"
  curl -s -X POST "${API_BASE}/prescriptions/recommend" \
    -H "Content-Type: application/json" \
    -H "X-API-Key: $API_KEY" \
    -d "{\"symptoms\": ${symptoms_json}}" | python3 -m json.tool

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · scripts/query_prescriptions.sh (reported line 103)May include surrounding context.

sh
# 健康检查
health_check() {
  echo ">>> 服务健康检查"
  curl -s "https://119.91.226.122/health" | python3 -m json.tool
}

# 主入口

External Transmission

Medium
Category
Data Exfiltration
Confidence
87% confidence
Finding

The skill is explicitly designed to send user queries to an external API at a raw IP address, which creates a real data-transfer trust boundary. Even though external HTTP use is expected for this skill, the README does not sufficiently warn users that their search terms, prescription lookups, and possibly health-related inputs will leave the local environment and be processed by a third-party service.

Content

Scanner excerpt · README.md (reported line 25)May include surrounding context.

bash
# 搜索方剂(无需认证)
curl -s "https://119.91.226.122/api/prescriptions/search?q=桂枝汤"

# 查看方剂详情(无需认证)
curl -s "https://119.91.226.122/api/prescriptions/1"

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The README encourages symptom-based recommendation requests to a remote API but does not clearly disclose that potentially sensitive health-related symptom data will be transmitted to an external third-party service. Health symptoms can constitute sensitive personal data, so the lack of notice and privacy guidance creates a meaningful data exposure and consent risk.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
87% confidence
Finding

The skill explicitly instructs the agent to use shell execution and outbound HTTP requests, but it does not declare any corresponding tool scope or allowed-tools policy. This creates a least-privilege and governance gap: a host agent may permit broader shell/network access than users or reviewers expect, increasing the chance of unintended command execution or data egress.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill offers symptom-based formula recommendations that could influence health decisions, but it does not warn that results are informational only and not medical advice. In a medical context, users may over-trust the output and act on contraindicated or inappropriate recommendations, especially because the skill also exposes indications, contraindications, and treatment-oriented workflows.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · SKILL.md (reported line 59)May include surrounding context.

1. 搜索方剂

bash
curl -s "https://119.91.226.122/api/prescriptions/search?q=桂枝&page=1&limit=20"

参数说明:

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The documentation explicitly recommends passing the API key as a query parameter, which can leak credentials through browser history, proxy logs, server access logs, analytics tools, referrer headers, and shared shell history. Even though this is only documentation, it guides users toward an unsafe authentication pattern and normalizes credential exposure.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The public status-check example places the API key directly in the URL, creating a concrete credential leakage path in logs and monitoring systems. Because this endpoint is specifically for checking key validity, users are encouraged to expose a live secret to a public endpoint in the least safe transport form available in HTTP semantics.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · references/api-reference.md (reported line 112)May include surrounding context.

请求示例:

bash
curl -s "https://119.91.226.122/api/prescriptions/1" \
  -H "X-API-Key: $TCM_API_KEY"

External Transmission

Medium
Category
Data Exfiltration
Confidence
88% confidence
Finding

The recommend function transmits user-provided symptom data and an API key to an external service over the network. Even though this appears to be the intended purpose of the skill, it still creates a real data-exposure surface because potentially sensitive health information is sent to a third-party endpoint.

Content

Scanner excerpt · scripts/query_prescriptions.sh (reported line 94)May include surrounding context.

sh
" 2>/dev/null)

  echo ">>> 症状推荐方剂: ${symptoms_input}"
  curl -s -X POST "${API_BASE}/prescriptions/recommend" \
    -H "Content-Type: application/json" \
    -H "X-API-Key: $API_KEY" \
    -d "{\"symptoms\": ${symptoms_json}}" | python3 -m json.tool

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

The natural-language instructions, examples, and usage are entirely Chinese-centric, and the README tells users to query prescriptions directly in Chinese without mentioning any language option or explicit locale limitation. This can be a language/locale policy issue because the skill appears to force a specific language without opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

The file explicitly says returned data should be presented in a clear Chinese format, which imposes a language preference in the skill behavior. There is no indication that the agent should follow the user's requested language or offer a language choice, despite the trigger examples including English queries.

Content

No source excerpt is available for this finding.