T05 · Unauthorized Access and Privilege Escalation
- Location
scripts/google_workspace.py:23- Finding
All Commands Request Excessive Cross-Service Google Workspace Permissions
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is a real Google Workspace automation tool, but it requests and stores broad account access with limited guardrails, so it should receive manual review before installation.
Install only if you are comfortable granting broad Google Workspace access. Prefer a dedicated least-privilege account, avoid domain-wide delegation unless required, keep token files in a private directory, review any Drive public-sharing or calendar-deletion command before use, and revoke tokens if the machine or token file may be exposed.
scripts/google_workspace.py:23All Commands Request Excessive Cross-Service Google Workspace Permissions
scripts/google_workspace.py:47OAuth Refresh Token Is Stored Without Enforced Restrictive Permissions
SKILL.md:91Dependency Installation Instructions Use Unpinned Package Versions
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
export GOOGLE_CREDENTIALS_FILE="/path/to/credentials.json"
export GOOGLE_TOKEN_FILE="/path/to/token.json" # created on first run
The skill advertises capabilities that can access environment variables, write files, and use the network, but it does not declare any explicit tool scope or permission boundaries. For a Google Workspace automation skill, this creates a meaningful trust and review gap because the skill can potentially access sensitive credentials and perform broad remote actions without clear user-facing restrictions.
The description presents powerful Gmail, Calendar, Drive, and Sheets actions as routine automation but omits warnings that the skill may read private mail, modify or delete calendar events, upload/download Drive content, share files publicly, and write spreadsheet data. This increases the risk of unsafe use because users may grant broad credentials without understanding the scope or destructive potential.
When OAuth credentials are refreshed or obtained, the code persists the token to ~/.google_token.json or another configured path, but there is no user-facing disclosure that credential material will be stored on disk. Writing authentication tokens locally is a safety-relevant file write involving sensitive data and should be disclosed.
The OAuth token path is taken directly from the GOOGLE_TOKEN_FILE environment variable and then opened for writing without validation. In an agent/tooling context, an attacker who can influence environment configuration could cause credential material to be written to an unintended location, enabling overwrite of sensitive files or placement of tokens in world-readable or attacker-accessible paths.
else:
flow = InstalledAppFlow.from_client_secrets_file(creds_file, SCOPES)
creds = flow.run_local_server(port=0)
with open(token_file, "w") as f:
f.write(creds.to_json())
return creds
The cal_delete function performs a destructive remote operation by deleting a calendar event immediately, but there is no confirmation prompt, warning message, or explanatory comment/docstring disclosing that behavior. For a code file, destructive or irreversible operations should have some visible user disclosure unless clearly covered elsewhere.
This command can create new Drive permissions, including public 'anyone' links, with no guardrails, confirmation, or policy checks. In an agent skill with broad Google Workspace scopes, this materially raises the risk of accidental or induced data exposure, especially if an upstream prompt or workflow can trigger sharing of sensitive files.
The drive_download function writes downloaded content to a local file via open(output, "wb"), but the code provides no warning, prompt, or explanatory comment that a filesystem write will occur. File writes are in scope for missing-warning checks when there is no visible disclosure.