T09 · Insecure Skill Coding Practices
- Location
scripts/run.py:145- Finding
Medical Reports Are Transmitted to an External LLM Without De-identification
- Content
View full analysis
str: suffix = path.suffix.lower() if suffix == ".json": with path.open(encoding=encoding) as f: data = json.load(f) if isinstance(data, str): return data if isinstance(data, dict): for key in ("text", "content", "record", "input", "report"): v = data.get(key) if isinstance(v, str) and v.strip(): return v return json.dumps(data, ensure_ascii=False, indent=2) raise ValueError("JSON input must be a string or an object containing a supported report field.") return path.read_text(encoding=encoding) ``` ```python def run_recheck_reminder(report_text: str, llm, output_path: str = "") -> int: prompt = f"""Please generate a re-examination reminder list based on the following medical examination report. [Medical Examination Report] {report_text.strip()} Please strictly follow the required JSON and reminder output format.""" print("Generating re-examination reminder...") result = llm([sys_msg(SYSTEM_PROMPT), user_msg(prompt)]) ``` The original source contains Chinese user-facing prompt text; the material security behavior shown above is a direct English rendering of that prompt. The executable data flow is unchanged: `report_text.strip()` is interpolated verbatim. ```python def _http_post(url: str, payload: Dict[str, Any], headers: Dict[str, str], *, timeout: int = 0) -> Any: data = json.dumps(payload, ensure_ascii=False).encode("utf-8") req = urllib.request.Request( url=url, data=data, method="POST", headers={"Content-Type": "application/json", **headers}, ...[truncated 2482 chars]- Remediation
View remediation
