T09 · Insecure Skill Coding Practices
- Location
skill-security-audit.sh:11- Finding
Credential scanner provides materially incomplete secret detection
- Content
View full analysis
/dev/null | \ while read file; do grep -n "api[_-]key.*['\"][^'\"]*['\"]" "$file" | head -3 done) if [ -z "$CREDENTIAL_LEAKS" ]; then ``` ### Technical Analysis The Skill claims to identify hardcoded API keys, passwords, secrets, and tokens, but the implementation only searches for an `api_key` or `api-key` pattern followed by a quoted value. It also restricts scanning to `.sh`, `.js`, and `.py` files. The initial file-selection `grep` is case-insensitive, but the second `grep` that produces the result is case-sensitive. A file containing only an uppercase form such as `API_KEY` can therefore be selected and then produce no output, causing the script to report that no credential leak was found. The implementation does not detect common credential forms such as: - `password`, `passwd`, `secret`, `token`, or `authorization` - Provider-specific access-key formats - PEM or SSH private keys - Secrets stored in JSON, YAML, TOML, environment files, Markdown, or extensionless files - Unquoted, concatenated, encoded, or dynamically constructed credentials This is a security-tool correctness issue rather than direct malicious credential access. The script does not read credential paths outside the requested scan target and does not transmit findings over the network. ### Attack Path 1. An attacker places a hardcoded credential in a Skill package using a name such as `TOKEN`, `PASSWORD`, or uppercase `API_KEY`. 2. Alternatively, the attacker stores the credential in an unsupported file type such as `.json`, `.yaml`, or `.env`. 3. A reviewer runs this audit script before installing the ...[truncated 874 chars]- Remediation
View remediation
