T09 · Insecure Skill Coding Practices
- Location
SKILL.md:20- Finding
Shell Command Injection Through Unescaped Template Parameters
- Content
View full analysis
"cd && \ PATH=/opt/homebrew/bin:\$PATH codex exec --full-auto ''; \ EXIT_CODE=\$?; echo 'EXITED:' \$EXIT_CODE; \ openclaw system event --text ' finished (exit \$EXIT_CODE) in ' --mode now; \ sleep 999999" ``` ```bash tmux -S ~/.tmux/sock new -d -s "cd && \ PATH=/opt/homebrew/bin:\$PATH ralphy --codex --prd PRD.md; \ EXIT_CODE=\$?; echo 'EXITED:' \$EXIT_CODE; \ openclaw system event --text 'Ralph loop finished (exit \$EXIT_CODE) in ' --mode now; \ sleep 999999" ``` ```bash tmux -S ~/.tmux/sock new -d -s "cd && \ PATH=/opt/homebrew/bin:\$PATH ralphy --codex --parallel --prd PRD.md; \ EXIT_CODE=\$?; echo 'EXITED:' \$EXIT_CODE; \ openclaw system event --text 'Ralph parallel finished (exit \$EXIT_CODE)' --mode now; \ sleep 999999" ``` ### Technical Analysis The documented templates insert ``, ``, and `` into a shell command containing multiple nested quoting contexts. No validation or context-aware escaping is prescribed. In the Codex template, the task description appears inside single quotes within a larger double-quoted argument passed to `tmux`. A single quote in the supplied task can terminate the intended Codex argument. Shell metacharacters can then introduce another command. Project directories and session names can similarly affect parsing when they contain whitespace, quotes, command substitutions, separators, or option-like content. Because the shell evaluates this constructed command, escaping must account for every parsing layer. Merely surrounding placeholders with quotes is insufficient. The use of `c ...[truncated 1926 chars]- Remediation
View remediation
