T09 · Insecure Skill Coding Practices
Warning
- Location
SKILL.md:20- Finding
Unvalidated HOST Input Permits Command-Line Argument Injection
- Content
View full analysis
/dev/null | openssl x509 -noout \ -subject -issuer -dates -fingerprint -ext subjectAltName 2>&1 # Check full chain echo | openssl s_client -connect $HOST:443 -servername $HOST -showcerts 2>/dev/null | \ awk '/BEGIN CERT/,/END CERT/{print}' | \ openssl x509 -noout -subject -issuer -dates 2>&1 # Days until expiry echo | openssl s_client -connect $HOST:443 -servername $HOST 2>/dev/null | \ openssl x509 -noout -enddate 2>&1 | \ ``` Other affected commands include: ```bash result=$(echo | openssl s_client -connect $HOST:443 -$proto 2>&1) ``` ```bash nmap --script ssl-enum-ciphers -p 443 $HOST 2>/dev/null || \ openssl s_client -connect $HOST:443 -cipher 'ALL' 2>&1 | grep "Cipher is" ``` ```bash result=$(echo | openssl s_client -connect $HOST:443 -cipher "$cipher" 2>&1) ``` ```bash curl -sI "https://$HOST" | grep -iE "^(strict-transport|x-frame|x-content|content-security|referrer|permissions|x-xss)" 2>&1 ``` ```bash echo | openssl s_client -connect $HOST:443 2>/dev/null | openssl x509 -noout -text | \ ``` ### Technical Analysis The skill does not define a validation policy for `HOST`, and most OpenSSL and Nmap commands expand `$HOST` without quotation marks. In a POSIX-compatible shell, an unquoted variable undergoes word splitting and pathname expansion. Consequently, a value containing spaces or wildcard characters can become multiple command-line arguments. This does not directly reinterpret embedded shell separators such as semicolons as shell syntax, because shell metacharacters introduced by parameter expansion are not parsed again as control operators. However, ...[truncated 1925 chars]- Remediation
View remediation
