Back to skill

Security audit

unisound-chief-complaint-diagnosis-inconsistent

Security checks for vulnerabilities and agentic risk

Overview

The skill is coherent for medical-record quality checks, but it handles sensitive medical text and credentials with under-scoped network and persistence controls.

Review this skill before installing in any clinical or regulated environment. Use only de-identified records, restrict the LLM endpoint to an approved HTTPS host, avoid --save-prepared unless local plaintext storage is approved, and treat results as assistant QC output requiring clinician review.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/emr_qc_impl.py:58
Finding

Unrestricted LLM Endpoint Can Exfiltrate API Credentials and Medical Records

Content
View full analysis
str: payload = {"model": model, "messages": messages, "temperature": 0} resp = _http_post(url, payload, headers, timeout=timeout) ``` The endpoint is exposed through an unrestricted command-line argument: ```python parser.add_argument( "--base", default=DEFAULT_LLM_BASE, help=f"LLM base URL (default: {DEFAULT_LLM_BASE}).", ) ``` ### Technical Analysis The `--base` parameter accepts an arbitrary URL. The application appends `/chat/completions` and sends both of the following to that destination: - The application key in the `Authorization: Bearer` header. - EMR-derived content in the request payload. No destination hostname allowlist is applied. The implementation also does not explicitly reject plaintext HTTP URLs, embedded URL credentials, loopback destinations, private network addresses, or redirects to untrusted destinations. Although custom endpoint support may be intentional, using the same sensitive application credential for every caller-selected destination crosses a security boundary. Any party capable of influencing the command-line invocation or wrapper configuration can redirect credentials and medical data to infrastructure under its control. ### Attack Path 1. An attacker gains influence over the Skill invocation, a wrapper script, job configuration, or copied command. 2. The attacker supplies a destination ...[truncated 1214 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/emr_qc_impl.py:130
Finding

Medical Record Content Can Inject Instructions into LLM Quality-Control Prompts

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/run.py:102
Finding

Optional Debug Mode Persists Complete Medical Records in Plaintext

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
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (9)

Missing User Warnings

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

This skill sends chief complaint and diagnosis data derived from outpatient medical records to an external LLM service endpoint, which can expose sensitive health information to a third party. In a medical context, transmitting record content off-box without explicit disclosure, minimization, or consent creates serious confidentiality and compliance risk even if the endpoint is nominally 'internal' or trusted.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding

The skill documentation declares no explicit tool scope or permission boundaries, yet the skill clearly supports file reading, file writing, and outbound network access via local file inputs, output file generation, and calls to an external MaaS endpoint. Without an allowlist or declared restrictions, a hosting agent may grant broader capabilities than intended, increasing the risk of unauthorized data access or exfiltration, especially because the input is medical record content.

Content

No source excerpt is available for this finding.

Ssd 1

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

User-controlled medical text is interpolated directly into prompts that instruct the model to follow formatting rules, so crafted record content can semantically override or confuse the classifier. This can cause the model to emit incorrect safety-critical QC judgments, which is especially concerning in a medical quality-control skill where downstream users may rely on the result.

Content

No source excerpt is available for this finding.

Ssd 1

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The final decision prompt embeds raw chief complaint and diagnosis text into a single free-form instruction, allowing crafted input to manipulate the model's reasoning or output format. Because this stage produces the ultimate defect/no-defect decision and rationale, prompt injection here can directly corrupt clinical QC outcomes and reduce trustworthiness of the tool.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The manifest describes a text-in/text-out QC capability: given outpatient record text, call an internal medical LLM and output whether there is a defect and why. In addition to producing that result, the code creates directories and persists the result to ../runs/med-emr-qc or a caller-supplied path, which is a broader behavior than the stated description.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The QC result is written to disk by default without clear disclosure, creating unintended persistence of potentially sensitive medical assessment output. In healthcare workflows, even derived results can contain patient-linked clinical information, increasing the risk of local data exposure, retention beyond policy, or collection by other processes/users on the host.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

When --save-prepared is used, the script writes preprocessed medical text directly to disk without any warning about storing sensitive health information locally. This can expose PHI through insecure local files, backups, shared directories, or later forensic recovery, especially in multi-user or managed environments.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script sends outpatient medical record text to an LLM service via run_qc without any explicit consent prompt, masking, or user-facing warning that sensitive health data will be transmitted off-process or potentially off-host. In a medical QC skill, this creates a real privacy and compliance risk because the input can contain protected health information and the base URL is even user-configurable, increasing the chance of disclosure to an unintended endpoint.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

This code file contains user-facing natural-language strings entirely in Chinese, including the module docstring and CLI help text. Under the policy for natural-language violations, forcing a specific language without user opt-in can be a locale/language policy issue when no alternative language choice is offered.

Content

No source excerpt is available for this finding.