T09 · Insecure Skill Coding Practices
- Location
SKILL.md:75- Finding
Command Injection Through Unquoted User-Provided Video Path
- Content
View full analysis
/tmp/openclaw/uploads/ ``` The same unsafe operation is repeated in the workflow template: ```bash // mkdir -p /tmp/openclaw/uploads && cp /tmp/openclaw/uploads/ ``` The placeholder names above are English translations of the documented source-path placeholders; the command structure is unchanged. ### Technical Analysis The Skill instructs the Agent to insert a user-provided video path directly into a shell command. The path is not quoted, validated, or passed through a structured file operation. If an Agent performs textual substitution as directed, shell metacharacters contained in the path can be interpreted as command syntax. A path containing spaces or wildcard characters can also cause unintended argument splitting or pathname expansion. A path beginning with a hyphen may be interpreted by `cp` as an option because the command does not use the `--` end-of-options delimiter. The vulnerability is especially significant because the video path is explicitly identified as information supplied by the user. Consequently, an attacker who controls that input may be able to transform a file-copy operation into arbitrary shell execution under the Agent's operating-system identity. ### Attack Path 1. An attacker asks the Agent to upload a video to Douyin. 2. The attacker supplies a crafted value as the purported video path. The value includes shell syntax, argument-manipulation characters, or a leading command option. 3. The Agent substitutes the value into the documented `cp /tmp/openclaw/uploads/` command. 4. The shell parses the substituted value rather than treating it exclusively as a literal pathname. 5. Attacker-controlled shell operations execute with ...[truncated 864 chars]- Remediation
View remediation
