Back to skill

Security audit

unisound-abnormal-indicator-alert

Security checks for vulnerabilities and agentic risk

Overview

This health alert skill discloses much of its medical-file processing, but it also sends sensitive health data to a model service and has an unsafe fallback that can run unreviewed local code.

Review this carefully before installing. Use it only if users are allowed to send medical indicator data to the listed model provider, local document/OCR tools are sandboxed, and the external shared-preprocessor fallback is removed or pinned to trusted code. For patient-facing use, require consent, minimize or redact inputs, and validate generated medical text against approved rules.

Vulnerability Patterns
  • Tool Hijacking and SpoofingModifies or replaces tools so legitimate-looking calls execute attacker logic
  • 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
Findings (4)

T07 · Tool Hijacking and Spoofing

Error
Location
scripts/run.py:220
Finding

Unverified External Python Module Execution During Preprocessing Fallback

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/run.py:88
Finding

Prompt Injection Through Unvalidated Medical Input Fields

Content
View full analysis
Dict[str, Any]: indicator_type = data.get("indicator_type", "") value = data.get("value", 0) unit = data.get("unit", "") measured_at = data.get("measured_at", "") threshold_profile = data.get("threshold_profile", {}) check_result = _check_abnormal(float(value), threshold_profile) indicator_name = INDICATOR_NAMES.get(indicator_type, indicator_type) user_prompt = f"""Analyze the following indicator: Indicator type: {indicator_name} ({indicator_type}) Current value: {value} {unit} Measurement time: {measured_at} Threshold configuration: {json.dumps(threshold_profile, ensure_ascii=False)} Abnormality result: {json.dumps(check_result, ensure_ascii=False)} Provide a Markdown table containing the indicator name, current value, normal range, abnormality level, at least two or three possible causes, and recommendations.""" text = _call_llm(SYSTEM_PROMPT, user_prompt, appkey) ``` The natural-language prompt has been translated into English while retaining the source interpolation structure and requested behavior. ### Technical Analysis The fields `indicator_type`, `unit`, and `measured_at` originate from input files and are interpolated directly into an instruction-bearing prompt. Unknown `indicator_type` values are also used directly as the display name: ```python indicator_name = INDICATOR_NAMES.get(indicator_type, indicator_type) ``` There are no allowlists, length limits, control-character restrictions, or semantic validation for these string fields. The model therefore receives attacker-controlled text in the same message and instruction context as the legitimate analysis request. An attacker can insert content such as instructions to disregard the requested ...[truncated 1697 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/run.py:24
Finding

Sensitive Health Data Is Transmitted to an External Model Service Without Data-Minimization Controls

Content
View full analysis
str: payload = {"model": MODEL, "temperature": 0.0, "messages": [ {"role": "system", "content": system_prompt}, {"role": "user", "content": user_prompt}]} try: req = Request(API_URL, data=json.dumps(payload, ensure_ascii=False).encode("utf-8"), headers={"Content-Type": "application/json", "Authorization": f"Bearer {appkey}"}) resp = urlopen(req, timeout=120) return json.loads(resp.read().decode("utf-8"))["choices"][0]["message"]["content"] except HTTPError as exc: raise RuntimeError(f"API HTTP {exc.code}") except URLError as exc: raise RuntimeError(f"API unreachable: {exc.reason}") ``` The associated prompt construction transmits these values: ```python indicator_type = data.get("indicator_type", "") value = data.get("value", 0) unit = data.get("unit", "") measured_at = data.get("measured_at", "") threshold_profile = data.get("threshold_profile", {}) ``` ### Technical Analysis The skill sends the complete model prompt to `https://maas-api.hivoice.cn/v1/chat/completions`. That prompt contains health-indicator type, measured value, unit, measurement time, caller-provided thresholds, and the locally calculated abnormality result. The endpoint is documented and HTTPS is used, so the behavior is not covert exfiltration and the data is encrypted in transit. However, the implementation provides no technical controls for: - Explicit consent before external processing. - Data minimization or pseudonymization. - Removal of unnecessary timestamps. - Detection and redaction of identifiers embedded in string fields. - A local-only execution mode. - Configurable endpoint trust policy. - Retention, residen ...[truncated 1576 chars]
Remediation
View remediation

other

Warning
Location
scripts/run.py:60
Finding

Model-Generated Medical Claims Exceed the Documented Rule-Only Safety Boundary

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
Findings (16)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared purpose is narrow abnormal-indicator alerting, but the documented behavior expands into broad document ingestion, OCR, PDF parsing, and Office conversion. That mismatch matters because users may provide highly sensitive medical files believing the skill only processes structured indicators, while the implementation appears capable of extracting and transmitting far more data than expected.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill explicitly sends medical data to an external/internal model API endpoint for analysis but does not provide a clear user-facing warning or consent notice. Because the inputs may include patient health information from documents, images, and spreadsheets, undisclosed transmission creates significant privacy, compliance, and trust risks.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file implements a broad multi-format ingestion and extraction utility that is not closely aligned with a chronic-disease abnormal indicator alert skill. This capability expansion increases the attack surface substantially by accepting many risky file formats and external-processing paths without a clear medical-alerting need, making abuse or accidental overcollection more likely.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill includes subprocess-driven OCR and office/PDF conversion on user-provided files despite its stated purpose not obviously requiring such broad document-processing capability. In context, this mismatch is dangerous because it introduces high-risk external parsers and data extraction features that expand both exploitability and privacy exposure beyond what a medical alerting skill should minimally need.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding

