T09 · Insecure Skill Coding Practices
- Location
references/dataset-management.md:57- Finding
Shell Command Injection Through Dataset Description Interpolation
- Content
View full analysis
\ --agent-space \ --dataset-name \ --description "" \ --schema '{ "question":{"type":"text","chn":true,"embedding":"agentloop-embedding-v4"}, "answer":{"type":"text","chn":true}, "score":{"type":"double"}, "metadata":{"type":"json","jsonKeys":{"source":{"type":"text"},"latency_ms":{"type":"long"}}} }' \ --client-token ``` The same unsafe pattern appears in the update example at `references/dataset-management.md:115-121`: ```bash aliyun agentloop update-dataset \ --region \ --agent-space \ --dataset-name \ --description "" \ --client-token ``` ### Technical Analysis The Skill directs the Agent to substitute confirmed or user-supplied values into a shell command. Placing a value inside double quotes does not suppress shell command substitution, backtick substitution, or parameter expansion. Consequently, a description containing shell syntax such as `$(...)` can be evaluated locally before `aliyun` receives the argument. The AgentSpace, region, Dataset name, and client token placeholders also lack consistent shell-safe encoding. Dataset names are constrained elsewhere, but the documented examples do not provide equivalent strict validation for every interpolated identifier. Parameter confirmation and `--cli-dry-run` do not mitigate this flaw because shell expansion occurs before the CLI starts. ### Attack Path 1. An attacker supplies or causes the Agent to process a Dataset description containing command-substitution syntax, such as `$(touch /tmp/agentloop-injection-test)`. 2. The A ...[truncated 1100 chars]- Remediation
View remediation
