T09 · Insecure Skill Coding Practices
- Location
SKILL.md:91- Finding
Shell Command Injection Through Unquoted User-Controlled Arguments
- Content
View full analysis
\ --output ~/Downloads/figure_.pdf \ --title "[figure title]" \ --xlabel "X axis label" \ --ylabel "Y axis label" \ --type [auto|line|bar|scatter|heatmap|box] ``` ### Technical Analysis The documented workflow directs the agent to replace `` with a user-provided file path and execute the resulting command through a shell. The argument is not quoted or escaped. If the supplied path contains shell control operators, command substitution syntax, whitespace, or redirection operators, the shell can interpret them as command syntax rather than as part of the filename. The `` placeholder in the output path is likewise unquoted, although it presents less direct exposure if generated exclusively from a trusted, fixed-format date source. The figure title and other arguments are shown in quotes, but safe execution still requires correct escaping if user-provided values contain quotes or command-substitution syntax. The command also invokes `auto_figure.py` from a separate Skill directory rather than from this audited project. That script was not present in the supplied artifact and therefore could not be reviewed. This expands the trust boundary and makes execution dependent on the integrity of an externally mutable local file. ### Attack Path 1. An attacker provides a purported data-file path containing shell syntax, for example: ```text data.csv; touch /tmp/command-injection-proof # ``` 2. The agent substitutes this value directly for ``. 3. The resulting shell command becomes equivalent to: ```bash python3 ~/.openclaw/workspace/skills/nature-paper-hub/scripts/auto_figure.py \ --input data.csv; touch /tmp/command-injection-proof ...[truncated 1150 chars]- Remediation
View remediation
