T09 · Insecure Skill Coding Practices
- Location
SKILL.md:107- Finding
Shell Command Injection Through Interpolated Calendar Fields
- Content
View full analysis
" today +180d ``` ```sh gcalcli --nocolor --calendar "" add --noprompt --title "" --when "<Start>" --duration <minutes> gcalcli --nocolor --calendar "<Cal>" add --noprompt --allday --title "<Title>" --when "<Date>" ``` ```sh echo 'BEGIN:VCALENDAR VERSION:2.0 BEGIN:VEVENT DTSTART;VALUE=DATE:20260308 SUMMARY:Event Title RRULE:FREQ=YEARLY TRANSP:TRANSPARENT END:VEVENT END:VCALENDAR' | gcalcli import --calendar "<Cal>" ``` ```sh gcalcli --nocolor delete --iamaexpert "<query>" <start> <end> ``` ### Technical Analysis The Skill instructs the Agent to substitute dynamic calendar names, event titles, search queries, dates, durations, and generated ICS fields directly into shell command strings. It does not require an argument-array process API, validate these values, or define a safe escaping procedure. Double quotes do not neutralize all shell syntax. For example, command substitutions such as `$(command)` and backtick expressions are still evaluated inside double-quoted strings. An embedded double quote can also terminate the intended argument and introduce shell operators. Similarly, the ICS example uses a single-quoted `echo` payload. An apostrophe in generated event content can terminate that quoted region and allow additional shell syntax. The vulnerability is exploitable when these canonical commands are executed through a shell with attacker-controlled or otherwise untrusted values. Potential sources include a malicious user request and calendar data subsequently reused in another command. ### Attack Path 1. An attacker supplies a crafted event title, query, or calendar name containing shell syntax, such as a command substitution or a quote followed by a shell operator. 2. The Agent inserts the value into one of the docu ...[truncated 1317 chars]- Remediation
View remediation
