T09 · Insecure Skill Coding Practices
- Location
SKILL.md:114- Finding
Shell Command Injection Through Unsanitized Vaccination Data
- Content
View full analysis
(第<剂次>针)" \ --date "" \ --time "10:00" \ --duration 60 \ --notes "<疫苗说明>" \ --calendar "育儿提醒" ``` ### Technical Analysis The Skill instructs the Agent to insert a vaccine name, dose number, date, and notes into a shell command. These values can originate from user input, but the documented flow does not require validation, sanitization, or shell-safe argument handling before execution. Double quotation marks do not make arbitrary input safe when an Agent constructs and executes a shell command. An attacker could provide input containing a closing quotation mark, command substitution such as `$(...)`, backticks, or other shell metacharacters. If the Agent incorporates that value into the command as documented, the shell can interpret attacker-controlled syntax rather than treating the entire value as inert data. The external calendar script is not included in this project and was therefore outside the reviewed code. The vulnerability arises before that script processes its arguments: the shell may evaluate injected syntax while parsing the command. ### Attack Path 1. An attacker submits a vaccination statement containing a crafted vaccine name or description. 2. The Skill directs the Agent to calculate the next dose and automatically invoke the calendar command. 3. The Agent substitutes the attacker-controlled text into the `--title` or `--notes` value. 4. The Agent sends the constructed command to a shell without robust escaping or an argument-array process API. 5. The shell evaluates the injected command substitution or metacharacters. 6. The injected operating-system command runs with the same permissions and environ ...[truncated 1048 chars]- Remediation
View remediation
