Back to skill

Security audit

za-healthguide

Security checks for vulnerabilities and agentic risk

Overview

The skill’s insurance-advice purpose is coherent, but it needs Review because it can send sensitive health details to external services without an explicit consent step and includes a reusable API key in source code.

Review this skill carefully before installing. It is not clearly malicious, but users may share sensitive medical history, and the skill can send normalized health questions to ZhongAn’s API or third-party search. The publisher should move the API key to a secret store, add explicit consent before external queries, minimize health details, and require authoritative/current insurance sources before advice is given.

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 (2)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/query_product_knowledge.py:13
Finding

Reusable API Credential Embedded in Source Code

Content
View full analysis

Vulnerability Details

File Location: scripts/query_product_knowledge.py, lines 13-20
Vulnerability Type: Hard-coded API credential
Risk Level: High

Vulnerable Code

python
API_URL = "https://ihealth.zhongan.com/api/support/api/outer/v1/product/knowledge/recall"
API_KEY = "bfa9daba4a904448b23320596ce23c15"


def query(msg: str, product_name: str) -> dict:
    payload = json.dumps({
        "msg": msg,
        "apiKey": API_KEY,
        "productName": product_name
    }).encode("utf-8")

Technical Analysis

A reusable API credential is stored as a plaintext constant and distributed with the project. Anyone who can read the package can recover the credential without executing the script.

The credential is placed directly into each JSON request. There is no runtime secret injection, credential scoping, expiration mechanism, or access-control boundary preventing another program from reusing it. Although the audited code only submits product-knowledge queries, the exact permissions granted to the credential are controlled by the remote service and cannot be determined from this repository.

Attack Path

  1. An attacker obtains a copy of the publicly or internally distributed Skill package.
  2. The attacker reads scripts/query_product_knowledge.py.
  3. The attacker extracts the value assigned to API_KEY.
  4. The attacker constructs requests to the hard-coded API endpoint with the extracted value in the apiKey field.
  5. The remote service processes those requests with whatever authority, quotas, or access rights are associated with the exposed credential.

No additional local privileges are required to extract the secret.

Impact Assessment

An attacker may obtain unauthorized access to the API functionality associated with this credential. Potential consequences include:

  • Unauthorized consumption of API resources.
  • Quota exhaustion or increased operating costs.
  • Au ...[truncated 435 chars]
Remediation
View remediation

Remediation Suggestions

  1. Immediately revoke or rotate the exposed credential.
  2. Remove the credential from the source tree and relevant version-control history.
  3. Load credentials from a protected environment variable or managed secret store:
    python
    import os
    
    API_KEY = os.environ["ZHONGAN_API_KEY"]
    
  4. Fail securely when the secret is missing rather than falling back to a built-in value.
  5. Use short-lived, narrowly scoped tokens instead of a long-lived shared key.
  6. Enforce server-side authorization, rate limits, request quotas, and abuse monitoring.
  7. Restrict the credential to the required endpoint and operation where supported.
  8. Add automated secret scanning to continuous integration and pre-commit checks.
  9. Review remote-service logs for unauthorized use of the exposed credential.

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/query_product_knowledge.py:17
Finding

Health Information Transmitted to a Third-Party API Without Explicit Disclosure or Consent Controls

Content
View full analysis

Vulnerability Details

File Location: scripts/query_product_knowledge.py, lines 17-32; data collection and invocation are directed by SKILL.md, lines 35-36 and 55-59
Vulnerability Type: Undisclosed transmission of sensitive health information
Risk Level: Medium

Vulnerable Code

python
def query(msg: str, product_name: str) -> dict:
    payload = json.dumps({
        "msg": msg,
        "apiKey": API_KEY,
        "productName": product_name
    }).encode("utf-8")

    req = urllib.request.Request(
        API_URL,
        data=payload,
        headers={"Content-Type": "application/json"},
        method="POST"
    )

    try:
        with urllib.request.urlopen(req, timeout=10) as resp:
            return json.loads(resp.read().decode("utf-8"))

The Skill instructions direct the agent to collect disease name, diagnosis time, current treatment status, and relevant health indicators. They then require reconstructed health questions to be supplied through the script's --msg argument. The script places that content into the msg field and sends it to ZhongAn's remote API.

Technical Analysis

Medical history and health indicators are sensitive personal data. The script performs an external HTTPS transmission, but neither the script nor the reviewed compliance instructions require:

  • Informing the user that their health details will be transmitted to ZhongAn.
  • Obtaining affirmative consent before the transmission.
  • Showing the user the reconstructed question before submission.
  • Removing identifiers or rare combinations of health facts.
  • Providing a local-only alternative.
  • Explaining remote retention, access, or deletion practices.

