Back to skill

Security audit

Google Power Tools

Security checks for vulnerabilities and agentic risk

Overview

This skill is a coherent Google Workspace helper, but it asks for very broad account access and documents live send, edit, and delete actions without enough scoping or confirmation guidance.

Review this before installing if you use Google Workspace for sensitive personal or business data. Prefer service-specific OAuth scopes, avoid full authorization unless you truly need comprehensive Workspace management, verify every recipient/file/calendar/sheet ID before mutating actions, and be cautious with file-backed credentials and global npm installation.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (2)

T08 · Insecure Dependencies

Warning
Location
references/setup.md:8
Finding
Unpinned Global Installation of a Security-Sensitive npm Dependency<![CDATA[ ## Vulnerability Details **File Location**: `references/setup.md:8-11`; related installer metadata at `SKILL.md:16-25` **Vulnerability Type**: Unpinned third-party dependency installed globally **Risk Level**: Medium ### Vulnerable Code `references/setup.md:8-11`: ```bash npm install -g @googleworkspace/cli ``` Related package metadata in `SKILL.md:16-25`: ```json "install": [ { "id": "npm", "kind": "npm", "package": "@googleworkspace/cli", "global": true, "bins": ["gws"], "label": "Install gws CLI (npm)" } ] ``` ### Technical Analysis The Skill installs the latest version of `@googleworkspace/cli` without pinning a reviewed version or enforcing package integrity. The installation is global, increasing its effect beyond this project and exposing every process using the same npm prefix to the installed executable. An npm package or one of its transitive dependencies can execute lifecycle scripts during installation. Because the package version is unresolved until installation time, its effective implementation may change after this Skill has been audited. This creates a supply-chain trust gap even though the documented package name and linked repository are consistent with the declared Google Workspace CLI. The risk is amplified because the installed CLI is subsequently given access to sensitive Google Workspace OAuth credentials and data. No evidence establishes that the current package is malicious; the vulnerability is the absence of version and integrity controls. ### Attack Path 1. An upstream release, maintainer account, publication process, or transitive dependency is compromised. 2. The attacker publishes a malicious package version under the expected package name or introduces malicious dependency behavior. 3. A user follows the Skill instructions and runs the unpinned global installation. 4. npm resolves the compromised version and may execute its lifecycle code with the installing user's privileges. 5. T ...[truncated 836 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Pin the dependency to a specifically reviewed version, for example: ```bash npm install -g @googleworkspace/cli@<reviewed-version> ``` 2. Prefer a project-local installation with a committed lockfile over global installation: ```bash npm install --save-exact @googleworkspace/cli@<reviewed-version> ``` 3. Verify registry provenance, package signatures or attestations where available, and expected package integrity before installation. 4. Review transitive dependencies and npm lifecycle scripts for each upgrade. 5. Disable lifecycle scripts during installation when compatible with the package: ```bash npm install --ignore-scripts --save-exact @googleworkspace/cli@<reviewed-version> ``` 6. Run the CLI as an unprivileged user and avoid `sudo npm install -g`. 7. Document an explicit upgrade-review process rather than silently resolving the latest release each time. ]]>

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
SKILL.md:38
Finding
Full Google Workspace OAuth Authorization Is Recommended for Narrow Tasks<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:38-44`, `SKILL.md:310-316`; `references/setup.md:72-84`, `references/setup.md:111-115`, and `references/setup.md:127-131` **Vulnerability Type**: Excessive OAuth authorization beyond task-specific requirements **Risk Level**: Medium ### Vulnerable Code Primary setup instructions in `SKILL.md:38-44`: ```bash export GOOGLE_WORKSPACE_PROJECT_ID=<your-project-id> export GOOGLE_WORKSPACE_CLI_KEYRING_BACKEND=file gws auth login # first-time auth gws auth login --full # re-auth with all scopes if 403 error ``` Troubleshooting guidance in `SKILL.md:310-316`: ```markdown | Issue | Solution | |-------|----------| | 403 Insufficient scopes | `gws auth login --full` | | No OAuth client | Check `~/.config/gws/client_secret.json` | | API not enabled | Enable in GCP Console → APIs & Services | | jq parse error | Add `tail -n +2` to skip keyring prefix | | Upload shows "Untitled" | Rename with `files update` after upload | | File not found on upload | Use relative paths, `cd` first | ``` Authorization alternatives in `references/setup.md:72-84`: ```bash export GOOGLE_WORKSPACE_PROJECT_ID=your-project-id export GOOGLE_WORKSPACE_CLI_KEYRING_BACKEND=file # Full authorization (all services) gws auth login --full # Or authorize only specific services gws auth login -s gmail,drive,calendar ``` The instructions then state that authorization credentials are stored at: ```text ~/.config/gws/credentials.enc ``` Scope-error recovery in `references/setup.md:111-115`: ```bash rm ~/.config/gws/token_cache.json gws auth login --full ``` Complete reauthorization in `references/setup.md:127-131`: ```bash rm ~/.config/gws/credentials.enc rm ~/.config/gws/token_cache.json gws auth login --full ``` ### Technical Analysis The Skill can be activated for a narrow operation, such as listing one calendar event, reading one email, or updating one spreadsheet. Nevertheless, its primary setup and generic authorizat ...[truncated 2654 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Make service-specific authorization the documented default: ```bash gws auth login -s gmail ``` Replace `gmail` with only the service required for the current task. 2. Determine the exact missing scope from the failed operation instead of treating every 403 response as a reason for full authorization. 3. Require explicit user confirmation before adding a new service or any write-capable scope. 4. Separate read-only and write-capable workflows where the CLI supports corresponding OAuth scopes. 5. Remove the expectation that a valid setup must report 12 or more scopes. Validate only the scopes needed for the requested operation. 6. Reserve `--full` for users who explicitly request comprehensive Workspace management and clearly disclose the affected services and privileges before authorization. 7. During reauthorization, preserve least privilege: ```bash rm -- ~/.config/gws/token_cache.json gws auth login -s <required-service> ``` 8. Document token revocation procedures through the Google Account security interface, not only local cache deletion. 9. Document the file-keyring threat model, encryption-key location, and required restrictive permissions for `~/.config/gws`. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
Findings (28)

Vague Triggers

High
Confidence
98% confidence
Finding
The skill’s invocation guidance is excessively broad, matching very common terms like 'email', 'presentation', and effectively any Google Workspace-related request. This can cause unintended activation in unrelated contexts and may route user requests into a high-privilege tool capable of reading, sending, deleting, or modifying cloud data, increasing the chance of accidental external side effects.

Credential Access

High
Category
Privilege Escalation
Content
{
            "bins": ["gws", "jq", "base64", "python3"],
            "env": ["GOOGLE_WORKSPACE_PROJECT_ID", "GOOGLE_WORKSPACE_CLI_KEYRING_BACKEND"],
            "config": ["~/.config/gws/client_secret.json"]
          },
        "install":
          [
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
{
            "bins": ["gws", "jq", "base64", "python3"],
            "env": ["GOOGLE_WORKSPACE_PROJECT_ID", "GOOGLE_WORKSPACE_CLI_KEYRING_BACKEND"],
            "config": ["~/.config/gws/client_secret.json"]
          },
        "install":
          [
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
{
            "bins": ["gws", "jq", "base64", "python3"],
            "env": ["GOOGLE_WORKSPACE_PROJECT_ID", "GOOGLE_WORKSPACE_CLI_KEYRING_BACKEND"],
            "config": ["~/.config/gws/client_secret.json"]
          },
        "install":
          [
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
{
            "bins": ["gws", "jq", "base64", "python3"],
            "env": ["GOOGLE_WORKSPACE_PROJECT_ID", "GOOGLE_WORKSPACE_CLI_KEYRING_BACKEND"],
            "config": ["~/.config/gws/client_secret.json"]
          },
        "install":
          [
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
```bash
export GOOGLE_WORKSPACE_PROJECT_ID=<your-project-id>
export GOOGLE_WORKSPACE_CLI_KEYRING_BACKEND=file
gws auth login          # first-time auth
gws auth login --full   # re-auth with all scopes if 403 error
```
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
```bash
export GOOGLE_WORKSPACE_PROJECT_ID=your-project-id
export GOOGLE_WORKSPACE_CLI_KEYRING_BACKEND=file

# 完整授权(所有服务)
gws auth login --full
Confidence
89% confidence
Finding
The guide explicitly sets GOOGLE_WORKSPACE_CLI_KEYRING_BACKEND=file, indicating credentials will be stored in files instead of a system keychain/secure secret store. In a skill handling broad Google Workspace access, file-based token storage materially increases the risk of token theft from disk, backups, or other local compromise.

Tool Parameter Abuse

High
Category
Tool Misuse
Content
### "Insufficient authentication scopes" (403)

```bash
rm ~/.config/gws/token_cache.json
gws auth login --full
```
Confidence
85% confidence
Finding
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Tool Parameter Abuse

High
Category
Tool Misuse
Content
### "Insufficient authentication scopes" (403)

```bash
rm ~/.config/gws/token_cache.json
gws auth login --full
```
Confidence
85% confidence
Finding
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Tool Parameter Abuse

High
Category
Tool Misuse
Content
### 完全重新授权

```bash
rm ~/.config/gws/credentials.enc
rm ~/.config/gws/token_cache.json
gws auth login --full
```
Confidence
85% confidence
Finding
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Tool Parameter Abuse

High
Category
Tool Misuse
Content
- 建议使用专用的 GCP 项目,并定期审查已授权的应用
   - 考虑使用 Service Account 或 Domain-wide Delegation 作为更安全的替代方案
3. 确认后点击 **"PUBLISH APP"**
4. 删除旧 token:`rm ~/.config/gws/token_cache.json`
5. 重新授权:`gws auth login --full`

**注意**:切换到 Production 后**必须重新授权**一次,之前的 token 仍然是 7天过期的。
Confidence
85% confidence
Finding
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Credential Access

High
Category
Privilege Escalation
Content
```bash
export GOOGLE_WORKSPACE_PROJECT_ID=your-gcp-project-id
export GOOGLE_WORKSPACE_CLI_KEYRING_BACKEND=file
```
Confidence
89% confidence
Finding
Persisting the recommendation to export a file-based keyring backend in shell startup files normalizes long-term insecure storage for high-value OAuth tokens. That increases the blast radius by making insecure credential handling persistent across sessions and commands.

Session Persistence

Medium
Category
Rogue Agent
Content
---
name: gws
description: "Google Workspace CLI. Make sure to use this skill whenever the user mentions Gmail, email, inbox, send email, read email, check mail, draft email, send invite; Google Drive, upload file, download file, cloud storage, share file; Google Docs, create a document, write a doc; Google Calendar, schedule meeting, check schedule, view events, agenda, share calendar; Google Sheets, spreadsheet; Google Slides, make a slide, presentation; Google Forms, survey, create a form; Google Tasks, to-do, reminder; Google Meet, meeting recording; Contacts, People, address book, contact list; Classroom — or any Google Workspace / G Suite operation, even if they don't say 'gws'. If authorization fails or scope is missing, guide the user through the complete OAuth setup process."
license: MIT
homepage: https://github.com/googleworkspace/cli
metadata:
Confidence
60% confidence
Finding
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The skill documents many commands that create, modify, send, share, delete, or otherwise change Google Workspace resources, but it does not embed clear operational guardrails about user consent and side effects. In an agent setting, this raises the risk of sending emails, changing calendar events, editing documents, or altering Drive contents without sufficiently explicit confirmation.

Missing User Warnings

Medium
Confidence
90% confidence
Finding
The reference documentation includes destructive commands such as `gws calendar events delete` and `gws calendar calendars delete` with no surrounding warning, confirmation guidance, or safe-usage context. In an agent skill focused on Google Workspace operations, this increases the chance that an agent or user may invoke deletion commands directly against real calendar data, causing unintended loss of events or entire calendars.

Missing User Warnings

Medium
Confidence
92% confidence
Finding
The reference includes a destructive delete command with no warning, confirmation pattern, or recovery guidance. In the context of a Google Workspace skill, where agents may act on user files at scale, this makes accidental or coerced deletion materially more dangerous and can lead to irreversible data loss.

Intent-Code Divergence

Medium
Confidence
93% confidence
Finding
The documentation normalizes an unexpected `saved_file` value on a delete operation and tells operators to ignore it, which can mask incorrect or misleading tool behavior. In a Google Drive skill handling sensitive user data, this increases the chance that users overlook unintended filesystem writes, failed deletes, or tampered command behavior.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The examples for reply, reply-all, forward, and send demonstrate outbound email actions without warnings about privacy, recipient verification, or the fact that these actions send data externally. In a Google Workspace agent skill, this is more dangerous because the skill is explicitly meant to be used for live Gmail operations, so examples may normalize sending or forwarding sensitive content without adequate user confirmation.

Missing User Warnings

Medium
Confidence
92% confidence
Finding
This reference includes state-changing Gmail operations such as batchModify and modify that can mark messages read, star them, or remove them from the inbox without any warning about irreversible or user-visible effects. In an agent skill context, cookbook-style examples can be operationalized directly by an LLM or user, increasing the risk of unintended mailbox modification at scale.

Missing User Warnings

Medium
Confidence
90% confidence
Finding
Attachment download and trash/untrash examples are presented as straightforward commands without cautionary guidance about sensitive-file handling, destination safety, or mailbox state changes. Within this skill's context, attachment retrieval can expose confidential data to local storage and trash operations can alter retention and user workflow, making these examples riskier than generic documentation.

Session Persistence

Medium
Category
Rogue Agent
Content
### 2.3 OAuth 凭证

1. 访问 `apis/credentials` → "+ CREATE CREDENTIALS" → "OAuth client ID"
2. 应用类型:**Desktop app**
3. 下载 JSON → 保存为 `~/.config/gws/client_secret.json`
Confidence
77% confidence
Finding
This duplicate finding points to the same behavior: establishing a desktop OAuth flow that results in persistent local credentials for sensitive Workspace access. Combined with broad scopes and production-mode guidance, it increases the risk of unauthorized long-term account access if those credentials are exposed.

Session Persistence

Medium
Category
Rogue Agent
Content
### 2.3 OAuth 凭证

1. 访问 `apis/credentials` → "+ CREATE CREDENTIALS" → "OAuth client ID"
2. 应用类型:**Desktop app**
3. 下载 JSON → 保存为 `~/.config/gws/client_secret.json`
Confidence
77% confidence
Finding
This duplicate finding points to the same behavior: establishing a desktop OAuth flow that results in persistent local credentials for sensitive Workspace access. Combined with broad scopes and production-mode guidance, it increases the risk of unauthorized long-term account access if those credentials are exposed.

Missing User Warnings

Medium
Confidence
90% confidence
Finding
This markdown reference includes commands to clear cell ranges and delete rows, both of which can remove user data, but it does not provide any warning about data loss or advise verifying the target spreadsheet/range first. Under the markdown-file criteria, examples that affect user data should disclose potentially destructive behavior.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
The reference includes destructive task operations (`delete` and `clear`) with no caution, confirmation guidance, or indication that the actions are irreversible. In a skill intended to be used whenever users mention Google Workspace actions, these examples can normalize unsafe copy-paste use and increase the chance of accidental data loss in a real account.

Missing User Warnings

Low
Confidence
85% confidence
Finding
This markdown file provides commands that create and modify Google Docs, Slides, and Forms content, including inserting text, images, slides, and form questions. The examples are operational and data-affecting, but the document does not include any warning or note that these commands will change remote user data.

Static analysis

No suspicious patterns detected.