T09 · Insecure Skill Coding Practices
- Location
SKILL.md:15- Finding
Potential Shell Command Injection Through Unescaped Calendar Fields
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 15–32
Vulnerability Type: Command injection through unsafe command construction
Risk Level: Mediummarkdown When user confirms "add to calendar": 1. Create events for key milestones using gog: - ✈️ Flights (with terminal, timing) - 🏨 Hotel check-in / check-out (with address) - 🥾 Major activities (treks, tours) - 🚕 Major transport 2. Command format: gog calendar create primary --summary "✈️ DEL→KLU 6E-2041" --from "2026-03-14T06:00:00+05:30" --to "2026-03-14T07:30:00+05:30" --location "DEL Terminal 1" --description "Reach airport by 4:30 AM" 3. Use emojis in titles: ✈️ flights, 🏨 hotels, 🥾 treks, 🚕 transport 4. Include location and useful details in description ## Boarding pass parsing When user sends boarding pass image: 1. Extract: flight number, date, time, origin, destination, gate/terminal 2. Confirm with user 3. On confirmation, create calendar eventTechnical Analysis
The skill directs the agent to extract calendar fields from user messages or boarding-pass images and place them into a command-line template. Fields such as the summary, location, and description are therefore untrusted input.
The instructions do not require validation, escaping, or execution through a structured argument-array API. If an implementation interpolates these values into a command string and passes that string to a shell, embedded quotation marks, command substitutions, separators, or other shell metacharacters could terminate the intended argument and introduce additional shell operations.
Explicit confirmation prevents calendar modifications without user approval, but it does not neutralize malicious syntax contained in the confirmed event data. Exploitability depends on the agent's command-execution mechanism: direct process execution with separate arguments would substantially mitigate the issue, while shell-based str ...[truncated 1304 chars]
- Remediation
View remediation
Remediation Suggestions
- Invoke
gogdirectly through a process API using a structured argument array. Do not construct a shell command by concatenating itinerary fields. - Explicitly state in the skill instructions that calendar values must never be passed through
sh -c,bash -c, or an equivalent shell interpreter. - Validate structured fields using strict allowlists:
- Parse dates and times with a recognized date-time parser.
- Restrict flight numbers to the expected airline and numeric format.
- Validate airport codes against an expected format or known set.
- Reject null bytes and control characters from all text fields.
- Preserve summaries, locations, and descriptions as literal process arguments. If shell execution is unavoidable, use platform-appropriate escaping supplied by a well-tested library rather than custom quoting.
- Display normalized event values during confirmation so the user approves exactly what will be sent to the calendar API.
- Run calendar automation with the minimum required permissions and avoid exposing unrelated credentials or sensitive environment variables to the command process.
- Invoke
