T09 · Insecure Skill Coding Practices
- Location
SKILL.md:48- Finding
Shell Command Injection Through Unquoted User-Controlled Ledger Fields
- Content
View full analysis
\ --amount \ --currency \ --description \ --tags \ --source manual \ --batch manual ``` ### Technical Analysis The skill directs the Agent to construct a shell command by substituting values parsed from natural-language user input into command arguments. The `direction`, `amount`, `currency`, `description`, and `tags` placeholders are not quoted, escaped, or subject to documented strict validation. If the Agent performs direct textual substitution and executes the resulting string through a shell, shell metacharacters contained in an attacker-controlled field can alter command structure. Characters and constructs such as semicolons, command substitutions, pipes, redirections, or logical operators may consequently be interpreted by the shell instead of being passed to the Python script as literal data. The vulnerability is especially relevant to `description` and `tags`, which are expected to contain arbitrary natural-language text. Numeric and enumerated fields also require validation because quoting alone does not guarantee that their values satisfy the intended schema. The referenced `projects/scripts/add_ledger_entry.py` implementation is not present in the audited project, so this finding concerns the unsafe execution pattern documented by the skill. Exploitation requires an Agent or wrapper to convert this template into a shell command through direct interpolation. ### Attack Path 1. An attacker submits an expense message containing shell syntax in a parsed field such as the description or tags. 2. The skill instructs the Agent to map tha ...[truncated 1032 chars]- Remediation
View remediation
