T09 · Insecure Skill Coding Practices
- Location
SKILL.md:23- Finding
Unsafe interpolation of user-controlled values into documented shell commands
- Content
View full analysis
mileage add --car ID --mileage KM [--datetime DT] [--note NOTE] mileage list --car ID mileage delete refuel add --car ID --liters L --cost C --mileage KM [--datetime DT] [--note NOTE] refuel list --car ID refuel delete refuel consumption --car ID ``` The documented workflow subsequently shows these values being inserted into shell command templates: ```bash bun scripts/carlog.js mileage add --car --mileage bun scripts/carlog.js refuel add --car --liters --cost --mileage bun scripts/carlog.js maintenance add --car --mileage [--cost ] ``` ### Technical Analysis The Skill directs an AI agent to invoke the utility through shell commands while accepting user-derived vehicle names, plates, notes, dates, and numeric values. It does not require structured process invocation, shell-free argument arrays, or robust quoting of dynamic arguments. If an implementing agent directly substitutes a user-provided value into one of these templates and executes the resulting string through a shell, shell metacharacters may terminate or modify the intended command. The JavaScript utility itself uses parameterized SQL and is not the source of this command-injection risk; the vulnerable boundary is the Skill's command-construction guidance. Exploitability depends on the agent's tool interface. Invocation through a shell with direct interpolation is vulnerable, whereas an execution API that passes a fixed executable and separate argument array is not. ### Attack Path 1. The user asks the agent to add or update a record containing a crafted name, plate, note, or date. 2. The crafted value includes a shell separator, command substitution, redirection, or another shell metacharac ...[truncated 1032 chars]- Remediation
View remediation
