T09 · Insecure Skill Coding Practices
- Location
SKILL.md:90- Finding
Shell Argument Injection Through Unquoted User-Controlled Paths
- Content
View full analysis
bdpan download ``` ### Technical Analysis The skill directs the agent to insert local and remote paths into shell commands, but it does not require argument-array execution, shell escaping, mandatory quoting, option termination, or strict character validation. Although the document prohibits certain remote-path traversal sequences such as `..` and `~`, those checks do not prevent shell metacharacters, command substitutions, control characters, or option-like filenames. Local paths receive even less validation. If an implementation constructs a shell command by directly replacing these placeholders with user-supplied values, a malicious path containing syntax such as command separators or command substitution can alter the intended command. A path beginning with `-` may also be interpreted as a command-line option unless the CLI supports and uses an option terminator. This issue is conditional on the agent or runtime executing a constructed shell string. It can be avoided only if the command is invoked using a process API that passes each path as an independent argument without a shell. ### Attack Path 1. An attacker requests an upload or download and supplies a crafted local or remote path. 2. The agent follows the documented template and interpolates the path into a shell command. 3. The runtime passes the resulting string to a shell. 4. The shell interprets metacharacters, substitutions, or additional tokens embedded in the path. 5. An unintended command or unintended `bdpan` option executes with the privileges of the agent process. ### Impact Assessment Successful exploitation can execute arbitrary ...[truncated 569 chars]- Remediation
View remediation
