How the attack works
A Google Workspace user can let an app act on their data by signing in with their Google account and accepting the consent screen. The app then holds an OAuth token for the scopes it asked for. Google classes some scopes of Gmail, Drive, Docs and Chat as high-risk and gives sending mail and deleting files in Drive as examples. The default setting for apps that an administrator has not configured is that users can sign in to any third-party app and that the app can request unrestricted Google data for that user.
In consent phishing the attacker does not steal a password. They register an app, give it a trustworthy name and send the user a link to Google's real consent screen. A user who accepts hands over a token for their mailbox or their files. The token is used from the attacker's servers and never passes a sign-in page, so 2-Step Verification is not asked for. Google states that tokens for mail scopes are revoked when the user's password is changed, and that this does not include apps built on Apps Script. A password reset is therefore not a reliable way to remove an app.
The OAuth log records each time an app is authorized to access Google account data, with the app name, the client ID, the client type and the scopes. Organizations that share Workspace data with Google Cloud receive the OAuth token audit in Cloud Audit Logs at organization level under oauth2.googleapis.com, with four Admin Activity methods, google.identity.oauth2.GetToken, Request, Deny and RevokeToken. Google's page does not say which method carries which event of its event reference. GetToken is the method that remains for the event authorize once the other three are matched by name, and the rules on this page read it together with the granted scopes.
What an attacker needs
- A user who can be led to a consent screen and accepts it.
- App access settings that let users authorize unconfigured third-party apps for the requested scopes, which is the default.
- An OAuth app registered by the attacker.
Impact
The app can read, and depending on the scopes send or delete, the user's mail and files through the API for as long as the grant exists. Access does not depend on the user's password or second factor and does not appear as a sign-in. A grant by an administrator or an executive exposes far more than one mailbox.
Detection rules
App Granted High-Risk Drive or Docs Scopes by a User in Google Workspace
Detects an app receiving an OAuth token for a Drive, Docs, Sheets or Slides scope that Google lists as high-risk, such as the full Drive scope, its read-only variant or the administrative Drive scopes, from a user of a Google Workspace or Cloud Identity account. The rule reads the OAuth token audit in Cloud Audit Logs (service oauth2.googleapis.com, method google.identity.oauth2.GetToken) and searches the serialized event parameters in protoPayload.metadata for the scope values. Values that end with a quotation mark match the scope exactly, so the full Drive scope is found without matching the narrower per-file scope, which is not on Google's list. Google documents the method and, separately, the event authorize with its parameters scope, client_id and app_name, but not which method carries which event. GetToken is the Admin Activity method that remains for authorize once Deny, Request and RevokeToken are matched by name. Authorize a test app and compare the entry before relying on the rule. The user is in principalEmail. Many productivity tools ask for Drive access, which is why the level is low. The entry reaches Cloud Audit Logs at organization level once Google Workspace data sharing with Google Cloud is enabled, and reaches the SIEM only when the organization-level logs are routed to it.
title: App Granted High-Risk Drive or Docs Scopes by a User in Google Workspace
id: 00b2e588-d2c5-43b1-991b-6a472c698a04
status: experimental
description: >-
Detects an app receiving an OAuth token for a Drive, Docs, Sheets or
Slides scope that Google lists as high-risk, such as the full Drive
scope, its read-only variant or the administrative Drive scopes, from a
user of a Google Workspace or Cloud Identity account. The rule reads the
OAuth token audit in Cloud Audit Logs (service oauth2.googleapis.com,
method google.identity.oauth2.GetToken) and searches the serialized
event parameters in protoPayload.metadata for the scope values. Values
that end with a quotation mark match the scope exactly, so the full
Drive scope is found without matching the narrower per-file scope,
which is not on Google's list. Google documents the method and,
separately, the event authorize with its parameters scope, client_id and
app_name, but not which method carries which event. GetToken is the
Admin Activity method that remains for authorize once Deny, Request and
RevokeToken are matched by name. Authorize a test app and compare the
entry before relying on the rule. The user is in principalEmail. Many
productivity tools ask for Drive access, which is why the level is low.
The entry reaches Cloud Audit Logs at organization level once Google
Workspace data sharing with Google Cloud is enabled, and reaches the
SIEM only when the organization-level logs are routed to it.
references:
- https://docs.cloud.google.com/logging/docs/audit/gsuite-audit-logging
- https://developers.google.com/workspace/admin/reports/v1/appendix/activity/token
- https://knowledge.workspace.google.com/admin/apps/control-which-apps-access-google-workspace-data
- https://knowledge.workspace.google.com/admin/reports/oauth-log-events
- https://attack.mitre.org/techniques/T1528/
author: Forestall
date: 2026-11-18
tags:
- attack.credential-access
- attack.t1528
logsource:
product: gcp
service: gcp.audit
detection:
selection:
protoPayload.serviceName: oauth2.googleapis.com
protoPayload.methodName: google.identity.oauth2.GetToken
selection_scope:
protoPayload.metadata.event|contains:
- 'https://www.googleapis.com/auth/drive"'
- 'https://www.googleapis.com/auth/drive.readonly"'
- https://www.googleapis.com/auth/drive.metadata
- https://www.googleapis.com/auth/drive.activity
- https://www.googleapis.com/auth/drive.admin
- 'https://www.googleapis.com/auth/drive.apps"'
- 'https://www.googleapis.com/auth/drive.apps.readonly"'
- 'https://www.googleapis.com/auth/drive.scripts"'
- 'https://www.googleapis.com/auth/drive.teams"'
- 'https://www.googleapis.com/auth/drive.photos.readonly"'
- 'https://www.googleapis.com/auth/documents"'
- 'https://www.googleapis.com/auth/documents.readonly"'
- 'https://www.googleapis.com/auth/spreadsheets"'
- 'https://www.googleapis.com/auth/spreadsheets.readonly"'
- 'https://www.googleapis.com/auth/presentations"'
- 'https://www.googleapis.com/auth/presentations.readonly"'
condition: selection and selection_scope
falsepositives:
- Productivity, e-signature, diagramming and backup tools that ask for full Drive or Docs access. They are common and usually used by many people.
- Collect the client IDs of approved apps and drop those matches in the SIEM after the parameters are extracted, or configure the apps as trusted and restrict the Drive service to trusted apps.
level: low
False positives
- Productivity, e-signature, diagramming and backup tools that ask for full Drive or Docs access. They are common and usually used by many people.
- Collect the client IDs of approved apps and drop those matches in the SIEM after the parameters are extracted, or configure the apps as trusted and restrict the Drive service to trusted apps.
App Granted High-Risk Gmail Scopes by a User in Google Workspace
Detects an app receiving an OAuth token for a Gmail scope that Google lists as high-risk, such as the full mailbox scope or the scopes to read, modify or send mail, from a user of a Google Workspace or Cloud Identity account. The rule reads the OAuth token audit in Cloud Audit Logs (service oauth2.googleapis.com, method google.identity.oauth2.GetToken) and searches the serialized event parameters in protoPayload.metadata for the scope values. Google documents the method and, separately, the event authorize with its parameters scope, client_id and app_name, but not which method carries which event. GetToken is the Admin Activity method that remains for authorize once Deny, Request and RevokeToken are matched by name, and the level is one step lower than the attack deserves for that reason. Authorize a test app and compare the entry before relying on the rule. The user is in principalEmail. Mail clients and backup tools ask for the same scopes, so identify the app by client_id before acting. The entry reaches Cloud Audit Logs at organization level once Google Workspace data sharing with Google Cloud is enabled, and reaches the SIEM only when the organization-level logs are routed to it.
title: App Granted High-Risk Gmail Scopes by a User in Google Workspace
id: 9cd90f1b-5965-46db-90e3-194cf1f0b1e2
status: experimental
description: >-
Detects an app receiving an OAuth token for a Gmail scope that Google
lists as high-risk, such as the full mailbox scope or the scopes to
read, modify or send mail, from a user of a Google Workspace or Cloud
Identity account. The rule reads the OAuth token audit in Cloud Audit
Logs (service oauth2.googleapis.com, method
google.identity.oauth2.GetToken) and searches the serialized event
parameters in protoPayload.metadata for the scope values. Google
documents the method and, separately, the event authorize with its
parameters scope, client_id and app_name, but not which method carries
which event. GetToken is the Admin Activity method that remains for
authorize once Deny, Request and RevokeToken are matched by name, and
the level is one step lower than the attack deserves for that reason.
Authorize a test app and compare the entry before relying on the rule.
The user is in principalEmail. Mail clients and backup tools ask for the
same scopes, so identify the app by client_id before acting. The entry
reaches Cloud Audit Logs at organization level once Google Workspace
data sharing with Google Cloud is enabled, and reaches the SIEM only
when the organization-level logs are routed to it.
references:
- https://docs.cloud.google.com/logging/docs/audit/gsuite-audit-logging
- https://developers.google.com/workspace/admin/reports/v1/appendix/activity/token
- https://knowledge.workspace.google.com/admin/apps/control-which-apps-access-google-workspace-data
- https://knowledge.workspace.google.com/admin/reports/oauth-log-events
- https://attack.mitre.org/techniques/T1528/
author: Forestall
date: 2026-11-18
tags:
- attack.credential-access
- attack.t1528
logsource:
product: gcp
service: gcp.audit
detection:
selection:
protoPayload.serviceName: oauth2.googleapis.com
protoPayload.methodName: google.identity.oauth2.GetToken
selection_scope:
protoPayload.metadata.event|contains:
- https://mail.google.com/
- https://www.googleapis.com/auth/gmail.readonly
- https://www.googleapis.com/auth/gmail.modify
- https://www.googleapis.com/auth/gmail.compose
- https://www.googleapis.com/auth/gmail.send
- https://www.googleapis.com/auth/gmail.insert
- https://www.googleapis.com/auth/gmail.metadata
- https://www.googleapis.com/auth/gmail.settings.basic
- https://www.googleapis.com/auth/gmail.settings.sharing
condition: selection and selection_scope
falsepositives:
- Mail clients on phones and desktops, which ask for the full mailbox scope when a user adds the account. Where the organization allows them, they are the main source of matches.
- Backup, archiving, migration and CRM tools that the organization approved. Collect their client IDs and drop those matches in the SIEM after the parameters are extracted, or configure the apps as trusted and restrict the Gmail service to trusted apps so that unknown apps cannot get these scopes at all.
level: medium
False positives
- Mail clients on phones and desktops, which ask for the full mailbox scope when a user adds the account. Where the organization allows them, they are the main source of matches.
- Backup, archiving, migration and CRM tools that the organization approved. Collect their client IDs and drop those matches in the SIEM after the parameters are extracted, or configure the apps as trusted and restrict the Gmail service to trusted apps so that unknown apps cannot get these scopes at all.
Detection logic
Patterns that need more than one event, a baseline or knowledge of your own environment. Each is a hypothesis to build and tune in your SIEM, not a ready rule.
App that nobody used before is authorized by several users within a day
A consent phishing message goes to many people, and those who accept authorize the same client ID within hours. An established app gains users slowly. A client ID that was never seen in the organization and collects several grants in one day is the shape of a campaign.
- Take the
google.identity.oauth2.GetTokenentries ofoauth2.googleapis.comand extract the event parametersclient_idandapp_namefromprotoPayload.metadata. - Keep a list of the client IDs seen in the past 90 days.
- Raise a client ID that is not on the list and is authorized by three or more different
authenticationInfo.principalEmailvalues within 24 hours.
Eventsgoogle.identity.oauth2.GetToken
LimitsThe rollout of a new approved app looks the same, so compare with the change calendar. A targeted attack on one person never reaches the count. The link between this method and the authorization event is not stated by Google, so check it with a test grant. The numbers are starting points.
High-risk scopes granted by an administrator or another privileged user
The same grant weighs more when the user is a super admin, an executive or someone who handles payments. The rules cannot know who is privileged. Joining their matches with your own list of sensitive accounts turns a medium alert into one that is handled at once.
- Take the matches of the rules of this page, which read
google.identity.oauth2.GetTokenwith a high-risk value in thescopeparameter. - Compare
authenticationInfo.principalEmailwith your list of administrators, executives and finance users. - Raise a match for a listed account with high priority, and read
app_name,client_idandscopeinprotoPayload.metadata.
Eventsgoogle.identity.oauth2.GetToken
LimitsThe list has to be maintained by you. The audit entry does not say whether the user holds an admin role. Administrators who use an approved mail client or a backup tool with their admin account match as well, which is one more reason to keep admin accounts separate from daily accounts.
Triage
- Read the event parameters in protoPayload.metadata. app_name and client_id identify the app, client_type its kind and scope the access that was granted. The user is in principalEmail and the source address in requestMetadata.callerIp.
- Look the app up under API controls, Manage App Access. Check whether it is configured, whether it is verified by Google, how many users have accessed it and since when.
- Decide whether the app is known. Mail clients, backup tools and migration tools ask for the same scopes and are usually used by many people for a long time.
- Ask the user how they came to the consent screen. A link in an email or a chat message that led there points to consent phishing, and other users may have received it.
- Search the OAuth log for the same client_id to find every user who authorized the app.
- Where your edition records API call events, review what the app has done with the token since the grant.
Response
Once the attack is confirmed:
- Set the app to Blocked in API controls, which stops it from accessing any Google data in the organization.
- Revoke the app's tokens for every user who authorized it, on the security page of each user, and confirm that the app is gone from their connected applications.
- Treat the mailboxes and files of those users as read by the attacker for the time of the grant, and review mail filters, forwarding and sent mail for changes the app made.
- Find and remove the message that carried the link, and warn the users who received it.
- Restrict the Gmail and Drive services to trusted apps if they were unrestricted.
Mitigation
- Set the access of the Gmail and Drive services to Restricted in API controls, so that only apps you configured as Trusted or with specific Google data can reach them.
- Change the setting for unconfigured third-party apps from the default to sign-in information only or to no access, and let users request the apps they need.
- Block apps that you have reviewed and rejected, and review the list of accessed apps with their requested services regularly.
- Teach users that a real Google consent screen can belong to a harmful app, and that the scopes it lists are what matters.
- Share Workspace data with Google Cloud and route the organization-level audit logs to the SIEM.
Frequently asked questions
Does resetting the user's password remove the app's access?
Not reliably. Google states that OAuth 2.0 tokens for certain products are revoked automatically when a user's password is changed, that this covers apps that use mail scopes and that both access and refresh tokens become invalid. It also states that apps built on Apps Script are not included. Revoke the token on the user's security page or block the app, and do not rely on the password change.
Why does 2-Step Verification not stop this attack?
Because nobody signs in as the user. The user signs in themselves, with their second factor, and then grants the app access on Google's own consent screen. From that point the app presents its token to the API. The sign-in controls of the account are not involved until the grant is revoked.
How sure is it that the rules match the authorization event?
Google documents the method names of the OAuth token audit in Cloud Audit Logs and, separately, the events and parameters of the token audit. It does not publish which method carries which event. The rules read `google.identity.oauth2.GetToken`, the only Admin Activity method that is left for the event `authorize`, and its `scope` parameter. Authorize a test app in your own tenant and compare the entry before you depend on the rules.
Which scopes do the rules treat as high-risk?
The ones Google lists as high-risk OAuth scopes on its page about controlling app access. One rule covers the Gmail list, for example the full mailbox scope and the scopes to read, modify and send mail. The other covers the full Drive scope, its read-only and administrative variants and the Docs, Sheets and Slides scopes. The narrower per-file Drive scope is not on Google's list and is not matched.
References
- MITRE ATT&CK T1528: Steal Application Access Token
- Control which apps access Google Workspace data (high-risk OAuth scopes, unconfigured apps)
- OAuth log events
- Automatic OAuth 2.0 token revocation upon password change
- How authorized access works
- Audit logs for Google Workspace (Cloud Audit Logs, OAuth Token Audit)
- OAuth token audit events (authorize, scope, client_id, app_name)