T09 · Insecure Skill Coding Practices
- Location
scripts/ai_hive_hotspot.py:23- Finding
Unrestricted API Base URL Can Expose the AI-HIVE Bearer Credential
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is mostly a planning helper for AI-HIVE workflows, but it can send an API key to an environment-controlled endpoint and advertises safeguards that the included code does not actually implement.
Install only if you intend to use AI-HIVE and can keep AI_HIVE_API_KEY confined to a trusted environment. Do not set AI_HIVE_BASE_URL unless you fully trust the endpoint, and treat the routing, pricing, identity-check, and task-ledger language as workflow guidance unless separate AI-HIVE tools actually perform those steps with your confirmation.
scripts/ai_hive_hotspot.py:23Unrestricted API Base URL Can Expose the AI-HIVE Bearer Credential
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
url += "?" + urllib.parse.urlencode({"modelType": args.type})
req = urllib.request.Request(url, headers={"Authorization": f"Bearer {key}", "Accept": "application/json"})
try:
with urllib.request.urlopen(req, timeout=30) as resp:
data = json.load(resp)
except Exception as exc:
raise SystemExit(f"模型查询失败:{exc}") from exc
The skill claims to verify model identity, query pricing snapshots, route by cost/speed/success, preserve task IDs, and produce comparative analysis, but the referenced workflow only shows lightweight plan generation and validation commands. This mismatch is dangerous because users may rely on nonexistent safeguards or verification steps, leading to incorrect trust decisions, accidental spend, or use of unverified model information in business workflows.
The skill includes executable command examples that rely on environment variables, local file I/O, and network access, but it does not declare any explicit tool scope or permission boundaries. In an agent environment, this can cause overbroad capability exposure and make it easier for the skill to access sensitive data or perform unintended external actions if the runtime grants default permissions.
The markdown states the skill is intended for '中文大模型用户' and frames the audience exclusively in Chinese-language terms. Under the policy, locale restrictions should either offer user choice or be clearly justified as region-specific; this file does not present it as an explicit opt-in or compliance-bound limitation.
The display name, description, and default prompt are all written to require operation in Chinese, with no indication that users may choose another language or locale. This is a natural-language policy issue because the skill appears to enforce a specific language experience rather than offering an explicit language option.
技能清单描述强调要通过 AI-HIVE 在运行时查询可用模型和价格快照,按成本/速度/成功率路由,并保存任务 ID 与结果。该文件实际仅提供 models 查询、plan 生成和 validate 校验:models 只访问 /models 接口,plan 只是把 routing 和 taskLedger 字段写入静态 JSON,validate 也仅检查字段合法性,没有执行真实路由、抓取价格快照、提交任务或保存结果。
manifest 将该技能定位为面向“牛来大模型”等热点搜索的身份核验、能力测试与工作流设计工具,并强调引用当前官方信息。此文件中的 plan/validate 仅生成通用计划 JSON 并做结构校验,models 也只是按关键字过滤模型列表,没有任何针对模型身份真伪、官方版本核验或能力测试执行/评估的实现。
The plan command performs a file write via Path(args.output).write_text(...) and then reports completion, but there is no prior confirmation prompt or explicit warning comment/docstring at the operation site about overwriting or creating a file. For a code file, file writes are in scope for missing user warnings when they lack disclosure.