T09 · Insecure Skill Coding Practices
Error
- Location
SKILL.md:20- Finding
Shell Command Injection Through Unsafely Interpolated Gmail Draft Parameters
- Content
View full analysis
--body "..." --json`] ## Schema Example ```json { "command": "gog gmail drafts update draft_id_123 --body \"Please review the attached invoice.\" --json" } ``` ``` ### Technical Analysis The skill instructs the agent to construct and execute a terminal command by placing the draft identifier and message body directly into a command string. It does not require an argument-array execution API, define validation rules for `draftId`, or specify robust shell escaping for the body. Wrapping the body in double quotes is not sufficient protection when a shell interprets the resulting string. An attacker-controlled value can contain a closing quote, command substitution syntax, shell metacharacters, or other shell-specific constructs. These characters may terminate the intended argument and introduce an additional command. The draft identifier is similarly represented as a directly substituted command token without validation. The documented retry loop may cause a failed maliciously constructed command to be executed repeatedly, although successful injected commands would depend on how the calling agent evaluates failure and retries. ### Attack Path 1. An attacker influences the draft body or draft identifier supplied to the skill. 2. The attacker includes shell syntax designed to escape the intended command argument, such as a closing quote followed by a command separator and another command. 3. The agent interpolates the value into the documented `gog gmail drafts update` command. 4. The agent executes the constructed string through a shell-capable terminal interface. 5. The shell pars ...[truncated 1059 chars]- Remediation
View remediation
