Back to skill

Security audit

健康管理

Security checks for vulnerabilities and agentic risk

Overview

This health skill asks for identifiable medical details, sends full conversations to an external service, exposes an API key, and can save unsafe local HTML reports without enough consent or safeguards.

Only install this after the publisher removes and rotates the exposed API key, adds clear consent and privacy disclosures, minimizes or de-identifies medical data before sending it out, declares the required capabilities, and fixes report generation so saved HTML cannot run injected content or show screening promotions unintentionally.

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

T09 · Insecure Skill Coding Practices

Error
Location
references/api_docs.md:7
Finding

Hardcoded API Credential Exposed in Project Documentation

Content
View full analysis
str: """Fetch the API key through a remote endpoint and cache it in a module variable.""" global _API_KEY_CACHE if _API_KEY_CACHE: return _API_KEY_CACHE try: result = subprocess.run( ["curl", "-s", "--max-time", "10", "https://jiyinjia.jinbaisen.com/!token?key=skill_jk"], capture_output=True, text=True, timeout=15 ) key = result.stdout.strip() if key: _API_KEY_CACHE = key return key except Exception: pass raise RuntimeError("Unable to obtain API key; check the network connection and retry.") ``` ### Technical Analysis A bearer-style API key is committed directly to a distributable project file. Anyone who can read or download the Skill package can recover the credential without executing the code. Repository history, build artifacts, logs, backups, mirrors, and installed Skill copies can preserve the secret even after it is removed from the current version. The runtime credential design is also weak. A static identifier, `skill_jk`, is placed in the query string of a token-retrieval URL. The code does not present a caller-specific credential, perform an authenticated exchange, or validate the format of the returned token. Query parameters may addi ...[truncated 1554 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/health_assistant.py:129
Finding

Unescaped Health Data and API Content Injected into Generated HTML Reports

Content
View full analysis
str: """Render the template by replacing placeholders.""" result = self._template for key, value in data.items(): placeholder = f"{{{{{key}}}}}" result = result.replace(placeholder, str(value)) return result ``` Patient-controlled values and API-derived values are passed directly to that renderer: ```python data = { # Patient information "PATIENT_NAME": patient_data.get("name", "Unknown"), "PATIENT_AGE": patient_data.get("age", "-"), "PATIENT_GENDER": patient_data.get("gender", "Unknown"), "PATIENT_REGION": patient_data.get("region", "Unknown"), "PATIENT_JOB": patient_data.get("job", "Unknown"), "MEDICAL_HISTORY": patient_data.get("medical_history", "None"), "FAMILY_HISTORY": patient_data.get("family_history", "None"), "LIFESTYLE": patient_data.get("lifestyle", "None"), "MEDICATION": patient_data.get("medication", "None"), "EXAM_DATE": patient_data.get("exam_date", date_str), "EXAM_SOURCE": patient_data.get( "exam_source", "Physical examination report supplied by the user" ), # Assessment results "ADR_SCORE": str(assessment_result.get("adr_score", "18")), "RISK_LEVEL": assessment_result.get("risk_level", "Potential risk"), "CORE_RISK_FACTORS": assessment_result.get( "core_risk_factors", "Borderline blood lipids and insufficient sleep" ), "OVERALL_ASSESSMENT": assessment_result.get( "overall_assessment", "No obvious organ dysfunction currently identified" ), # Raw HTML-bearing assessment fields "LAB_RESULTS_T ...[truncated 3296 chars]
Remediation
View remediation

other

Error
Location
scripts/health_assistant.py:219
Finding

Identifiable Medical Information Is Transmitted to a Third Party Without Consent or Data Minimization Controls

Content
View full analysis
str: """Interact with the user and collect information.""" self.conversation_history.append({"role": "user", "content": user_input}) self._parse_user_info(user_input) completeness = self._check_info_completeness() if completeness["is_complete"]: self.info_complete = True return self._call_api() else: follow_up = self._generate_follow_up(completeness["missing"]) self.conversation_history.append( {"role": "assistant", "content": follow_up} ) return follow_up ``` The complete history is transmitted to an external service: ```python def _call_api(self) -> str: """Call the backend model API for a health assessment.""" try: api_key = _fetch_api_key() headers = { "Authorization": f"Bearer {api_key}", "Content-Type": "application/json" } payload = { "model": self.MODEL, "messages": self.conversation_history, "stream": True, "temperature": 0.7, "max_tokens": 2048 } response = requests.post( f"{self.BASE_URL}/chat/completions", headers=headers, json=payload, stream=True, timeout=60 ) ``` The declared collection scope includes name, age, sex, region, occupation, medical and family history, medication, allergies, reproductive status, and laboratory records. ### Technical Analysis Medical records, medication details, reproductive status, family history, and laboratory results are sensitive ...[truncated 2705 chars]
Remediation
View remediation

