T09 · Insecure Skill Coding Practices
Error
- Location
- scripts/scan-skill.sh:16
- Finding
- Security scan excludes executable and auxiliary files<![CDATA[ ## Vulnerability Details **File Location**: `scripts/scan-skill.sh:16-20, 32-40` **Vulnerability Type**: Incomplete security scan coverage **Risk Level**: High ### Vulnerable Code ```bash SKILL_NAME=$(basename "$SKILL_PATH") SKILL_FILE="$SKILL_PATH/SKILL.md" if [ ! -f "$SKILL_FILE" ]; then echo "Error: SKILL.md not found in $SKILL_PATH" exit 1 fi echo "🔍 Scanning: $SKILL_NAME" echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" # Check for suspicious patterns (in actual code, not examples) ISSUES=() GREEN_FLAGS=() # Network exfiltration - look for actual calls, not examples if grep -qE "^\s*(curl|wget|fetch|axios).*https?://" "$SKILL_FILE" 2>/dev/null; then if ! grep -qE "api\.(github|openclaw)" "$SKILL_FILE" 2>/dev/null; then ISSUES+=("[MEDIUM] Makes network calls to external domains") fi fi # Check metadata for env vars requesting secrets if grep -qE "env:.*(KEY|TOKEN|SECRET|PASSWORD)" "$SKILL_FILE" 2>/dev/null; then ``` ### Technical Analysis The scanner assigns `SKILL_FILE` exclusively to `<skill-path>/SKILL.md`, and every implemented security check reads only that file. It does not inspect shell scripts, Python files, JavaScript files, binaries, configuration files, or other executable resources within the target Skill. This is a fail-open design for a security scanner. A Skill can keep its documentation benign while placing credential access, remote communication, destructive commands, obfuscated payloads, or persistence logic in `scripts/` or another auxiliary directory. The scanner will not observe those behaviors. The project documentation claims detection of network exfiltration, credential harvesting, destructive operations, and obfuscation, but those guarantees cannot apply to code outside `SKILL.md`. ### Attack Path 1. An attacker creates a Skill with valid metadata and ordinary documentation in `SKILL.md`. 2. The attacker places malicious behavior in an auxiliary file such as `scripts/run.sh`. 3. The Skill inst ...[truncated 884 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Recursively enumerate and inspect all relevant files under the target Skill directory, including shell, Python, JavaScript, TypeScript, PowerShell, configuration, and executable files. 2. Use an explicit file-type policy and report every skipped or unsupported file so incomplete coverage cannot silently produce a safe verdict. 3. Detect binaries separately and mark unreviewed executable content as requiring manual analysis. 4. Canonicalize every path and reject symbolic links or resolved paths that escape the selected Skill directory. 5. Apply file-count and file-size limits to prevent resource-exhaustion attacks. 6. Add language-aware checks for network access, credential-file access, command execution, persistence, obfuscation, and destructive operations. 7. Cap the trust score or return an inconclusive result whenever executable content could not be analyzed. 8. Add regression tests containing a benign `SKILL.md` and malicious helper scripts in multiple subdirectories. ]]>
