T09 · Insecure Skill Coding Practices
- Location
SKILL.md:41- Finding
Shell Command Injection Through User-Controlled CLI Arguments
- Content
View full analysis
--week --task "" --category "" --date "" --priority "" ``` ```bash python scripts/weekly_planner.py add_completion --year --week --task_id --notes "" ``` ```bash python scripts/weekly_planner.py add_reflection --year --week --date "" --content "" ``` ```bash python scripts/weekly_planner.py update_plan --year --week --task_id --field "" --value "" ``` ```bash python scripts/weekly_planner.py query_by_category --year --week --category "" ``` ### Technical Analysis The Skill instructs the hosting agent to place natural-language values directly inside double-quoted shell command arguments. The affected values include task descriptions, completion notes, reflections, updated field values, and categories. Double quotes do not prevent shell command substitution. If the hosting agent constructs and executes these examples as shell command strings, values containing constructs such as `$(...)` or backticks are interpreted by the shell before `weekly_planner.py` receives them. Quotation marks embedded in input can also terminate the intended argument and introduce additional shell syntax. The Python program uses `argparse` and does not itself invoke a shell. The vulnerability is introduced by the documented execution pattern rather than by `argparse`. Exploitation therefore applies when the agent follows these templates through a shell or another command-string execution interface. Structured process invocation with an argument array would not have this flaw. ## ...[truncated 1332 chars]- Remediation
View remediation
