T09 · Insecure Skill Coding Practices
- Location
SKILL.md:214- Finding
Shell Command Injection Through Unquoted Domain Substitution
- Content
View full analysis
$PYTHON scripts/dns_quick_check.py --domain > /tmp/dns_diag_/quick.json $PYTHON scripts/dns_analyze.py quick --file /tmp/dns_diag_/quick.json ``` ```bash ( $PYTHON scripts/dns_openapi.py check --domain > /tmp/dns_diag_/openapi_check.json 2>&1 $PYTHON scripts/dns_openapi.py records --domain --rr > /tmp/dns_diag_/openapi_records.json 2>&1 $PYTHON scripts/dns_openapi.py domain-info --domain > /tmp/dns_diag_/openapi_domain_info.json 2>&1 ) & OPENAPI_PID=$! perl -e 'alarm 120; exec @ARGV' $PYTHON scripts/dns_boce.py dns --domain > /tmp/dns_diag_/dns_probe.json ``` ### Technical Analysis The documented workflow interpolates user-customizable domain values directly into shell commands without quoting or strict DNS-name validation. The domain is used both as a command argument and as part of a redirection path. Although the Python wrappers generally invoke subprocesses with argument arrays and without `shell=True`, that protection does not apply to the controlling shell commands in `SKILL.md`. If an agent replaces `` with a value containing shell metacharacters, command substitution, whitespace, redirection operators, or command separators, the shell can interpret those characters as executable syntax. The related ``, ``, and `` placeholders are also inserted without quoting and require equivalent validation. ### Attack Path 1. An attacker submits a diagnostic request with a crafted value presented as the target domain, such as a value containing a command separator or command substitution. 2. The agent follows the mandatory workflow and substitutes that value into one of the documented shel ...[truncated 848 chars]- Remediation
View remediation
