T09 · Insecure Skill Coding Practices
- Location
SKILL.md:31- Finding
Arbitrary Command Execution Through Unsafe Path Evaluation
- Content
View full analysis
` using `eval echo` to ensure absolute pathing before passing to `cmus-remote`. ### Mode A: Play track and shuffle the rest (Default) Trigger Intent: "Play this track", "Open song...", "Play and shuffle". Execute this bash block: TARGET_FILE=$(eval echo "") cmus-remote -C "clear" cmus-remote -C "add $HOME/.openclaw/workspace/music/" cmus-remote -C "set continue=true" cmus-remote -C "set shuffle=true" cmus-remote -f "$TARGET_FILE" ### Mode B: Play ONLY the requested track Trigger Intent: "Play only this track", "Do not shuffle", "Single track mode". Execute this bash block: TARGET_FILE=$(eval echo "") cmus-remote -C "clear" cmus-remote -C "add $TARGET_FILE" cmus-remote -C "set continue=false" cmus-remote -C "set repeat=false" cmus-remote -p ``` ### Technical Analysis The skill explicitly instructs the agent to interpolate a user-influenced file path into shell source and process it with `eval`. Unlike ordinary variable assignment, `eval` reparses its arguments as shell code. Consequently, shell constructs embedded in the supplied path—including command substitutions, backticks, variable expansions, redirections, separators, or other shell syntax—can be interpreted and executed. For example, a path containing a command substitution such as `$(attacker_command)` would cause that command to execute while `TARGET_FILE` is being assigned. The surrounding double quotes do not neutralize this behavior because the purpose of `eval` is to perform another round of shell parsing. The same unsafe pattern appears in both supported playback modes, so changing the requested playback mode does not avoid the vulnerability. ### Attack Path 1. An attacker supplies or influences the media path given to the skill. 2. The c ...[truncated 1107 chars]- Remediation
View remediation
