T09 · Insecure Skill Coding Practices
- Location
SKILL.md:58- Finding
Shell Command Injection Through Unvalidated CLI Configuration
- Content
View full analysis
\"$(cat PROMPT.md)\"" - workdir: - background: true - pty: true - yieldMs: 60000 - timeout: 3600 ``` The related command templates and optional flags include: ```text | **OpenCode** | `opencode run --model "$(cat PROMPT.md)"` | | **Codex** | `codex exec "$(cat PROMPT.md)"` (requires git) | | **Claude Code** | `claude "$(cat PROMPT.md)"` | | **Pi** | `pi --provider --model -p "$(cat PROMPT.md)"` | | **Goose** | `goose run "$(cat PROMPT.md)"` | Common flags: - Codex: `--full-auto`, `--yolo`, `--model ` - Claude: `--dangerously-skip-permissions` ``` ### Technical Analysis The Skill instructs an agent to collect CLI, model, provider, flag, and working-directory values and interpolate them into a shell command string. It does not require strict allowlisting, shell-safe argument handling, structured executable/argument arrays, or rejection of shell metacharacters. If an attacker can influence a value substituted for ``, ``, ``, or a custom CLI command, shell syntax embedded in that value may terminate or alter the intended command and append an arbitrary command. For example, a value containing command separators or command substitution syntax could be interpreted by the shell when the constructed string is passed to `exec`. The prompt file expansion is enclosed in double quotes, which limits injection directly through the contents of `PROMPT.md`. However, the configuration placeholders outside that quoted expansion remain unsafe when substituted without validation. The documented availability of `- ...[truncated 2005 chars]- Remediation
View remediation
