T09 · Insecure Skill Coding Practices
- Location
SKILL.md:88- Finding
Shell Command Injection Through User-Controlled Prompt and Scene Values
- Content
View full analysis
" \ --instrumental \ --out /tmp/openclaw/bgm_.mp3 # Method 2: Python script (requires MINIMAX_API_KEY environment variable) python3 scripts/generate_bgm.py \ --prompt "" \ --output /tmp/openclaw/bgm_.mp3 ``` ### Technical Analysis The workflow directs the Agent to derive both `` and `` from user-provided messages and interpolate those values into shell command templates. The scene placeholder in the output filename is unquoted, allowing shell metacharacters, whitespace, additional arguments, redirections, or command separators to alter the command. Although the prompt placeholder is shown inside double quotes, shell command substitutions such as `$(command)` and backtick expressions remain active inside double-quoted shell strings if an Agent constructs and executes the resulting command through a shell. No input validation, shell escaping, strict scene allowlist, or instruction to use an argument-array process API is provided. Consequently, an attacker may transform a legitimate music-generation request into arbitrary shell execution when the Agent follows the documented workflow. ### Attack Path 1. An attacker sends a BGM request containing shell syntax in the scene description or special requirements. 2. The Agent extracts that attacker-controlled text into `` or ``. 3. The Agent replaces the placeholders in the documented shell command. 4. The resulting command is submitted to a shell. 5. The shell interprets command substitution, separators, redirection, or injected command-line arguments. 6. The injected command executes with the same operating-system permissions ...[truncated 808 chars]- Remediation
View remediation
