T09 · Insecure Skill Coding Practices
- Location
SKILL.md:29- Finding
Shell Command Injection Through Insufficiently Validated Input Paths
- Content
View full analysis
-t -s -o - If the input is a file path, pass it directly after validation. ``` ### Technical Analysis The validation described for an input file path only prevents absolute paths and directory traversal. It does not require shell-safe characters or reject command substitutions, shell metacharacters, whitespace, control characters, or leading option characters. The validated path is subsequently inserted into a Bash command. If the Agent constructs that command through string interpolation rather than passing arguments directly to a process API, the shell can interpret characters embedded in a valid current-directory filename. For example, a filename containing shell syntax may satisfy the documented location requirements while still modifying the command structure. A leading `-` may also be interpreted as a command-line option by the converter rather than as a positional filename. ### Attack Path 1. An attacker creates a Markdown file in the current working directory with shell syntax or option-like content in its filename. 2. The attacker asks the Agent to convert that file. 3. The file passes the documented checks because it is relative, exists in the current directory, and contains no prohibited traversal sequence. 4. The Agent substitutes the filename into the documented Bash command. 5. Bash interprets the embedded shell syntax. 6. Attacker-controlled commands execute with the same operating-system privileges as the Agent process. ### Impact Assessment Successful exploitation can provide ar ...[truncated 407 chars]- Remediation
View remediation
