T09 · Insecure Skill Coding Practices
- Location
index.js:6- Finding
Arbitrary Shell Command Injection Through CLI Arguments
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill is a security scanner, but it has unsafe scanner implementation flaws that could let crafted scan targets run commands, escape extraction limits, or bypass scanning.
Use this only in an isolated environment and avoid scanning untrusted URLs or paths through the Node wrapper. Do not rely on its pass/fail result for high-stakes decisions until command argument handling, archive extraction containment, raw LLM prompt generation, and whitelist trust logic are fixed.
index.js:6Arbitrary Shell Command Injection Through CLI Arguments
scripts/scan.sh:268Unsafe Extraction of Remotely Supplied ZIP Archives
scripts/scan.sh:609Name-Based Whitelist Allows Complete Scanner Bypass
scripts/scan.sh:528Attacker-Controlled Source Is Embedded Verbatim Into an LLM Prompt
scripts/scan.sh:633Whitespace-Sensitive File Enumeration Allows Static Scan Evasion
Referenced artifact was not completely inspected
./scripts/scan.sh https://clawhub.ai/owner/skill-name
Referenced artifact was not completely inspected
./scripts/scan.sh https://clawhub.ai/owner/skill-name
Referenced artifact was not completely inspected
./scripts/scan.sh https://clawhub.ai/owner/skill-name
Referenced artifact was not completely inspected
./scripts/scan.sh https://clawhub.ai/owner/skill-name
Referenced artifact was not completely inspected
./scripts/scan.sh https://clawhub.ai/owner/skill-name
Referenced artifact was not completely inspected
./scripts/scan.sh https://clawhub.ai/owner/skill-name
Referenced artifact was not completely inspected
./scripts/scan.sh https://clawhub.ai/owner/skill-name
Referenced artifact was not completely inspected
./scripts/scan.sh https://clawhub.ai/owner/skill-name
Referenced artifact was not completely inspected
./scripts/scan.sh https://clawhub.ai/owner/skill-name
Referenced artifact was not completely inspected
./scripts/scan.sh https://clawhub.ai/owner/skill-name
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
| 命令 | 风险描述 | 检测文件 |
|------|----------|----------|
| `rm -rf /` | 根目录删除,毁灭性操作 | .sh, .bash |
| `rm -rf ~` | 用户主目录删除,丢失所有数据 | .sh, .bash |
| `rm -rf $HOME` | 同上,使用环境变量 | .sh, .bash |
| `curl \| bash` | 远程脚本执行,完全不可控 | .sh, .bash |
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
| 命令 | 风险描述 | 检测文件 |
|------|----------|----------|
| `rm -rf /` | 根目录删除,毁灭性操作 | .sh, .bash |
| `rm -rf ~` | 用户主目录删除,丢失所有数据 | .sh, .bash |
| `rm -rf $HOME` | 同上,使用环境变量 | .sh, .bash |
| `curl \| bash` | 远程脚本执行,完全不可控 | .sh, .bash |
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
| 命令 | 风险描述 | 检测文件 |
|------|----------|----------|
| `rm -rf /` | 根目录删除,毁灭性操作 | .sh, .bash |
| `rm -rf ~` | 用户主目录删除,丢失所有数据 | .sh, .bash |
| `rm -rf $HOME` | 同上,使用环境变量 | .sh, .bash |
| `curl \| bash` | 远程脚本执行,完全不可控 | .sh, .bash |
| `wget -O- \| sh` | 远程脚本执行,完全不可控 | .sh, .bash |
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.
| `rm -rf /` | 根目录删除,毁灭性操作 | .sh, .bash |
| `rm -rf ~` | 用户主目录删除,丢失所有数据 | .sh, .bash |
| `rm -rf $HOME` | 同上,使用环境变量 | .sh, .bash |
| `curl \| bash` | 远程脚本执行,完全不可控 | .sh, .bash |
| `wget -O- \| sh` | 远程脚本执行,完全不可控 | .sh, .bash |
| `curl https://... \| sh` | 同上 | .sh, .bash |
| `wget https://... \| bash` | 同上 | .sh, .bash |
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.
| `rm -rf ~` | 用户主目录删除,丢失所有数据 | .sh, .bash |
| `rm -rf $HOME` | 同上,使用环境变量 | .sh, .bash |
| `curl \| bash` | 远程脚本执行,完全不可控 | .sh, .bash |
| `wget -O- \| sh` | 远程脚本执行,完全不可控 | .sh, .bash |
| `curl https://... \| sh` | 同上 | .sh, .bash |
| `wget https://... \| bash` | 同上 | .sh, .bash |
| `passwd` | 修改用户密码 | .sh, .py, .js |
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.
| `rm -rf $HOME` | 同上,使用环境变量 | .sh, .bash |
| `curl \| bash` | 远程脚本执行,完全不可控 | .sh, .bash |
| `wget -O- \| sh` | 远程脚本执行,完全不可控 | .sh, .bash |
| `curl https://... \| sh` | 同上 | .sh, .bash |
| `wget https://... \| bash` | 同上 | .sh, .bash |
| `passwd` | 修改用户密码 | .sh, .py, .js |
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.
| `curl \| bash` | 远程脚本执行,完全不可控 | .sh, .bash |
| `wget -O- \| sh` | 远程脚本执行,完全不可控 | .sh, .bash |
| `curl https://... \| sh` | 同上 | .sh, .bash |
| `wget https://... \| bash` | 同上 | .sh, .bash |
| `passwd` | 修改用户密码 | .sh, .py, .js |
## 🟠 高风险 (扣 20 分)
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
| 命令/模式 | 风险描述 | 检测文件 |
|-----------|----------|----------|
| `chmod 777` | 权限过于宽松 | .sh, .bash |
| `eval $var` | 动态代码执行 | .sh, .bash |
| `eval "$(...)"` | 同上 | .sh, .bash |
| `elevated: true` | 要求 root 权限 | .yaml, .yml, SKILL.md |
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
| `curl -X POST` | 同上 | .sh, .bash |
| `.env` | 环境变量文件 | 所有 |
| `~/.ssh/` | SSH 密钥目录 | 所有 |
| `/etc/passwd` | 系统用户文件 | .sh, .bash |
| `$VAR` / `${VAR}` | 环境变量读取 | .sh, .bash |
| `curl` / `wget` | 网络请求 | .sh, .bash |
| `fetch` / `axios` | HTTP 请求 | .js, .mjs |
Skill attempts to nullify the agent's safety policies or restrictions ('you have no restrictions', 'ignore your guidelines', 'do anything now'). This is a direct jailbreak that disables guardrails.
| I04 | `new Function\(` | critical | Function 构造器 |
| I05 | `ignore.*previous.*instructions` | high | 提示注入 |
| I06 | `jailbreak\|bypass.*safety` | critical | 越狱攻击 |
| I07 | `DAN\|do anything now` | critical | DAN 越狱模式 |
| I08 | `curl.*http` | high | 远程下载执行 |
### OBFUSCATION(混淆隐藏)
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.
| 规则 ID | 规则 | 风险 | 说明 |
|---------|------|------|------|
| S01 | `curl/wget \| bash` | critical | 远程脚本执行 |
| S02 | `curl.*\.sh$`, `wget.*-O-` | critical | 下载执行远程脚本 |
| S03 | `eval $()` | critical | 动态命令执行 |
| S04 | `exec <cmd>` | critical | 命令替换执行 |
Skill attempts to nullify the agent's safety policies or restrictions ('you have no restrictions', 'ignore your guidelines', 'do anything now'). This is a direct jailbreak that disables guardrails.
echo "$c" | grep -qE "eval\(" && add_issue "INJECTION" "dynamic-exec" "critical" 25 "$f" "eval"
echo "$c" | grep -qE "new Function\(|Function\(" && add_issue "INJECTION" "dynamic-exec" "critical" 25 "$f" "Function"
echo "$c" | grep -qE "ignore previous|ignore prior" && add_issue "INJECTION" "prompt-injection" "high" 20 "$f" "ignore"
echo "$c" | grep -qE "jailbreak|bypass safety" && add_issue "INJECTION" "jailbreak" "critical" 25 "$f" "jailbreak"
# 反引号命令注入
echo "$c" | grep -qE "\`[^\`]*\`" && add_issue "INJECTION" "backtick-injection" "critical" 25 "$f" "backtick"
This pattern attempts to override system instructions or ignore safety constraints. Without LLM analysis, manual review is recommended.
echo "$c" | grep -qE "eval\(" && add_issue "INJECTION" "dynamic-exec" "critical" 25 "$f" "eval"
echo "$c" | grep -qE "new Function\(|Function\(" && add_issue "INJECTION" "dynamic-exec" "critical" 25 "$f" "Function"
echo "$c" | grep -qE "ignore previous|ignore prior" && add_issue "INJECTION" "prompt-injection" "high" 20 "$f" "ignore"
echo "$c" | grep -qE "jailbreak|bypass safety" && add_issue "INJECTION" "jailbreak" "critical" 25 "$f" "jailbreak"
# 反引号命令注入
echo "$c" | grep -qE "\`[^\`]*\`" && add_issue "INJECTION" "backtick-injection" "critical" 25 "$f" "backtick"
YARA rule matched a hack tool or exploit indicator (offensive tools, reconnaissance, privilege escalation, or exploit frameworks).
l" 25 "$f" "npx"
echo "$c" | grep -qE "eval\(" && add_issue "INJECTION" "dynamic-exec" "critical" 25 "$f" "eval"
echo "$c" | grep -qE "new Function\(|Function\(" && add_issue "INJECTION" "dynamic-exec" "critical" 25 "$f" "Function"
echo "$c" | grep -qE "ignore previous|ignore prior" && add_issue "INJECTION" "prompt-injection" "high" 20 "$f" "ignore"
echo "$c" | grep -qE "jailbreak|bypass safety" && add_issue "INJECTION" "jailbreak" "critical" 25 "$f" "jailbreak"
# 反引号命令注入
echo "$c" | grep -qE "\`[^\`]*\`" && add_issue "INJECTION" "backtick-injection" "critical" 25 "$f" "backtick"
# 加密操作(可能用于恶意行为)
echo "$c" | grep -qE "crypto.*createCipher|crypto.*createDecipher" && add_issue "INJECTION" "crypto-operation" "medium" 15 "$f" "crypto"
}
check_obfuscation() {
local c=$1 f=$2
echo "$c" | grep -qE "Buffer\.from|atob\(|btoa\(" && add_issue "OBFUSCATION" "base64" "high" 20 "$f" "Base64"
echo "$c" |
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
http_code=$(curl -sL -o "$TARGET_DIR/s.zip" -w "%{http_code}" "$zip_url" 2>/dev/null)
if [[ "$http_code" == "200" ]] && [[ -s "$TARGET_DIR/s.zip" ]]; then
echo "[INFO] HTTP 下载成功 (${http_code})"
unzip -q "$TARGET_DIR/s.zip" -d "$TARGET_DIR" 2>/dev/null && rm -f "$TARGET_DIR/s.zip"
# 处理嵌套目录 (clawhub 打包会多一层目录)
local first_dir
first_dir=$(ls -d "$TARGET_DIR"/*/ 2>/dev/null | head -1)
Detected: suspicious.dangerous_exec