T09 · Insecure Skill Coding Practices
- Location
skill.md:98- Finding
Shell Command Injection Through Untrusted Template Parameters
- Content
View full analysis
/dev/null 2>&1 ``` ### Technical Analysis The parameters `download_url`, `font_name`, `user_choice`, and `zip_path` are inserted directly into the source text of a `bash -c` command. Double quotes around template substitutions do not make this safe because template expansion occurs before Bash parses the resulting command. A value containing a quotation mark, command substitution, or other shell syntax can terminate or alter the intended assignment. Shell substitutions can therefore execute while Bash evaluates the assignment, before the supplied value is used by `wget` or `unzip`. The domain check does not eliminate this vulnerability. It runs only after Bash has parsed and expanded the generated command, so malicious shell expressions embedded in `download_url` may execute before the allowlist comparison. The same issue affects the other interpolated parameters, which have no meaningful character validation. ### Attack Path 1. An attacker causes the agent or action framework to invoke one of the affected actions with a crafted parameter. 2. The framework substitutes the parameter directly into the `bash -c` script. 3. The crafted value introduces shell syntax or command substitution into the generated script. 4. Bash parses and expands the malicious expression. 5. The injec ...[truncated 676 chars]- Remediation
View remediation
