T09 · Insecure Skill Coding Practices
- Location
scripts/core/expansion.py:22- Finding
Gateway bearer token and research data can be transmitted to an untrusted configurable endpoint in query expansion
- Content
View full analysis
str: try: url = f"{GATEWAY_URL.rstrip('/')}/v1/chat/completions" payload = { "model": "dashscope/qwen3.5-plus", "messages": [ { "role": "system", "content": "你是一个专业的学术搜索助手。你的任务是根据用户提供的原始查询和相关论文,生成 3-5 个语义相关的扩展搜索词。扩展词应该是:\n1. 与原查询相关但角度不同\n2. 具体、可搜索的学术术语\n3. 能够发现更多相关文献\n\n只返回扩展词列表,每行一个,格式:扩展词 | 置信度 (0.5-1.0)" }, { "role": "user", "content": prompt } ], "temperature": 0.5, "max_tokens": 300 } data = json.dumps(payload).encode("utf-8") headers = {"Content-Type": "application/json"} if GATEWAY_TOKEN: headers["Authorization"] = f"Bearer {GATEWAY_TOKEN}" req = urllib.request.Request(url, data=data, headers=headers, method="POST") with urllib.request.urlopen(req, timeout=30) as response: result = json.loads(response.read().decode("utf-8")) ``` ### Technical Analysis The gateway URL is taken from the `OPENCLAW_GATEWAY_URL` environment variable without validating its scheme, hostnam ...[truncated 2452 chars]- Remediation
View remediation
