Back to skill

Security audit

gdrive-connect-pro

Security checks for vulnerabilities and agentic risk

Overview

ClawScan rates this Google Drive/Sheets skill suspicious because its formatting command can bypass deletion safeguards, and it requests broad Drive access beyond the stated connection-and-test purpose.

Consider the verdict suspicious and review the deletion safeguard bypass, OAuth endpoint override, chat-based credential setup, and broad Drive permissions before installing. The scan was partial because some local references could not be resolved, so it does not establish that the skill is safe or that every relevant detail was covered.

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

Warning
Location
scripts/gdrive_ops.py
Finding

Formatting command bypasses the deletion confirmation gate

Content
View full analysis

Impact

An existing tab and its contents can be deleted without --yes or GDRIVE_ALLOW_DELETE=1 through an operation presented as formatting.

Vulnerability Patterns
  • Output HandlingUnvalidated Output Injection, Cross-Context Output, Unbounded Output
  • Rogue AgentSelf-Modification, Session Persistence
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (12)

Tainted flow: 'req' from os.environ.get (line 82, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
94% confidence
Finding

Sending an authorization code to Google's token endpoint is legitimate, but GD_EXCHANGE_ENDPOINT can redirect that same credential-bearing request to an arbitrary destination without validating its scheme or host. An attacker who can influence the launch environment could capture the authorization code and client configuration; the normal hardcoded Google endpoint is not itself exfiltration.

Content

Scanner excerpt · scripts/gdrive_connect.py (reported line 86)May include surrounding context.

python
url, data=body, headers={"Content-Type": "application/x-www-form-urlencoded"}
    )
    try:
        with urllib.request.urlopen(req, timeout=timeout) as r:
            return json.loads(r.read().decode() or "{}"), None
    except urllib.error.HTTPError as e:
        raw = e.read().decode(errors="replace")

Tainted flow: 'req' from os.environ.get (line 99, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/gdrive_connect.py (reported line 101)May include surrounding context.

python
def get_json(url, session_value, timeout=30):
    req = urllib.request.Request(url, headers={"Authorization": "Bearer " + session_value})
    try:
        with urllib.request.urlopen(req, timeout=timeout) as r:
            return json.loads(r.read().decode() or "{}"), None
    except urllib.error.HTTPError as e:
        raw = e.read().decode(errors="replace")

Tainted flow: 'req' from os.environ.get (line 83, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/gdrive_ops.py (reported line 88)May include surrounding context.

python
headers={"Content-Type": "application/x-www-form-urlencoded"},
    )
    try:
        with urllib.request.urlopen(req, timeout=30) as r:
            res = json.loads(r.read().decode())
    except urllib.error.HTTPError as e:
        out(f"❌ Làm mới phiên thất bại (HTTP {e.code}): {e.read().decode(errors='replace')[:300]}")

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The substantive issue is that unrestricted batchUpdate requests through format can perform destructive operations without the deletion authorization promised by the skill. Listing, editing, explicit deletion commands, and temporary self-test cleanup are otherwise documented features rather than inherently hidden capabilities.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

Requesting full Drive access creates account-wide exposure beyond what is necessary for creating and testing agent-managed spreadsheets; a compromised agent or stolen session could affect unrelated accessible files. However, existing-file operations are disclosed in the skill, and the claim that the real spreadsheet test is absent is incorrect because the workflow explicitly invokes the separate selftest command.

Content

No source excerpt is available for this finding.

The formatting command can delete tabs without the explicitly promised deletion authorization.

High
Category
Excessive Agency
Confidence
99% confidence
Finding

cmd_format forwards arbitrary request objects to Sheets batchUpdate without calling the deletion guard. A deleteSheet request can therefore delete a tab under a formatting operation without --yes or GDRIVE_ALLOW_DELETE, bypassing the stated safety boundary and potentially destroying existing spreadsheet data.

Content

No source excerpt is available for this finding.

The setup instructs users to send OAuth credentials through chat without warning about credential exposure.

Medium
Category
Output Handling
Confidence
96% confidence
Finding

Users are instructed to transmit app credentials through chat, potentially retaining them in messaging infrastructure, transcripts, and agent logs before local file permissions offer any protection. Desktop OAuth client secrets are not strong confidential credentials and do not independently grant Drive access, so the impact of this particular exposure is limited.

Content

No source excerpt is available for this finding.

Skill declares no tool scope ('permissions' or 'allowed-tools') but code capabilities were detected: env, file_write, network, shell.

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
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.

Content

Scanner excerpt · SKILL.md (reported line 115)May include surrounding context.

  1. APIs & Services → Credentials → Create credentials → OAuth client ID → Desktop app → copy về 2 mã: Client ID và mã app thứ hai (ô Client se… trên màn hình).
  2. Lưu 2 mã đó vào tệp ngoài repo, quyền 600:
bash
mkdir -p ~/.config/gdrive-connect && chmod 700 ~/.config/gdrive-connect
printf '{"client_id":"<CLIENT_ID>","client_sec":"<MA_THU_HAI>"}' > ~/.config/gdrive-connect/app.json
chmod 600 ~/.config/gdrive-connect/app.json

The advertised create/write/format Sheet test is not implemented; connection verification only reads account metadata.

Medium
Category
Excessive Agency
Confidence
99% confidence
Finding

The manifest promises that the agent saves the session and tests creating, writing, and formatting a real Google Sheet. After saving the session, cmd_finish only calls Drive's about endpoint to retrieve identity and storage quota, then returns; no Sheets creation, write, or formatting operations are implemented anywhere in this file. Successful completion therefore does not verify the advertised editing capabilities.

Content

No source excerpt is available for this finding.

Self-test cleanup performs deletions without the authorization required by the documented safety rule.

Medium
Category
Excessive Agency
Confidence
99% confidence
Finding

The unconditional DELETE calls at L378 and L380 contradict L021's statement that deletion runs only with --yes or GDRIVE_ALLOW_DELETE=1. Although cleanup targets resources created by the test, cmd_selftest never calls _need_delete_ok, and its parser at L441-L442 does not accept --yes.

Content

No source excerpt is available for this finding.

The documented setup requires manual Google Cloud Console configuration, contrary to the manifest's no-Cloud-Console claim (L32–L44).

Low
Category
Excessive Agency
Confidence
99% confidence
Finding

The manifest promises a link-and-code authorization flow without requiring users to enter Google Cloud Console. However, L32–L44 explicitly make manual OAuth application creation mandatory, instructing users to create a project, enable APIs, configure consent, and obtain client credentials before authorization can proceed.

Content

No source excerpt is available for this finding.