T09 · Insecure Skill Coding Practices
- Location
scripts/run.py:47- Finding
Unrestricted LLM Endpoint Can Expose Medical Reports and Bearer Credentials
- Content
View full analysis
str: payload = {"model": model, "messages": messages, "temperature": 0} resp = _http_post(url, payload, headers, timeout=timeout) ``` The endpoint is exposed as an unrestricted command-line argument: ```python parser.add_argument("--base", default=DEFAULT_LLM_BASE, help=f"内部大模型 base URL(默认:{DEFAULT_LLM_BASE})。") parser.add_argument("--model", default=DEFAULT_LLM_MODEL, help="模型名称(默认:{DEFAULT_LLM_MODEL})。") parser.add_argument("--timeout", type=int, default=0, help="HTTP 超时秒数;0 表示一直等待(默认:0)。") ``` It is then used without validation: ```python llm = make_llm_caller(args.appkey, args.base, args.model, args.timeout) ``` ### Technical Analysis The `--base` option accepts an arbitrary URL. The code does not require HTTPS, verify that the hostname belongs to the intended medical service, or apply an endpoint allowlist. The resulting endpoint receives both: 1. The API key in an `Authorization: Bearer` header. 2. The complete health report in the LLM request body. A malicious or mistakenly configured endpoint can therefore collect both the credential and sensitive medical information. If an HTTP URL is supplied, network intermediaries may also intercept or modify the request. The documentation claims that input should be strictly de-identified, but the implementation performs no redaction or validation before transmitting the report. The default endpoint is consistent ...[truncated 1058 chars]- Remediation
View remediation
