T05 · Unauthorized Access and Privilege Escalation
Warning
- Location
- SKILL.md:17
- Finding
- Overprivileged Google Calendar OAuth Scope## Vulnerability Details **File Location**: `SKILL.md`, lines 17-25 **Vulnerability Type**: Excessive OAuth permissions **Risk Level**: Medium ### Vulnerable Code ```markdown ### Google Calendar OAuth Create OAuth credentials in Google Cloud Console: 1. Enable Google Calendar API 2. Create OAuth 2.0 Desktop credentials 3. Store `client_secret.json` in `credentials/` 4. Authorize with scopes: `https://www.googleapis.com/auth/calendar` 5. Store tokens in `credentials/calendar_tokens.json` ``` ### Technical Analysis The Skill requests the full Google Calendar OAuth scope, `https://www.googleapis.com/auth/calendar`. This scope permits management operations beyond the read-only access required by the declared workflow, which only queries upcoming events and checks for video-conference links. Requesting full Calendar access violates the principle of least privilege. Although the documented API request is read-only and sends credentials only to an official Google endpoint, the resulting bearer token may authorize calendar modification operations if the Agent, local environment, or token file is compromised. The instructions also place OAuth tokens in a predictable local plaintext file. No unrelated recipient or deliberate credential exfiltration was identified, but exposure of this file would make the excessive scope exploitable. ### Attack Path 1. A local attacker, malicious process, or compromised Agent obtains access to `credentials/calendar_tokens.json`. 2. The attacker extracts the access token or refresh token. 3. If necessary, the refresh token and OAuth client credentials are submitted to Google's official token endpoint to obtain a new access token. 4. The attacker uses the resulting broadly scoped bearer token with Google Calendar API endpoints. 5. The attacker performs operations beyond meeting retrieval, potentially including creating, modifying, or deleting calendar data within the permissions granted ...[truncated 482 chars]
- Remediation
- ## Remediation Suggestions 1. Replace the full Calendar scope with the read-only scope: ```text https://www.googleapis.com/auth/calendar.readonly ``` 2. Revoke existing grants and reauthorize the application so previously issued broadly scoped refresh tokens cannot continue to be used. 3. Use an OAuth client dedicated to this Skill and restrict access to only the required Google account. 4. Store token files outside the project directory in an operating-system credential store or secrets manager. 5. If local files are unavoidable, enforce owner-only permissions, such as mode `0600`, and exclude the entire credentials directory from version control and backups not designed for secrets. 6. Document token rotation, revocation, and incident-response procedures. 7. Validate that all Calendar operations remain read-only and restrict requests to the minimum fields required for meeting preparation.
