T05 · Unauthorized Access and Privilege Escalation
- Location
SKILL.md:51- Finding
Overbroad Google Workspace OAuth Authorization Exceeds Least Privilege
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, line 51
Vulnerability Type: Excessive OAuth scopes and privilege escalation
Risk Level: HighVulnerable Code Snippet:
bash # Add an account (opens browser for OAuth flow) gog auth add owner@company.com --services gmail,calendar,drive,contacts,sheets,docsTechnical Analysis
The setup command instructs users to authenticate the owner's Google account and authorize access to Gmail, Calendar, Drive, Contacts, Sheets, and Docs. The demonstrated email and calendar workflows do not require all these services. In particular, Drive, Contacts, Sheets, and Docs exceed the minimum privileges necessary for the documented Gmail and Calendar examples.
This broad authorization increases the authority associated with the resulting OAuth token. It also weakens the separation described elsewhere in the skill between the owner's account and the agent's account. The safer model is to authenticate the agent account where possible, share only the required owner resources with that account, and request service access separately according to the immediate operation.
The documented credential path,
~/.openclaw/.gog/credentials.json, is not itself evidence of credential theft. The skill explicitly states that credential-file contents must not be displayed. The security issue is the breadth of the requested authorization rather than merely documenting where credentials are stored.Attack Path
- A user follows the skill's setup instructions and executes the provided
gog auth addcommand. - The owner completes the OAuth flow and grants all requested service permissions.
gogreceives authorization covering Gmail, Calendar, Drive, Contacts, Sheets, and Docs, including services not needed for the immediate email or calendar task.- If the resulting token, local account state, or authorized
gogenvironment is later compromised or misused, the attacker can o ...[truncated 1106 chars]
- A user follows the skill's setup instructions and executes the provided
- Remediation
View remediation
Remediation Suggestions
-
Replace the broad setup command with service-specific authorization:
bash # Email-only workflow gog auth add owner@company.com --services gmail # Calendar-only workflow gog auth add owner@company.com --services calendar # Combined email and calendar workflow gog auth add owner@company.com --services gmail,calendar -
Do not request Drive, Contacts, Sheets, or Docs unless a user explicitly invokes functionality that requires those services.
-
Prefer authenticating the separate agent account and sharing only the required mailbox or calendar resources rather than broadly authenticating as the owner.
-
For calendar workflows, grant only the required calendar permission. Use read-only access for viewing tasks and grant “Make changes to events” only when event creation or modification is necessary.
-
Clearly separate setup instructions by capability and state the data and operations enabled by each requested service before the user authorizes it.
-
Document a revocation procedure and advise users to remove unused accounts or permissions after the task is complete.
-
Preserve the existing rule against printing credential-file contents, and additionally recommend restrictive filesystem permissions and secure local credential storage.
-
