T09 · Insecure Skill Coding Practices
- Location
SKILL.md:20- Finding
Shell Command Injection Through Unvalidated User-Controlled Parameters
- Content
View full analysis
``` The same unquoted placeholders are subsequently inserted into additional shell commands: ```bash -P \ https:/// ``` ```bash bash /fetch-query-assets.sh ``` ```bash bash /fix-filenames.sh ``` ```bash cd / ``` ### Technical Analysis `SAVE_PATH` and `DOMAIN` originate from user-supplied natural-language input. The Skill instructs the agent to substitute these values directly into shell commands, but it does not define validation, canonicalization, or consistent shell quoting requirements. If a substituted value contains shell metacharacters such as semicolons, command substitutions, redirections, pipes, or whitespace, the shell can interpret part of the value as additional syntax rather than as one argument. Option-prefixed paths may also be interpreted as command options in commands that do not use an end-of-options marker. Although some generated scripts quote their positional parameters internally, the commands used to invoke those scripts do not quote the substituted placeholders. The initial directory creation, downloader invocation, script execution, and working-directory change are therefore exposed at several stages. ### Attack Path 1. An attacker or untrusted user requests a website mirror operation. 2. The attacker supplies a crafted save path or domain containing shell syntax. 3. The agent extracts the text as `SAVE_PATH` or `DOMAIN`. 4. The agent substitutes the value into one of the documented shell command templates. 5. The command is interpreted by a shell. 6. The injected syntax executes with the same operating-syste ...[truncated 713 chars]- Remediation
View remediation
