T09 · Insecure Skill Coding Practices
- Location
skill.py:195- Finding
Unrestricted Local File Upload to Google Drive
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This Google integration is mostly coherent, but it grants broad read/write/delete access to Gmail, Calendar, Drive, and local files without enough safeguards.
Install only if you are comfortable granting this skill broad ongoing access to your Gmail, Calendar, Drive, and local files. Use a dedicated Google account or least-privilege OAuth app where possible, review each destructive action before invoking it, avoid uploading sensitive local paths, restrict download destinations manually, and revoke/delete google_suite_tokens.json if you no longer trust the environment.
skill.py:195Unrestricted Local File Upload to Google Drive
skill.py:204Arbitrary Local File Creation and Overwrite During Drive Download
skill.py:58OAuth Refresh Credentials Stored in an Unprotected Plaintext File
requirements.txt:1Unbounded Dependency Versions and Non-Reproducible Installation
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
]
TOKEN_PATH = Path(__file__).parent / 'google_suite_tokens.json'
CREDENTIALS_PATH = Path(__file__).parent / 'google_suite_credentials.json'
def get_skill_info():
This function deletes Gmail messages, which is a destructive operation, but it executes immediately with no confirmation prompt, warning, or user-visible disclosure. The file-level description is too general to count as a warning about destructive mailbox changes.
Deleting calendar events is a destructive action that can affect user data and scheduling integrity. The implementation performs the delete directly with no confirmation step and no user-facing disclosure in the code or skill description.
This function deletes files from Google Drive, which is an irreversible or destructive user-data operation. It proceeds with no confirmation prompt, warning, or explicit user-facing disclosure.
The skill advertises destructive capabilities across Gmail, Calendar, and Drive, including deleting emails, deleting events, and deleting files, but provides no explicit warning, confirmation, or approval guidance for high-impact actions. In an agentic context, this increases the risk of accidental or socially engineered destructive operations against a user's Google account and data.
The skill requests broad Google OAuth scopes, including full calendar and drive access plus Gmail modify/send permissions, and states that tokens are persisted locally in a JSON file without any privacy warning or storage hardening details. If an agent, local process, or attacker gains access to the token file, they may obtain durable access to sensitive email, files, and calendar data with the ability to read, modify, and delete content.
The comment at L014 says the scopes are for Gmail, Calendar, and Drive, but the listed Gmail scopes and later handlers implement write-capable behavior including send, modify, and delete. This is not just incomplete documentation: the nearby comments and grouping suggest a neutral API-access description while the code performs destructive and message-sending actions.
The skill persists OAuth tokens to a local file without any disclosure, consent flow notice, or apparent permission hardening. Stored tokens can grant long-lived access to Gmail, Calendar, and Drive, so local compromise, accidental inclusion in backups, or workspace sharing could expose highly sensitive account access.
This function reads a local file path and uploads the file to Google Drive, transmitting user data over the network. There is no prompt, warning, or visible disclosure that local file contents will be sent to an external service.
The download function writes remote content to an arbitrary caller-supplied destination path with no validation or confinement. In an agent or automation environment, this can enable overwriting arbitrary files accessible to the process, causing data loss, persistence, or configuration tampering depending on where the file is written.
The dependency uses a lower-bound specifier only, which allows installation of any newer version, including versions with breaking changes or newly introduced malicious/transitive supply-chain issues. While this is common practice and not inherently malicious, it reduces build reproducibility and weakens control over what code is installed.
google-api-python-client>=2.0.0
google-auth-httplib2>=0.1.0
google-auth-oauthlib>=0.4.0
This dependency is not pinned to an exact version, so future installs may resolve to different releases over time. That increases exposure to supply-chain risk and makes environments less reproducible, even if the package itself is legitimate and widely used.
google-api-python-client>=2.0.0
google-auth-httplib2>=0.1.0
google-auth-oauthlib>=0.4.0
Using only a minimum version permits any later release to be installed, which can unexpectedly pull in vulnerable, incompatible, or compromised versions and their transitive dependencies. In a security-sensitive environment, that weakens change control over third-party code.
google-api-python-client>=2.0.0
google-auth-httplib2>=0.1.0
google-auth-oauthlib>=0.4.0
No suspicious patterns detected.