低风险 — 风险评分 30/100
上次扫描:4 小时前 重新扫描
30 /100
agent-runtime
智能体运行时系统。整合工具注册、权限控制、Hook拦截、上下文压缩、Usage追踪的完整Agent运行时。
Agent Runtime 框架代码本身无恶意行为,但存在文档-行为不一致(未声明的内置工具)属于轻微阴影功能,以及权限控制在 SKILL.md 中被强调但实现为直接允许(简化版)。
技能名称agent-runtime
分析耗时63.2s
引擎pi
ClawHub Agent Runtime v1.0.0 by xhmqq616
ClawHub 判定 可疑 dangerous_execvt_suspicious
可以安装
建议补充 SKILL.md 中的 allowed-tools 声明和内置工具列表(read_file、bash、search、todo),并完善权限控制实现(非仅简化允许)。

安全发现 3 项

严重性 安全发现 位置
中危
内置工具未在文档中声明 文档欺骗
代码内置了 read_file、bash、search、todo 四个工具,且注册到运行时供用户调用,但 SKILL.md 完全没有提及这些工具的存在,仅描述了框架架构。
this.registry.register({ name: 'read_file', aliases: ['read', 'cat'], description: '读取文件内容', permission: 'read', ... })
→ 在 SKILL.md 的工具列表或 allowed-tools 部分明确列出内置工具及其用途和权限级别。
scripts/agent-runtime.mjs:137
中危
权限控制实现为空壳 权限提升
SKILL.md 强调'权限级别控制'、'权限控制'为核心功能,但 SimpleHookRunner 的 runPreToolUse 和 runPostToolUse 均直接返回 { allowed: true, denied: false },没有任何实际拦截逻辑。
async runPreToolUse(toolName, input) { return { allowed: true, denied: false, messages: [] }; }
→ 实现真实的权限检查逻辑,参照 SKILL.md 中声明的 PermissionLevel (READ/WRITE/DANGER/ADMIN) 进行工具过滤。
scripts/agent-runtime.mjs:94
低危
bash 工具未声明且权限较高 权限提升
bash 工具 permission='danger'、shell:true,允许执行任意 shell 命令,且未在 SKILL.md 声明,存在潜在权限提升风险。
spawn('cmd', ['/C', command], { shell: true })
→ 如非必需,移除内置 bash 工具;如需保留,应在文档中明确声明并限制 agentTypes 范围。
scripts/agent-runtime.mjs:153
资源类型声明权限推断权限状态证据
文件系统 NONE READ ✗ 越权 scripts/agent-runtime.mjs:143 内置 read_file 工具调用 fs.readFileSync
命令执行 NONE WRITE ✗ 越权 scripts/agent-runtime.mjs:157 内置 bash 工具使用 spawn('cmd', ['/C', command], {shell:…
技能调用 NONE WRITE ✗ 越权 scripts/agent-runtime.mjs:155 动态 import('child_process')

目录结构

2 文件 · 17.1 KB · 610 行
JavaScript 1f · 508L Markdown 1f · 102L
├─ 📁 scripts
│ └─ 📜 agent-runtime.mjs JavaScript 508L · 13.9 KB
└─ 📝 SKILL.md Markdown 102L · 3.2 KB

安全亮点

✓ 代码本身无恶意行为(无数据外泄、无凭证收割、无反向shell、无持久化)
✓ 框架架构清晰,有合理的组件分离(Registry/Hook/Compactor/Tracker)
✓ 无外部网络请求,无敏感路径硬编码
✓ Usage Tracker 和 Session Compactor 实现合理