T09 · Insecure Skill Coding Practices
- Location
SKILL.md:47- Finding
Shell Command Injection Through Unsafe Dynamic Argument Interpolation
- Content
View full analysis
"" # SKILL.md:67 wctl create # SKILL.md:122 openclaw message send --media --channel --target # SKILL.md:165 wctl dispatch "4" wctl dispatch "" # SKILL.md:230-232 wctl dispatch-answers --chat-arrows 20 sleep 3 wctl dispatch "" ``` ### Technical Analysis The skill instructs the agent to insert dynamic values directly into shell command strings. These values include user messages, rejection feedback, repository names, filesystem paths, task identifiers, screenshot paths, channel names, and message targets. Enclosing a value in double quotes does not make it safe for shell evaluation. Shell constructs such as command substitution—`$(command)` or backticks—are still evaluated inside double quotes. An embedded quote may also terminate the intended argument and introduce shell metacharacters such as `;`, `&&`, redirections, or pipelines. The unquoted placeholders in `wctl create` and `openclaw message send` are additionally exposed to whitespace splitting, wildcard expansion, option injection, and shell metacharacter interpretation. For example, if a user message containing the following value is substituted into the documented dispatch template and executed through a shell: ```text Please inspect $(id > /tmp/workstation-injection-proof) ``` the shell may execute `id` before invoking `wctl`. A quote-breaking payload could similarly append an arbitrary command: ```text "; arbitrary-command; # ``` The security statement at line 310 claims that free text is never injected into PTY commands without validation. This conflicts with lines 165 and 232, which explicitly instruct the agent to dispatch a ...[truncated 2580 chars]- Remediation
View remediation
