T09 · Insecure Skill Coding Practices
- Location
scripts/run.py:143- Finding
Medical reports are transmitted without the documented de-identification
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:31-34,scripts/run.py:143-149
Vulnerability Type: Privacy control omission and transmission of sensitive medical information
Risk Level: HighThe documentation states that identifiable information will be strictly de-identified before processing:
markdown - **最小必要原则**:仅处理解读所必需的检查结果;不要求包含患者姓名等身份信息。 - **严格脱敏**:发送前对可识别身份信息进行脱敏处理。 - **不做本地持久化**:仅在内存中短暂处理;**本次调用结束即销毁**。However, the implementation inserts the complete report into an LLM request without applying redaction:
python def run_lab_interpret(lab_report: str, llm, output_path: str = "") -> int: prompt = f"""请对以下检查报告进行辅助解读。 【检查报告】 {lab_report.strip()} 请严格按照要求输出 JSON + 摘要。""" print("正在解读检查报告...") result = llm([sys_msg(SYSTEM_PROMPT), user_msg(prompt)])Technical Analysis
load_inputcan accept arbitrary report text, including names, patient identifiers, contact details, demographics, and clinical history.run_lab_interpretthen copies that input verbatim into the outbound model prompt. No function detects, removes, masks, or rejects identifying data.This behavior conflicts with the documented claim that identifiable information is strictly de-identified before transmission. Merely advising users not to provide identifying information is not equivalent to enforcing de-identification.
Attack Path
- A user supplies a laboratory report containing patient identifiers or other protected medical information.
load_inputreads and returns the report without modification.run_lab_interpretinterpolates the complete report intoprompt.- The
llmclosure passes the prompt to_http_post. - The report is transmitted to the configured remote model endpoint.
- The remote service consequently receives both the clinical information and any identifiers present in the source report.
Impact Assessment
The remote endpoint can receive ...[truncated 490 chars]
- Remediation
View remediation
Remediation Suggestions
- Add a local de-identification stage before constructing any network request.
- Detect and redact common direct identifiers, including names, identification numbers, medical-record numbers, telephone numbers, addresses, email addresses, and account identifiers.
- Reject or require explicit confirmation for reports that still appear to contain identifiable information.
- Present the exact destination and categories of transmitted data before processing.
- Minimize outbound data by extracting only clinically necessary measurements and context.
- Add automated tests demonstrating that representative identifiers are removed before
_http_postis called. - Update
SKILL.mdif de-identification cannot be reliably implemented; the documentation must accurately state that users are responsible for redaction. - Establish appropriate retention, access-control, and data-processing requirements for the receiving model service.
