T09 · Insecure Skill Coding Practices
- Location
scripts/main.py:315- Finding
Unrestricted Output Path Allows Arbitrary Writable-File Overwrite
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill has a coherent discharge-summary purpose, but it can overwrite arbitrary writable files and can let untrusted patient text alter the generated clinical document.
Install only if you will run it in a sandbox or dedicated workspace, review every generated summary with a qualified clinician, avoid passing untrusted patient text directly into the generator, and constrain output paths so the script cannot overwrite unrelated files. Treat the language setting as unreliable until English rendering or explicit locale handling is fixed.
scripts/main.py:315Unrestricted Output Path Allows Arbitrary Writable-File Overwrite
scripts/main.py:42Unescaped Patient Data Permits Markdown and Raw HTML Content Injection
The skill documents file read/write behavior via a local Python script but does not declare any explicit tool scope such as permissions or allowed-tools. In a clinical context handling PHI, undeclared filesystem capability increases the risk of unintended access to sensitive files, path misuse, and weaker policy enforcement by the hosting agent platform.
The trigger description is broad enough to activate on general clinical documentation requests, not just discharge summaries. Over-broad routing can cause the wrong skill to process requests containing sensitive patient data, leading to inappropriate document generation, data mixing, or use outside the intended clinical workflow.
Defaulting output language to Chinese without explicit user selection can generate discharge instructions in a language the clinician or patient did not request. In medical discharge documentation, this creates patient-safety and compliance risk because medication instructions, follow-up plans, and warning signs may be misunderstood or unusable.
This JSON reference file contains user-facing natural-language medical content exclusively in Chinese, including instructions and warning signs. Because the file does not document that the skill is region-specific or that users can opt into this language, it may violate the policy against forcing a specific language without user choice.
This JSON maps medical terms to Chinese text throughout the file, effectively enforcing a specific language/locale in the skill data. The file does not indicate that Chinese localization is optional, user-selected, or limited to a justified region-specific use case.
This markdown file contains natural-language guidance and sample content written in Chinese, but it does not state that language selection depends on user preference or context. Because SQP-3 applies to all file types and covers forced language/locale behavior, these examples may imply a default output language without opt-in.
The CLI explicitly offers --language choices of zh and en at L280-L285, but generate_structured_output hardcodes 'zh' and generate_summary itself does not vary output by the language parameter. This creates a natural-language policy issue because the skill appears to offer language choice while effectively enforcing Chinese output regardless of user preference.
The document title is fixed as "出院小结 / DISCHARGE SUMMARY," and many section labels throughout the template are presented in Chinese alongside English without any indication that language selection is optional. This can be a natural-language locale policy issue because the template appears to prescribe a specific bilingual format rather than allowing user or organizational language preference.
No suspicious patterns detected.