T09 · Insecure Skill Coding Practices
- Location
SKILL.md:20- Finding
Shell Command Injection Through an Untrusted Document Title
- Content
View full analysis
--json`] ## Schema Example ```json { "command": "gog docs create \"My New Document\" --json" } ``` ``` ### Technical Analysis The skill instructs the agent to interpolate a document title directly into a terminal command. It does not require structured process invocation, strict title validation, or shell-safe argument escaping. Even if the title is surrounded by double quotes as suggested by the example, shell syntax such as command substitution remains active inside double-quoted strings. A title containing shell metacharacters could therefore alter the command or cause an additional command to execute. For example, a malicious title resembling the following could trigger command substitution if inserted into a shell command: ```text $(id) ``` The resulting command could resemble: ```sh gog docs create "$(id)" --json ``` The shell would run `id` before invoking `gog`. Quote-breaking payloads could similarly append independent commands. Exploitability applies when the agent receives an attacker-controlled title and executes the generated command through a shell rather than passing arguments directly to the executable. ### Attack Path 1. An attacker supplies or influences the requested Google Document title. 2. The title contains shell control syntax, command substitution, or quote-breaking characters. 3. The agent follows the skill directive and substitutes the title into the command template. 4. The generated command is submitted to a shell-enabled terminal tool. 5. The shell interprets the injected syntax and executes attacker-selected commands with the agent process's privileges. ### Impact Assessment Suc ...[truncated 540 chars]- Remediation
View remediation
