AAK-OAUTH-SCOPE-001: Third-party OAuth client granted broad Workspace scopes
- Severity
- HIGH
- Category
- Trust Boundaries (
trust-boundary) - Scanner
agent_audit_kit/scanners/oauth_surface.py- Auto-fixable
- No.
- SARIF name
ThirdPartyOAuthBroadScope
What it detects
A config file in this repo grants a non-first-party Google OAuth client broad Workspace scopes (admin.*, cloud-platform, drive, directory.*, gmail.modify/send). The April 19 2026 Vercel × Context.ai breach is the template: a single compromised third-party OAuth app with deployment-level scopes let attackers pivot into production. Explicitly allowlist trusted client IDs in .aak-oauth-trust.yml.
How to fix
Review the granted scopes — drop admin.* / cloud-platform where possible. Add every legitimate third-party client_id to .aak-oauth-trust.yml under trusted_client_ids:. Rotate the consent if the client isn't recognised.
To confirm the finding is gone, report only this rule:
agent-audit-kit scan . --rules AAK-OAUTH-SCOPE-001
Limitations
Reads a fixed set of paths under the project root (app.yaml, vercel.json, netlify.toml, oauth.json, oauth_client.json, client_secret*.json, .well-known/oauth-client-credentials.json and .google-cloud-sdk/**/*.json) for Google scopes under admin.*, cloud-platform, drive, gmail.modify, gmail.send and directory.*. Scopes written in source code (SCOPES = [...] in a .py file) and https://mail.google.com/ are not matched. A config file over 1 MB is not read.
References
- OWASP Agentic Top 10: ASI03 (Identity and Privilege Abuse), ASI04 (Agentic Supply Chain Vulnerabilities)
- Incidents and advisories: VERCEL-2026-04-19
- CSA AI Controls Matrix (AICM): IAM-16
All rules. This page is generated from the rule registry when the documentation is built; to change it, change the rule in agent_audit_kit/rules/builtin.py. To give the rule a hand-written write-up, add docs/rules/AAK-OAUTH-SCOPE-001.md: the page then shows that text, with the registry reference appended under it.