T09 · Insecure Skill Coding Practices
- Location
SKILL.md:109- Finding
Shell Command Injection Through Unquoted User-Controlled Paths
- Content
View full analysis
nohup bdpan download > /tmp/bdpan-dl-$$.log 2>&1 & echo $! bdpan share [additional-paths...] [--period ] [--json] ``` ### Technical Analysis The Skill directs the Agent to insert user-selected local and remote paths directly into shell command strings. These arguments are not quoted, are not passed through an argument-array execution interface, and are not separated from options using `--`. The documented validation only prohibits path traversal indicators such as `..`, `~`, and out-of-scope absolute remote paths. Such validation does not prevent shell metacharacters including semicolons, command substitutions, redirections, pipes, or control operators. If an Agent follows these templates using a shell-based `exec` tool, a malicious filename or path can be interpreted as shell syntax rather than as a single `bdpan` argument. ### Attack Path 1. An attacker asks the Agent to upload, download, or share a file whose supplied path contains shell syntax. 2. For example, the attacker supplies a path structurally similar to: ```text report.pdf; attacker-command ``` 3. The path may pass the documented traversal checks because it contains neither `..` nor `~`. 4. The Agent interpolates the path into one of the documented command templates. 5. The shell treats the semicolon as a command separator. 6. The injected command executes with the operating-system privileges and environment available to the Agent process. Other shell constructs, such as command substitution or output redirection, may produce equivalent exploitation paths. ### Impact Assessment Successful exploitation permits arbitrary command execution wit ...[truncated 548 chars]- Remediation
View remediation
