T09 · Insecure Skill Coding Practices
- Location
scripts/qianlima_client.py:648- Finding
Configurable Model Endpoint Can Receive Sensitive Procurement and Contact Data
- Content
View full analysis
str: if not config.analysis_token: raise QianlimaError("缺少环境变量 ANTHROPIC_AUTH_TOKEN") prompt = """你是医疗招投标信息分析助手。只能依据输入数据,不要猜测。 请用中文 Markdown 输出: 1. 招标项目一句话结论 2. 招标需要什么:产品、服务、供应商资质、报名/投标要求、关键日期 3. 重点与难点:逐条说明,并给出依据 4. 单位信息:招标单位、代理单位及其他单位 5. 产品清单:逐项列出;若原文没有完整清单,明确说明缺失 6. 联系人信息:姓名、角色、电话、邮箱;对脱敏或缺失字段明确标注 7. 信息完整性审计:单位、产品、联系人、金额、截止时间、附件是否齐全 8. 建议下一步动作 输入数据: """ + json.dumps(cleaned, ensure_ascii=False) url = config.analysis_base_url.rstrip("/") + "/v1/messages" response = requests.post( url, headers={ "Authorization": f"Bearer {config.analysis_token}", "Content-Type": "application/json", }, json={ "model": config.analysis_model, "max_tokens": 128000, "messages": [{"role": "user", "content": prompt}], }, timeout=180, ) response.raise_for_status() ``` ```python analysis_base_url=os.environ.get( "ANTHROPIC_BASE_URL", "https://api.minimaxi.com/anthropic" ), analysis_token=os.environ.get("ANTHROPIC_AUTH_TOKEN", "").strip(), ``` ### Technical Analysis The optional analysis feature serializes the complete `cleaned` detail object into a model prompt. That object can contain procurement text, contact information, source metadata, and text extracted from downloaded attachments. The destination is derived directly from the environment-controlled `ANTHROPIC_BASE_URL`. The implementation does not require HTTPS, restrict the hostname to approved model providers, or obtain explicit confirmation before transmitting contacts and attachment contents. The model API token is also placed in the `Authorization` header ...[truncated 1418 chars]- Remediation
View remediation
