Back to skill

Security audit

Gsuite Sdk

Security checks for vulnerabilities and agentic risk

Overview

The skill is coherent for Google Workspace automation, but it enables broad persistent access to Gmail, Drive, Calendar, and Sheets with mutating account actions that deserve review before installation.

Install only if you trust the gsuite-sdk package source, use a virtual environment if possible, grant the narrowest Google OAuth scopes needed, protect credentials.json and tokens.db, and require explicit user confirmation before sending email, uploading files, creating events, or editing spreadsheets.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T08 · Insecure Dependencies

Warning
Location
SKILL.md:8
Finding
Unpinned Third-Party Package Installation<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:8-10`; additional installation examples at `SKILL.md:22, 26-27` **Vulnerability Type**: Unpinned and unverifiable third-party dependency **Risk Level**: Medium ### Complete Code Snippet ```yaml install: - kind: pip package: gsuite-sdk bins: [gsuite] ``` ```bash pip install gsuite-sdk ``` ```bash pip install gsuite-sdk[cloudrun] # Optional Secret Manager dependencies pip install gsuite-sdk[all] # All dependencies ``` ### Technical Analysis The skill directs users or agents to install `gsuite-sdk` from PyPI without specifying an audited version or cryptographic hashes. It also recommends optional dependency groups that expand the number of packages installed. The project contains no lockfile, hash-validated requirements file, vendored source, or package implementation with which to verify the installed artifacts. A Python package installation can execute package-controlled build or installation logic. Consequently, the effective code installed by these commands may change after this skill has been reviewed. The declared GitHub homepage does not cryptographically bind the downloaded PyPI artifact to the repository. This finding does not establish that the current package is malicious. It identifies a supply-chain weakness through which a compromised publisher account, malicious release, or compromised transitive dependency could introduce attacker-controlled code. ### Attack Path 1. An attacker compromises the package publisher, distribution channel, or one of the unpinned transitive dependencies. 2. The attacker publishes a malicious version or modifies an available dependency artifact. 3. A user or agent follows the skill instructions and runs `pip install gsuite-sdk`, `pip install gsuite-sdk[cloudrun]`, or `pip install gsuite-sdk[all]`. 4. The package manager resolves the uncontrolled version and downloads the attacker-controlled artifact. 5. Malicious build, installation, ...[truncated 1106 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Pin `gsuite-sdk` to a specifically reviewed version rather than allowing unrestricted resolution. 2. Maintain a lockfile or hash-validated requirements file containing all direct and transitive dependencies. 3. Install with hash verification, such as `pip install --require-hashes -r requirements.txt`. 4. Verify the package publisher, release provenance, signatures where available, and correspondence between the reviewed source revision and the published artifact. 5. Review package build metadata and installation hooks before approving the dependency. 6. Avoid broad extras such as `[all]` unless every additional package is necessary and audited. 7. Install the package in an isolated virtual environment or sandbox under a non-privileged account. 8. Grant only the Google OAuth scopes required for the current task rather than the default scope set. 9. Protect `credentials.json`, the file referenced by `GOOGLE_CREDENTIALS_FILE`, and `tokens.db` with restrictive filesystem permissions. 10. Add automated dependency scanning and controlled update review so new versions are not adopted without security validation. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (4)

Credential Access

High
Category
Privilege Escalation
Content
### Primera vez (requiere navegador)

El usuario debe obtener `credentials.json` de Google Cloud Console y luego autenticarse:

```bash
# Via CLI
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
2. **Tokens persisten** - Después de autenticar, los tokens se guardan en `tokens.db` y se refrescan automáticamente
3. **Scopes** - Por defecto pide acceso a Gmail, Calendar, Drive y Sheets. Se puede limitar con `--scopes`
4. **Errores comunes:**
   - `CredentialsNotFoundError`: Falta `credentials.json`
   - `TokenRefreshError`: Token expiró y no se pudo refrescar (re-autenticar)
   - `NotFoundError`: Recurso no existe o sin permisos
Confidence
77% confidence
Finding
The skill states that tokens persist in a local tokens.db and refresh automatically, but it does not describe protections for that token store such as encryption, file permissions, or secure secret storage. In a multi-user, shared-agent, or compromised host context, persisted OAuth tokens can enable continued access to Gmail, Drive, Calendar, and Sheets without reauthentication.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The skill documents powerful read/write operations against Gmail, Drive, Calendar, and Sheets, including sending email, uploading files, downloading documents, and modifying spreadsheet data, but it does not prominently warn that these actions can access sensitive user data and make irreversible changes in external services. In an agent context, this omission is risky because an operator may invoke examples or capabilities without understanding that they affect live accounts and persisted cloud resources.

Natural-Language Policy Violations

Low
Confidence
96% confidence
Finding
SQP-3 applies to all file types and includes language or locale policy violations. The descriptive content begins in Spanish and the rest of the instructions continue in Spanish, but there is no opt-in, alternative language option, or statement that the skill is intended only for a Spanish-speaking context.

Static analysis

No suspicious patterns detected.