High Risk — Risk Score 65/100
Last scan:11 hr ago Rescan
65 /100
grok-swarm
Multi-agent intelligence powered by Grok 4.20 Multi-Agent Beta
cli.py实现了未在SKILL.md中声明的--execute参数,允许执行任意shell命令,构成明确的代码执行风险。
Skill Namegrok-swarm
Duration53.7s
Enginepi
Do not install this skill
必须删除或文档化--execute功能。评估是否需要该参数,或将其作为明确的可选能力声明。

Attack Chain 3 steps

Entry 用户通过SKILL.md了解工具,误认为只是代码生成
SKILL.md:1
Escalation 攻击者利用未声明的--execute参数执行任意命令
bridge/cli.py:229
Impact 反弹shell或数据窃取
N/A

Findings 5 items

Severity Finding Location
High
未声明的shell执行功能 Doc Mismatch
cli.py实现了--execute参数,允许执行任意shell命令。这是SKILL.md中完全未提及的影子功能,用户在不知情的情况下可能触发恶意命令执行。
exec_result = subprocess.run(args.execute, shell=True, capture_output=True, text=True, timeout=300)
→ 删除--execute参数,或在SKILL.md中明确声明该功能为可选能力并添加警告说明。
bridge/cli.py:229
High
任意命令执行风险 RCE
通过--execute参数,攻击者可以执行任意shell命令,包括反弹shell、下载恶意脚本等。
subprocess.run(args.execute, shell=True)
→ 如果需要保留该功能,应使用严格的命令白名单而非直接执行用户输入。
bridge/cli.py:229
Medium
多处读取API凭证 Credential Theft
get_api_key()函数从多个位置读取API密钥:环境变量(OPENROUTER_API_KEY, XAI_API_KEY)、配置文件(~/.config/grok-swarm/config.json)、OpenClaw认证文件(~/.openclaw/*/auth-profiles.json)。这些凭证最终用于连接外部API,理论上存在外泄风险。
key = os.environ.get(OPENROUTER_API_KEY) or os.environ.get(XAI_API_KEY)
→ 确认凭证仅用于OpenRouter API调用,添加代码审计。建议使用专门的密钥管理服务。
bridge/grok_bridge.py:62
Medium
网络通信未声明 Doc Mismatch
SKILL.md未提及该技能会连接外部API(https://openrouter.ai/api/v1)进行通信。用户应知情数据会被发送到第三方。
OPENROUTER_BASE = "https://openrouter.ai/api/v1"
→ 在SKILL.md中明确声明需要网络访问和外部API调用。
bridge/grok_bridge.py:29
Low
依赖无版本锁定 Supply Chain
install.sh中使用pip install openai>=1.0.0,未锁定具体版本,可能安装到存在漏洞的版本。
"$SKILL_DIR/.venv/bin/pip" install -q openai>=1.0.0
→ 锁定具体版本,如openai==1.58.0
install.sh:51
ResourceDeclaredInferredStatusEvidence
Shell NONE WRITE ✗ Violation bridge/cli.py:229-237 subprocess.run(args.execute, shell=True)
Environment NONE READ ✗ Violation bridge/grok_bridge.py:74-75 os.environ.get(OPENROUTER_API_KEY)
Filesystem WRITE WRITE ✓ Aligned SKILL.md声明File Writing能力,apply.py实现
Network NONE READ ✗ Violation bridge/grok_bridge.py:29 OpenRouter API调用
1 findings
🔗
Medium External URL 外部 URL
https://openrouter.ai/api/v1
bridge/grok_bridge.py:29

File Tree

7 files · 39.0 KB · 1255 lines
Python 3f · 851L JavaScript 1f · 204L Markdown 1f · 89L Shell 1f · 84L JSON 1f · 27L
├─ 📁 bridge
│ ├─ 🐍 apply.py Python 190L · 5.6 KB
│ ├─ 🐍 cli.py Python 269L · 9.3 KB
│ ├─ 🐍 grok_bridge.py Python 392L · 13.6 KB
│ └─ 📜 index.js JavaScript 204L · 5.4 KB
├─ 🔧 install.sh Shell 84L · 2.4 KB
├─ 📋 openclaw.plugin.json JSON 27L · 837 B
└─ 📝 SKILL.md Markdown 89L · 1.9 KB

Dependencies 1 items

PackageVersionSourceKnown VulnsNotes
openai >=1.0.0 pip No 无版本锁定,存在供应链风险

Security Positives

✓ apply.py实现了路径遍历保护(_safe_dest函数)
✓ 文件写入有dry-run模式(默认),防止意外覆盖
✓ 有进程级超时保护(index.js)
✓ 代码结构清晰,有适当的错误处理