T09 · Insecure Skill Coding Practices
Error
- Location
SKILL.md:20- Finding
Shell Command Injection Through Unvalidated Gmail Draft Parameters
- Content
View full analysis
--subject "..." --json`] ## Schema Example ```json { "command": "gog gmail drafts update draft_id_123 --subject \"Invoice\" --json" } ``` ### Technical Analysis The skill instructs the agent to construct and execute a terminal command by interpolating a Gmail draft ID and subject into a command string. The draft ID is unquoted, while the subject is merely enclosed in shell double quotes. No input validation, argument-array execution, or shell-safe escaping is required. If either parameter contains shell metacharacters, the shell may interpret part of the supplied value as additional syntax rather than as a literal `gog` argument. For example: - A draft ID containing `; id` could terminate the intended command and start another command. - A subject containing a closing quote followed by `; id; #` could escape its quoted context and append another command. Double quotes alone are insufficient because embedded quotes, command substitutions, and certain shell expansions can alter command interpretation. ### Attack Path 1. An attacker or untrusted upstream source supplies a malicious Gmail draft ID or subject. 2. The agent follows the skill directive and places that value into the documented command template. 3. The resulting command is submitted to a native terminal or shell. 4. The shell parses attacker-controlled metacharacters as command syntax. 5. An unintended command executes under the same operating-system identity and environment as the agent. ### Impact Assessment Successful exploitation could execute arbitrary local commands with the privileges of the agent process. This may permit access to files, environment variables, locally stored credentials, and authentication material availab ...[truncated 457 chars]- Remediation
View remediation
