T09 · Insecure Skill Coding Practices
- Location
references/cli_commands.md:104- Finding
Shell Command Injection Through Unsanitized Diagnostic Parameters
- Content
View full analysis
" \ --logstore "" \ --from "$FROM" \ --to "$TO" \ --query "host: and request_path: and status:" \ --line 10 \ --region \ --read-timeout 30 --connect-timeout 10 \ --user-agent "AlibabaCloud-Agent-Skills/alibabacloud-waf-rule-management/{{SESSION_ID}}" ``` ```bash aliyun sls get-logs-v2 \ --project "" \ --logstore "" \ --from "$FROM" \ --to "$TO" \ --query "host: and real_client_ip:" \ --line 10 \ --region \ --read-timeout 30 --connect-timeout 10 \ --user-agent "AlibabaCloud-Agent-Skills/alibabacloud-waf-rule-management/{{SESSION_ID}}" ``` The general command format also permits an unconstrained query string: ```bash aliyun sls get-logs-v2 \ --project "" \ --logstore "" \ --from "$FROM" \ --to "$TO" \ --query "" \ --line 10 \ --user-agent "AlibabaCloud-Agent-Skills/alibabacloud-waf-rule-management/{{SESSION_ID}}" ``` ### Technical Analysis The Skill instructs an agent with Bash access to interpolate user-supplied host names, paths, IP addresses, timestamps, regions, resources, and query expressions directly into shell command templates. Only trace IDs have explicit character restrictions. Equivalent shell-safe validation is not defined for the other parameters. Placing an untrusted value inside a double-quoted shell argument does not prevent shell evaluation. Command substitutions such as `$(command)` and backtick expressions are still executed by the shell. Embedded quotation marks can also terminate an argument and introduce additional shell operato ...[truncated 1850 chars]- Remediation
View remediation
