Back to skill

Security audit

Clinical Case Writer

Security checks for vulnerabilities and agentic risk

Overview

This clinical writing skill is mostly purpose-aligned, but it handles sensitive patient records without enough privacy guardrails and includes identifiable-looking patient details in examples.

Review before installing. Use only de-identified or properly authorized patient material, avoid real patient names in prompts and output filenames, and confirm where generated documents will be stored. The publisher should bundle referenced knowledge files inside the package and add explicit privacy, consent, retention, and external-search safeguards before this is treated as low-risk.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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 (2)

T09 · Insecure Skill Coding Practices

Warning
Location
README.md:77
Finding
Identifiable Patient Health Information Embedded in Documentation## Vulnerability Details **File Location**: `README.md:77-86`; related occurrence in `examples.md:78-83` **Vulnerability Type**: Plaintext exposure of identifiable health information **Risk Level**: Medium ### Vulnerable Content ```text **Input:** ``` 患者:王萃华 性别:女性 年龄:64岁 主诉:反复胸闷、气促3年,加重2周 诊断:扩张型心肌病、心力衰竭、心功能IV级 ``` **Output:** - Markdown文件:`临床案例_王萃华_扩张型心肌病心力衰竭诊疗体会.md` - Word文档:`临床案例_王萃华_扩张型心肌病心力衰竭诊疗体会.docx` ``` The same documentation later states: ```text 7. **患者姓名脱敏**:**文档名称和正文中都不能出现患者真实姓名**,使用"患者"或"本例"代替 ``` ### Technical Analysis The documentation associates a full personal name with age, sex, symptoms, diagnoses, and treatment-related information. It also demonstrates incorporating that name into output filenames. This is inconsistent with the project's own requirement that patient names must not appear in either document content or filenames. The repository does not establish that the identity is fictional or provide provenance showing that publication was authorized. Consequently, the content must be treated as potentially identifiable health information. Embedding such data in distributed documentation creates a direct disclosure risk without requiring execution of the Python script. The bundled script also does not implement de-identification or scan the input Markdown and output filename for patient identifiers. Its local conversion behavior therefore does not enforce the privacy requirement documented by the project. ### Attack Path 1. An unauthorized party obtains or browses the distributed Skill package. 2. The party opens `README.md` or `examples.md`. 3. The party extracts the displayed full name and its associated demographic and clinical details. 4. The party correlates those details with public, institutional, or other available records. 5. Users may additionally copy the documented filename convention, causing patient names to appear in filesystem metadata, backups, document ...[truncated 754 chars]
Remediation
## Remediation Suggestions 1. Replace the full name with an unmistakably synthetic identifier, such as `Example Patient A`, and explicitly label all sample records as fictional. 2. Remove personal names from every example filename. Use a pattern such as `clinical_case_anonymized_dilated_cardiomyopathy.docx`. 3. Review the entire repository history and released packages for previous copies of the identifying content. If the data is genuine, follow the applicable incident-response and disclosure procedures. 4. Add an enforced de-identification stage before document generation. It should detect names and other direct identifiers in both Markdown content and output filenames. 5. Require users to confirm de-identification before processing clinical records, and fail closed when obvious identifiers are detected. 6. Add automated tests that reject sample records or output paths containing known patient identifiers. 7. Keep documentation consistent with the stated privacy rule by ensuring that no example encourages names in document content or filesystem metadata.

T05 · Unauthorized Access and Privilege Escalation

Note
Location
skill.json:19
Finding
External Knowledge Paths Cross the Skill Package Boundary## Vulnerability Details **File Location**: `skill.json:19-23` **Vulnerability Type**: Package-boundary traversal to externally mutable knowledge files **Risk Level**: Low ### Vulnerable Content ```json "knowledge": [ "../../memory/knowledge/临床案例写作规范.md", "../../memory/knowledge/临床案例写作规范_快速参考.md", "../../memory/knowledge/参考文献引用规则.md", "../../memory/knowledge/Word文档生成规则_临床案例.md" ], ``` Related documentation instructs the Skill to read these resources: ```text 1. SKILL读取规范文档 ``` ### Technical Analysis Each declared knowledge path begins with `../../`, resolving outside the audited Skill directory into a host-level `memory/knowledge` hierarchy. The referenced files are absent from the provided project, so their contents and integrity could not be audited with the Skill package. This creates an external trust boundary: the behavior of the installed Skill may depend on files that can be changed independently after package review. If the runtime automatically loads the declared knowledge files as agent instructions or trusted context, a party able to modify the external directory could influence future Skill behavior without modifying the reviewed package. The finding does not demonstrate operating-system privilege escalation or arbitrary code execution. Its security relevance is limited to potential access beyond the package boundary and the behavioral authority granted to unaudited external content. ### Attack Path 1. The Skill is installed in an environment where the relative paths resolve to a shared or host-managed `memory/knowledge` directory. 2. A local user, another Skill, or a compromised process with write access modifies one of the referenced Markdown files. 3. A user invokes the clinical-case-writing Skill. 4. The host resolves the traversal paths and loads the modified external content. 5. If that content is treated as trusted instructions, it can alter report-generation behavior or dir ...[truncated 850 chars]
Remediation
## Remediation Suggestions 1. Bundle every required knowledge document inside the Skill package and reference it using package-relative paths without `..` components. 2. Canonicalize each configured path before loading it and verify that the resolved path remains beneath the approved package root. 3. Reject absolute paths, symbolic-link escapes, and relative traversal outside the package boundary. 4. Treat loaded Markdown as untrusted reference data rather than privileged instructions capable of overriding system or user constraints. 5. Pin or hash knowledge files so that post-review modifications are detectable. 6. Apply restrictive filesystem permissions to shared knowledge directories when external resources are operationally necessary. 7. Include all behavior-affecting resources in security review and package manifests so the reviewed artifact is self-contained and reproducible.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • 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)