The instruction to avoid passing the user's exact wording reduces incidental context, but it does not anonymize the medical facts. A reconstructed question can still contain disease type, stage, diagnosis timing, treatment, medication, ...[truncated 1769 chars]

Remediation
View remediation

Remediation Suggestions

  1. Add a clear notice before any external query that identifies:
    • The destination organization and endpoint.
    • The medical fields that will be transmitted.
    • The purpose of the transmission.
    • Available retention, deletion, and privacy information.
  2. Require affirmative user consent before sending health information externally.
  3. Display the normalized query to the user for confirmation before submission.
  4. Remove names, contact details, identification numbers, exact dates, locations, provider names, and unrelated medical details.
  5. Generalize exact values where precise values are unnecessary for the query.
  6. Implement validation that blocks common direct identifiers from the msg field.
  7. Provide a local-reference-only option for users who decline external processing.
  8. Document the third party's retention, access-control, deletion, and subprocessoring practices.
  9. Avoid recording full health-query payloads in application, proxy, analytics, and error logs.
  10. Apply short retention periods, encryption at rest, access auditing, and purpose limitation wherever remote storage is necessary.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (11)

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

声明描述的是一个面向复杂健康异常投保场景的专业顾问型技能,重点在于疾病/异常指标下能否投保、适合买什么产品,以及跨产品/跨保司比较。实际代码却只是把 msg 和 productName 发送到一个“产品知识召回”接口,返回查询结果。代码中没有任何疾病核保规则、健康告知决策、非标体分析、产品推荐/比较逻辑,也没有访问多保司资源的证据。虽然它可能可用于查询某些产品知识,和声明中的“支持众民保系列产品查询”有部分交集,但其主要行为明显窄得多,无法支撑所宣称的顾问能力,因此属于描述与实际行为不符。

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill explicitly instructs use of external network-capable functionality (web_search) but does not declare an allowed tool scope or permissions boundary. That creates an authorization and review gap: a skill handling sensitive medical/insurance context can transmit user-derived data externally without explicit capability declaration or governance.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill instructs collection of disease name, diagnosis time, treatment status, and related indicators, which are sensitive health data, but provides no user-facing privacy notice, minimization guidance, or consent flow. In an insurance context, this data is highly sensitive and can lead to privacy harm, regulatory exposure, or inappropriate retention if collected too early or too broadly.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill directs web_search queries that combine product names with user disease information, potentially sending sensitive health context to third-party search providers without transparent disclosure or consent. Because the subject matter is medical and insurance-related, external transmission materially increases privacy, compliance, and profiling risk.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

Lines L01-L03 state the compliance rules in Chinese and say all answers must follow them, which implies a fixed language/locale expectation. Under the policy, forcing a specific language without user opt-in is a natural-language policy concern unless the locale constraint is explicitly justified.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill explicitly instructs the agent to use web_search to obtain current insurance product details such as coverage, premiums, and health disclosure conditions, but it provides no requirement to verify source authority, recency, or accuracy before advising the user. In an insurance underwriting context, inaccurate or outdated search results can directly mislead users on eligibility, exclusions, or pricing, causing harmful financial or coverage decisions.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script transmits user-supplied query text and product information to an external API, and it does so automatically without any disclosure, consent flow, or data-minimization guardrails. In this skill context, users may submit sensitive health-history and underwriting details, so undisclosed outbound transfer creates a real privacy and compliance risk even if the destination is a legitimate business API.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

The manifest description is entirely framed in Chinese and presents the skill as operating in that language, with no indication that users may choose another language. Under the policy, forcing a specific language without user opt-in can be a natural-language policy violation unless the locale restriction is explicitly documented and justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The natural-language instructions, headings, and operational guidance are all written in Chinese, and the file does not mention that the skill supports other languages or that Chinese is an intentional, user-selected locale. Under the stated policy, forcing a specific language without opt-in is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

The entire skill reference is written only in Chinese and does not indicate that the user can choose another language or locale. Under the policy criteria, a file-wide language constraint can be a natural-language policy issue when it is imposed without user opt-in or explicit justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

The script's natural-language documentation and examples are entirely in Chinese, and there is no indication that this locale restriction is optional or intentionally limited to a Chinese-only audience. Under the language/locale policy, forcing a specific language without user opt-in can be a policy violation.

Content

No source excerpt is available for this finding.