Back to skill

Security audit

Google Docs Create Document

Security checks for vulnerabilities and agentic risk

Overview

The skill does what it says, but its command template can turn a document title into unsafe shell input if followed literally.

Review this skill before installing or using it. Only use it when you intentionally want a new Google Doc created, and avoid untrusted or unusual document titles unless the invoking agent/tool passes the title as a literal argument to `gog` rather than constructing a shell command string.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:20
Finding
Shell Command Injection Through an Untrusted Document Title<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, line 20 **Vulnerability Type**: OS command injection through unsafe command construction **Risk Level**: High ### Vulnerable Code ```markdown ## Cognitive Directives WHEN [A new Google Doc needs to be created] THEN [Execute the native terminal command `gog docs create <title> --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
<![CDATA[ ## Remediation Suggestions - Do not construct a shell command by concatenating or interpolating the title. - Invoke `gog` through a structured subprocess API with a fixed argument array, equivalent to: ```text ["gog", "docs", "create", user_supplied_title, "--json"] ``` - Explicitly prohibit shell evaluation and avoid APIs that implicitly invoke `/bin/sh`, such as shell-enabled execution modes. - If only a terminal string interface is available, apply robust platform-specific argument escaping to every untrusted value. Simple double-quoting is insufficient. - Validate the title against documented Google Docs requirements and reject control characters, line breaks, and unexpected shell metacharacters where they are not legitimately needed. - Update the directive to distinguish command arguments from shell source code. For example: ```markdown Invoke the `gog` executable directly with argument array `["docs", "create", title, "--json"]`. Do not execute through a shell and do not concatenate `title` into a command string. ``` - Add security tests using titles containing spaces, quotes, semicolons, command substitutions, redirection symbols, and newlines. Confirm that every test value is passed to `gog` as one literal argument and never interpreted by a shell. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (1)

Missing User Warnings

Low
Confidence
93% confidence
Finding
The skill directly instructs the agent to create a Google Doc, which modifies external user data, without any explicit confirmation, scope check, or warning to the user. In an agentic context, even a low-risk write action can cause unintended side effects such as clutter, accidental document creation in the wrong account or workspace, or misuse when triggered by ambiguous prompts.

Static analysis

No suspicious patterns detected.