cn-llm-router
核心功能安全的 LLM 路由工具,存在 2 处轻微瑕疵:calibrate.py 中受控的 eval() 使用(测试代码)和文档未提及的阴影功能。整体无恶意行为,密钥管理规范。
Why this conclusion was reached
0/4 dimensions flaggedDeclared resources and inferred behavior are broadly aligned.
15 lower-risk artifacts were extracted and still need context.
There is no explicit malicious chain in the report.
Dependencies are present but no obvious high-risk issue stands out.
What drove the risk score up
_core/calibrate.py:97,113 调用 eval(case['check'])(response),但 check 来自预定义测试用例(非外部输入),风险受控
calibrate.py(能力实测校准器)未在 SKILL.md 声明,文档-行为存在小差异
Most important evidence
calibrate.py 使用 eval() 执行测试检查逻辑
_core/calibrate.py 第 97 和 113 行存在 eval(case['check'])(response) 调用。check 来自预定义的 CLASSIFICATION_CASES/CODE_CASES/LONG_CASES(非外部输入),但 eval() 本身存在理论风险。
_core/calibrate.py:97,113 SKILL.md 未声明 calibrate.py 校准工具
v2.5.0 新增的 calibrate.py(能力实测校准器)是阴影功能,SKILL.md 未提及。这是开发工具而非核心功能,但应补充说明。
_core/calibrate.py:1 缓存/SQLite 文件存储在用户主目录
cache.db 和 calls.db 默认存储在 ~/.cn_llm_router/ 目录,包含用户 query 和模型响应(无密钥)。SKILL.md 已声明,数据本地存储不外传。
scripts/cache.py:16 Declared capability vs actual capability
urllib.request.urlopen 调用各厂商官方 API cache.py/cost_tracker.py 写入本地 SQLite,report.py 导出 HTML config.py:get_key() 仅读取环境变量读取 API Key 无 subprocess/os.system 调用 Suspicious artifacts and egress
https://skillhub.cn/skill/cn-llm-router SKILL.md:364
https://qianfan.baidubce.com/v2 _core/adapters/ernie.py:12
https://aip.baidubce.com/oauth/2.0/token?grant_type=client_credentials _core/adapters/ernie.py:70
https://api.deepseek.com references/models.yaml:21
https://dashscope.aliyuncs.com/compatible-mode/v1 references/models.yaml:45
https://open.bigmodel.cn/api/paas/v4 references/models.yaml:84
https://api.moonshot.cn/v1 references/models.yaml:115
https://api.hunyuan.cloud.tencent.com/v1 references/models.yaml:146
https://ark.cn-beijing.volces.com/api/v3 references/models.yaml:185
https://aip.baidubce.com/rpc/2.0/ai_custom/v1/wenxinworkshop/chat/completions_pro references/models.yaml:208
https://api.minimax.chat/v1 references/models.yaml:248
https://api.lingyiwanwu.com/v1 references/models.yaml:271
Dependencies and supply chain
| Package | Version | Source | Known vuln | Notes |
|---|---|---|---|---|
| websocket-client | 可选(不装不影响功能) | pip | No | 仅讯飞星火 WebSocket 传输用,不装时其余 11 家完全正常 |
| sentence-transformers | 可选(模糊缓存增强) | pip | No | 模糊缓存可选依赖,未安装时降级为 difflib,零强制依赖 |
File composition
SKILL.md references/models.yaml _core/calibrate.py scripts/cache.py