Missing User Warnings

High
Confidence
96% confidence
Finding
The README advertises extracting information from patient medical records and generating output documents, but it does not provide an explicit warning about handling regulated health data, consent, retention, storage location, or de-identification before processing. Given the clinical context, this omission is dangerous because users may provide real medical records and the skill may create persistent files containing sensitive data without clear safeguards.

Intent-Code Divergence

High
Confidence
98% confidence
Finding
The README includes an example using a full patient name and repeats that name in example output filenames, directly contradicting the stated de-identification requirement. In a clinical-document generation skill, embedding realistic PHI in documentation normalizes unsafe handling and can lead users or downstream automation to expose protected health information in generated content or stored files.

Missing User Warnings

High
Confidence
98% confidence
Finding
The skill is designed to ingest patient records and query external services such as CNKI and PubMed, yet it provides no explicit privacy notice, consent requirement, or restriction on sending identifiable clinical data outside the local environment. Because the content concerns protected health information, this omission materially raises the risk of privacy violations, regulatory noncompliance, and inappropriate disclosure.

Vague Triggers

Medium
Confidence
88% confidence
Finding
The activation phrases are very broad and can be triggered by generic language like “撰写临床案例” or “检查临床案例参考文献是否符合规范,” without requiring explicit user confirmation, scoped inputs, or privacy safeguards. In a skill that processes medical records and writes files, loose triggers increase the chance of accidental invocation on sensitive data or unintended document generation/validation actions.

Natural-Language Policy Violations

Medium
Confidence
88% confidence
Finding
The skill title and description require producing a clinical case report compliant with GB/T 7713.2-2022 and all examples and formatting requirements are fixed to Chinese conventions, with no option for the user to select another language or locale. This is a natural-language policy concern because the skill appears to force a specific language/locale without opt-in.

Vague Triggers

Medium
Confidence
92% confidence
Finding
The activation phrases are broad enough that a user can trigger the skill with minimal context, causing it to process clinical records and perform downstream actions like literature retrieval and document generation without clear confirmation of scope. In a medical-record workflow, weak triggering increases the chance of accidental handling of sensitive data or unintended external transmission.

Natural-Language Policy Violations

Medium
Confidence
81% confidence
Finding
All invocation examples, instructions, outputs, and FAQ content are written exclusively in Chinese, and the workflow assumes Chinese-language journal sources and formatting conventions. There is no indication that the user may choose another language or that the Chinese-only constraint is an explicitly documented region-specific requirement.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The example includes identifiable patient data and describes reading patient records and generating output files without any warning about privacy, consent, de-identification, retention, or secure storage. In a clinical documentation skill, this omission can normalize unsafe handling of protected health information and increase the risk of accidental disclosure through prompts, logs, or generated files.

Natural-Language Policy Violations

Medium
Confidence
88% confidence
Finding
The description is entirely in Chinese and specifies output aligned to a Chinese national standard, but the manifest does not state that this is a China-specific skill or that the user can opt into another language or locale. This may violate language/locale policy when a skill implicitly enforces one language without explicit user choice or documented regional limitation.

Vague Triggers

Medium
Confidence
91% confidence
Finding
The usage section lists generic phrases such as “撰写临床案例” and “检查临床案例参考文献是否符合规范” without specifying required context, input constraints, or exclusion conditions. In a manifest file, this can make activation ambiguous and increase the chance of unintended invocation from ordinary related requests.

Natural-Language Policy Violations

Low
Confidence
96% confidence
Finding
The module docstring, usage instructions, and visible CLI messages are all presented only in Chinese, which imposes a specific language on users without any documented opt-in or alternative. The policy explicitly calls out language or locale constraints as violations when they are forced rather than offered as a choice.

Static analysis

No suspicious patterns detected.