The skill advertises capabilities that include file access, shell use, environment access, and network calls, but it does not declare any explicit tool scope or permission boundaries. In a health-data workflow, this creates unnecessary ambiguity about what the skill may access or transmit, increasing the risk of over-privileged execution and unintended exposure of sensitive patient data.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
74% confidence
Finding

The entire skill description and examples are written for Chinese usage, and the OCR/tooling section explicitly requires chi_sim+eng, suggesting a built-in Chinese locale assumption. The file does not offer a language/locale choice or explain that the skill is intentionally limited to a specific region or language context.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
80% confidence
Finding

This code runs LibreOffice on user-supplied office documents for conversion. Although it avoids shell injection, invoking complex document parsers on untrusted files materially increases attack surface and can lead to parser-triggered code execution, sandbox escapes, or denial of service if the external tool has vulnerabilities.

Content

Scanner excerpt · scripts/preprocess.py (reported line 111)May include surrounding context.

python
if not office_bin:
        raise PreprocessError("libreoffice/soffice not found for office document conversion.")
    with tempfile.TemporaryDirectory(prefix="med-skill-preprocess-") as tmp_dir:
        proc = subprocess.run(
            [office_bin, "--headless", "--convert-to", "txt:Text", "--outdir", tmp_dir, str(path)],
            stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, check=False,
        )

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The file invokes external tools such as LibreOffice/soffice, pdftotext, and tesseract to process user-provided documents and images. While this is functionally related to preprocessing, there is no confirmation prompt, user-facing log, or warning in the code indicating that local binaries will be executed against the supplied files.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
80% confidence
Finding

This subprocess executes LibreOffice against user-controlled .xls input, which exposes the service to vulnerabilities in a large external parser stack. The risk is not shell injection but unsafe processing of attacker-crafted files that may trigger remote code execution or resource exhaustion in the converter.

Content

Scanner excerpt · scripts/preprocess.py (reported line 126)May include surrounding context.

python
if not office_bin:
        raise PreprocessError("libreoffice/soffice not found for xls conversion.")
    with tempfile.TemporaryDirectory(prefix="med-skill-preprocess-") as tmp_dir:
        proc = subprocess.run(
            [office_bin, "--headless",
             "--convert-to", "csv:Text - txt - csv (StarCalc):44,34,76,1",
             "--outdir", tmp_dir, str(path)],

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

This call sends untrusted PDFs to an external text-extraction utility. As with other parser subprocesses, the main risk is exploitation of vulnerabilities in the PDF toolchain or denial of service from maliciously crafted PDFs, not command injection.

Content

Scanner excerpt · scripts/preprocess.py (reported line 153)May include surrounding context.

python
pass
    pdf_to_text = shutil_which("pdftotext")
    if pdf_to_text:
        proc = subprocess.run(
            [pdf_to_text, "-layout", str(path), "-"],
            stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, check=False,
        )

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The code automatically prefers the locale combination "chi_sim+eng" when those Tesseract models are available, rather than letting the user choose OCR language settings. This imposes a specific language/locale behavior without documented user choice or clear region-specific justification.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/preprocess.py (reported line 171)May include surrounding context.

python
cmd = [tesseract_bin, str(path), "stdout"]
    if lang_arg:
        cmd.extend(["-l", lang_arg])
    proc = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, check=False)
    if proc.returncode != 0 or not proc.stdout.strip():
        raise PreprocessError(f"Image OCR failed: {proc.stderr.strip() or 'no text returned'}")
    return proc.stdout

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/preprocess.py (reported line 178)May include surrounding context.

python
def detect_tesseract_langs(tesseract_bin: str) -> Sequence[str]:
    proc = subprocess.run(
        [tesseract_bin, "--list-langs"],
        stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, check=False,
    )

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The system prompt instructs the model entirely in Chinese, and the skill description and output expectations are also Chinese-specific. This forces a specific language/locale behavior without any opt-in, selection mechanism, or documented region-specific justification.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill directly interpolates untrusted, user-supplied medical fields into an external LLM prompt and then returns the model output, which can disclose sensitive health data in transformed or expanded form. Because this is a healthcare skill, prompt injection and privacy leakage are more dangerous: malicious or malformed input can manipulate the generated medical summary, while sensitive clinical details are exposed to a third-party model service.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The code sends patient medical indicator data, timestamps, threshold profiles, and derived abnormality assessments to an external LLM API via _call_llm without any consent gate, minimization, anonymization, or disclosure in the execution path. In a medical-monitoring skill, this is especially sensitive because the data can reveal health conditions and treatment context, creating privacy, compliance, and third-party retention risks.

Content

No source excerpt is available for this finding.