T09 · Insecure Skill Coding Practices
- Location
SKILL.md:14- Finding
Shell Command Injection Through User-Controlled Task Arguments
- Content
View full analysis
``` ```bash ~/.openclaw/scripts/claude-tmux.sh stop ~/.openclaw/scripts/claude-tmux.sh stop-all ``` The documented workflow establishes that the task description originates from the user: ```markdown 1. User says "use Claude Code xxx" → Optimize prompt → Show for approval 2. User confirms → Start background task → Return immediately ``` ### Technical Analysis The Skill directs an agent with the `Bash` tool to place user-supplied task descriptions and identifiers into shell command templates. It does not require strict input validation, shell escaping, or execution through an argument-safe process API. Placing the task description inside double quotes is insufficient protection. Bash still evaluates command substitutions such as `$(command)` and backtick expressions inside double-quoted strings. The task-name and task-ID placeholders are shown without quoting, which additionally permits whitespace splitting, redirection, pipelines, command separators, and other shell metacharacters if the agent performs direct textual substitution. For example, a task description containing: ```text Review the project $(touch /tmp/claude-runner-injected) ``` could produce: ```bash ~/.openclaw/scripts/claude-tmux.sh start "Review the project $(touch /tmp/claude-runner-injected)" audit ``` Bash would execute `touch /tmp/claude-runner-injected` before invoking the runner script. Exploitability depends on the agent constructing and executing these tem ...[truncated 1872 chars]- Remediation
View remediation
