T09 · Insecure Skill Coding Practices
- Location
SKILL.md:14- Finding
Unquoted User Input in Documented Shell Command
- Content
View full analysis
``` The same unsafe invocation pattern is repeated in `README.md`: ```bash uv run python chords.py ``` ### Technical Analysis The skill instructs an AI agent to execute a shell command by substituting the user-provided song name and artist into an unquoted command template. If the agent constructs a command string from this template and sends it to a shell, shell metacharacters contained in the song query can be interpreted as shell syntax instead of ordinary Python arguments. Potentially dangerous syntax includes command separators, command substitution, pipes, redirections, and environment-variable expansion. The Python script itself does not invoke a shell, but the documented execution boundary is unsafe because an agent following the instructions may interpolate untrusted input directly into the command. Exploitability depends on whether the agent's `exec` implementation invokes a shell and whether it performs safe argument handling. The documentation neither requires an argument-array API nor mandates shell escaping. ### Attack Path 1. An attacker asks the agent to retrieve chords for a song whose purported name contains shell metacharacters and an additional command. 2. The agent follows `SKILL.md` and substitutes the complete attacker-controlled query into the documented command. 3. The agent submits the constructed command string through a shell-backed execution tool. 4. The shell interprets the injected metacharacters. 5. The additional command executes under the same operating-system identity and permissions as the AI agent. ### Impact Assessment Successful exploitation can execute arbitrary local commands with the privileges ...[truncated 450 chars]- Remediation
View remediation