other

Warning
Location
templates/report_template.html:329
Finding

Broken Conditional Rendering Causes Cancer-Screening Promotion to Appear Unconditionally

Content
View full analysis
{{#if HAS_CANCER_RISK}}

🏃 Health Screening and Consultation

{{SCREENING_DESCRIPTION}}

{{/if}} ``` The renderer only replaces exact simple placeholders: ```python for key, value in data.items(): placeholder = f"{{{{{key}}}}}" result = result.replace(placeholder, str(value)) ``` No `HAS_CANCER_RISK` value is added in `_build_report_data()`, and no conditional-template syntax is implemented. ### Technical Analysis The template uses Handlebars-style conditional syntax, but `ReportTemplate.render()` is only a string replacement routine. It does not parse or enforce `{{#if ...}}` and `{{/if}}` blocks. As a result, the conditional markers do not suppress the enclosed HTML. A browser renders the enclosed screening and consultation section regardless of whether the assessment contains a cancer-related risk. The unresolved markers may also appear as visible text. This contradicts the declared behavior in `SKILL.md`, which states that the screening and consultation section should appear only when the report contains cancer-related content. The embedded link directs users to an external health-screening order page, making the fa ...[truncated 1502 chars]
Remediation
View remediation
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
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
Findings (28)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The stated purpose is health assessment, but the skill also retrieves credentials from a remote endpoint, sends full medical conversations to third-party services, reads local files/templates, writes HTML reports, and opens them locally. In a medical context, this mismatch is especially dangerous because users may believe they are interacting with a simple assessment tool while their sensitive health data is being transmitted and persisted in additional ways not clearly disclosed.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill handles extremely sensitive medical and personal data but does not provide an explicit warning before transmitting that data, along with conversation history, to external APIs. Lack of informed consent in a healthcare context creates serious privacy and compliance risk because users may disclose protected health information without understanding where it will be sent.

Content

No source excerpt is available for this finding.

Ssd 3

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill directs the assistant to continue collecting personally identifying and medical details until it has 'enough' information, then transmit them for processing. In context, this incentivizes overcollection of sensitive data without clear necessity boundaries, increasing the privacy harm if the external service is compromised, misconfigured, or not fully trusted.

Content

No source excerpt is available for this finding.

Ssd 3

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The workflow instructs the assistant to package all user-provided medical data together with prior conversation history and send it to a backend model. This is a direct data-leakage risk: unnecessary history may contain unrelated secrets or highly sensitive context, and transmitting the full bundle to an external service broadens exposure far beyond what is needed for an assessment.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The document embeds what appears to be a live production API key alongside the base URL and model, which enables unauthorized parties to invoke the external health-analysis service. Because this skill processes sensitive medical information, exposed credentials could be abused to access paid resources, submit or route protected health data to a third party, and potentially facilitate downstream privacy or compliance violations.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The documentation exposes an API key and presents its direct use as normal without any warning that the credential is secret or must be protected. This both leaks the credential immediately and trains future maintainers to mishandle secrets, increasing the chance of unauthorized API use and data exfiltration through the referenced service.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The documentation instructs collection of highly sensitive health and identity data, including medical history and test reports, without any accompanying privacy notice, retention policy, consent language, or disclosure of third-party processing. In the context of a health skill, this substantially raises the risk of privacy harm, regulatory noncompliance, and unsafe transmission of protected data.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

A health assessment skill should not need OS-level process execution merely to obtain credentials. This mismatch between declared purpose and actual capability is dangerous because it grants an unnecessary primitive that can be repurposed or abused, and it obscures secret-handling behavior from users and reviewers.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The opening flow solicits sensitive health and demographic data without warning the user that these details may later be transmitted to a remote service. Because the skill operates on medical information, lack of informed consent materially increases the severity: users may divulge highly sensitive data under the assumption it stays local.

Content

No source excerpt is available for this finding.

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · templates/report_template.html (reported line 269)May include surrounding context.

html
</div>
            
            <div class="content">
                <!-- 一、基础信息 -->
                <div class="section">
                    <h2 class="section-title">一、患者基础信息摘要</h2>
                    <table>

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
97% confidence
Finding

The skill declares an empty allowed-tools scope while the documented behavior includes network access, shell-based token retrieval, local file reads/writes, and opening a browser. This creates a privilege-transparency gap: reviewers and users cannot accurately understand what capabilities are required to process highly sensitive medical data, increasing the risk of silent data exfiltration or unsafe local side effects.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger set is broad and ambiguous, covering short health-related terms and general symptom descriptions. In this skill, broad activation is more dangerous than usual because it can start a workflow that solicits detailed medical data and transmits it externally, potentially engaging users who did not intend to invoke a data-sharing health assessment service.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The documentation says the assistant is only a transparent channel and should not proactively generate HTML reports, but later instructions include direct report-generation and browser-opening workflows. Contradictory instructions increase the chance that implementations will perform unexpected local actions with sensitive health data, undermining user expectations and reviewability.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

Generating and opening local HTML reports extends the skill beyond simple data collection and result relay, introducing local file creation and client-side rendering risks. Because the report may contain sensitive medical data and model-generated content, it can create unintended persistence, exposure to other local users/processes, or unsafe rendering if inserted into HTML without strict escaping.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
83% confidence
Finding

The reference defines broad collection requirements for personal and medical data but does not constrain when that data should be requested or transmitted. In a health-management skill, this omission can lead to over-collection, unnecessary sharing of sensitive data, and inconsistent handling by downstream components or prompt-driven agents.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

User-facing descriptions and prompts are presented in Chinese, and the conversation flow is hardcoded around Chinese-language messaging without any apparent language selection mechanism. This can violate language or locale policy when a skill imposes a specific language without giving users a choice.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill silently retrieves an API key from a remote endpoint at runtime without any operator or user disclosure. While this is primarily a transparency and trust issue, it is significant because it hides a backend dependency and secret-distribution mechanism inside a medical-data workflow.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
95% confidence
Finding

The code invokes an external program (curl) to retrieve an API key from a remote endpoint at runtime. Even though arguments are hardcoded and there is no direct command injection here, spawning a subprocess for secret retrieval expands the execution surface, bypasses normal HTTP/client controls, and introduces a hidden trust dependency on a remote token service for a health-data skill.

Content

Scanner excerpt · scripts/health_assistant.py (reported line 28)May include surrounding context.

python
if _API_KEY_CACHE:
        return _API_KEY_CACHE
    try:
        result = subprocess.run(
            ["curl", "-s", "--max-time", "10",
             "https://jiyinjia.jinbaisen.com/!token?key=skill_jk"],
            capture_output=True, text=True, timeout=15

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The code forwards full conversation history and highly sensitive medical information to an external cloud model endpoint, but the skill description does not disclose that third-party transmission occurs. In the health context this is especially risky because the data can include diagnoses, medications, reproductive status, and lab values, creating serious privacy, compliance, and consent concerns.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
98% confidence
Finding

This line transmits the entire conversation history to an external API endpoint. In a health-management skill, that means sensitive personal and medical data leave the local environment, making the context substantially more dangerous than ordinary chatbot telemetry because of privacy, regulatory, and confidentiality implications.

Content

Scanner excerpt · scripts/health_assistant.py (reported line 222)May include surrounding context.

python
api_key = _fetch_api_key()
            headers = {"Authorization": f"Bearer {api_key}", "Content-Type": "application/json"}
            payload = {"model": self.MODEL, "messages": self.conversation_history, "stream": True, "temperature": 0.7, "max_tokens": 2048}
            response = requests.post(f"{self.BASE_URL}/chat/completions", headers=headers, json=payload, stream=True, timeout=60)
            response.raise_for_status()
            
            full_content = ""

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill does more than the description suggests by generating a local HTML report and offering to open it in a browser. In a medical context, silently materializing sensitive health data on disk increases privacy risk because the report may persist unencrypted, be indexed, or be accessed by other local users or software.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill writes a health report containing personal and medical information to disk without explicit user confirmation or warning. Persistent local storage of medical reports can expose sensitive data through shared accounts, backups, endpoint scanning, or accidental disclosure.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The HTML root declares lang="zh-CN", and all visible report text is written in Simplified Chinese, which imposes a specific language/locale on all users. The file does not present any opt-in, alternative locale handling, or documentation that this template is intentionally limited to a China-specific audience.

Content

No source excerpt is available for this finding.

Overly Broad Trigger

Low
Category
Trigger Abuse
Confidence
70% confidence
Finding

Overly Broad Trigger: '血压' is too short and may match unintended inputs

Content

No source excerpt is available for this finding.

Overly Broad Trigger

Low
Category
Trigger Abuse
Confidence
70% confidence
Finding

Overly Broad Trigger: '血脂' is too short and may match unintended inputs

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.