Security teams have spent years hardening Google Workspace against credential theft: phishing-resistant MFA, FIDO2 keys, conditional access. Attackers have responded by going around all of it. As highlighted in a recent BleepingComputer webinar examining real-world intrusions, threat actors are increasingly combining social engineering with malicious OAuth applications to gain persistent access to Workspace data — without ever needing the victim's password or MFA token.
This is not a theoretical attack class. We've responded to multiple engagements where the initial access vector was a single click on an "Allow" button in a legitimate Google consent screen. Once granted, the attacker's third-party app holds OAuth tokens that survive password resets, survive MFA enforcement, and in many cases survive the victim employee being entirely unaware anything happened. If your detection strategy for Workspace compromise is still anchored to impossible-travel alerts and failed login spikes, you have a blind spot the size of your entire SaaS estate.
This post breaks down the attack chain, then gives you the detection content and hardening steps your team can deploy today.
Technical Analysis: How Malicious OAuth App Attacks Unfold
Affected Platform
- Google Workspace (all editions — Business Starter through Enterprise Plus, plus Education and Nonprofit tiers)
- Any tenant that has not explicitly restricted third-party API access via the Admin console
- End users authenticating via standard Google OAuth 2.0 consent flows in any browser
The Attack Chain
The intrusions examined in the webinar follow a consistent pattern we've also seen in our own IR casework:
-
Lure delivery. The victim receives a socially engineered message — email, Slack, a shared document comment, or even a QR code — directing them to what appears to be a legitimate business application: a PDF viewer, a "document signing" tool, a shared drive connector, or a fake internal productivity app.
-
The consent screen. The link points to a real
accounts.google.com/o/oauth2/v2/authURL. This is critical for defenders to understand: the page is genuinely Google-hosted. There is no typosquatted domain to flag, no credential harvester to block. The URL bar shows google.com, the TLS certificate is valid, and user security awareness training focused on "check the domain" actively works against the victim here. -
Scope request. The attacker-controlled OAuth client ID requests high-value scopes. In the cases we see most often, these include read access to Gmail (
.../auth/gmail.readonlyormail.google.com/), Drive (.../auth/drive.readonly), Calendar, and Contacts — the exact data sets needed for BEC follow-on attacks, espionage, and internal reconnaissance. -
Token issuance and persistence. On consent, Google issues the attacker an authorization code, which they exchange for an access token and — critically — a refresh token. The refresh token is the persistence mechanism. It does not expire when the user changes their password. It does not care about MFA. It is valid until explicitly revoked, the app is blocked, or in some configurations, until the refresh token itself ages out.
-
Data access via API. The attacker then pulls mail and files via Google's official APIs from attacker-controlled infrastructure. This traffic does not look like a user login. There is no session to hijack, no cookie to steal. In Workspace audit logs, the activity appears under the OAuth application's client ID — not a user's browser session — which is precisely where most SOC playbooks stop looking.
Why This Defeats Traditional Controls
- MFA is irrelevant post-consent. The token was issued after a fully authenticated session.
- Password resets don't revoke third-party app tokens in default configurations.
- Email gateways see nothing malicious — the lure often contains no attachment and a google.com URL.
- CASB/SSPM gaps. Many organizations only inventory sanctioned apps; a freshly registered malicious client ID is invisible until someone explicitly hunts for it.
Exploitation Status
This is an actively exploited technique in the wild, used by both financially motivated actors (BEC precursors, mailbox recon) and state-aligned groups. It maps to MITRE ATT&CK T1550.001 (Use Alternate Authentication Material: Web Session Cookie — broadly, token theft/abuse), T1528 (Steal Application Access Token), and the initial access vector aligns with T1566 (Phishing) combined with abuse of legitimate OAuth functionality. There is no CVE because there is no vulnerability in the traditional sense — this is abuse of OAuth working exactly as designed, which is what makes it so dangerous and so durable as a technique.
Detection & Response
The telemetry that matters lives in the Google Workspace Admin audit log, specifically the Token and Drive/Login audit event streams. Every OAuth authorization event records the acting user, the OAuth client ID, the app name, and the scopes granted. If you are not shipping these logs to your SIEM, that is step zero — do it today via the Google Workspace Reports API or a native Sentinel/Splunk connector.
Sigma Rules
The following rules target the Google Workspace audit log via Sigma's gworkspace product mapping. Tune the high-risk scope list to your environment, but do not shorten it — gmail.readonly and drive.readonly are the scopes we see abused most consistently.
---
title: Google Workspace High-Risk OAuth Scope Granted to Third-Party App
id: 3f8a2c91-7b4e-4d1a-9c62-8e5f0a1b2c3d
status: experimental
description: Detects a user authorizing a third-party OAuth application with high-risk scopes (full mail or drive read access), a common indicator of illicit consent grant attacks against Google Workspace.
references:
- https://www.bleepingcomputer.com/news/security/webinar-how-malicious-oauth-apps-can-lead-to-google-workspace-breaches/
- https://attack.mitre.org/techniques/T1528/
- https://attack.mitre.org/techniques/T1550/001/
author: Security Arsenal
date: 2026/06/08
tags:
- attack.credential_access
- attack.t1528
- attack.t1550.001
logsource:
product: google_workspace
service: token
detection:
selection_event:
event.name: authorize
selection_scopes:
scope_data.scope|contains:
- 'gmail.readonly'
- 'mail.google.com'
- 'drive.readonly'
- 'drive'
- 'admin.directory.user.readonly'
condition: selection_event and selection_scopes
falsepositives:
- Legitimate business applications (email clients, backup tools, e-discovery) - baseline and allowlist approved client IDs
level: high
---
title: Google Workspace OAuth Consent From New or Rare Application
id: 9c1d4e72-2a5f-4b38-8d71-6f3e9a0b4c5e
status: experimental
description: Detects OAuth authorization events where the application name matches patterns commonly used in consent phishing lures (document viewers, signing tools, shared file connectors).
references:
- https://www.bleepingcomputer.com/news/security/webinar-how-malicious-oauth-apps-can-lead-to-google-workspace-breaches/
- https://attack.mitre.org/techniques/T1566/
author: Security Arsenal
date: 2026/06/08
tags:
- attack.initial_access
- attack.t1566
logsource:
product: google_workspace
service: token
detection:
selection_event:
event.name: authorize
selection_appname:
app_name|contains:
- 'pdf'
- 'viewer'
- 'docu'
- 'sign'
- 'shared'
- 'drive connector'
- 'mail merge'
- 'secure'
condition: selection_event and selection_appname
falsepositives:
- Legitimate document workflow tools (DocuSign, Adobe) - allowlist verified publisher client IDs after review
level: medium
---
title: Google Workspace OAuth Token Revocation by Admin
id: 5b7e3a14-8c6d-4f29-b183-2d4a7c9e0f1a
status: experimental
description: Detects administrative revocation of OAuth tokens. Useful as a response-audit control to confirm remediation actions and to alert on an attacker with admin access revoking tokens to cover tracks.
references:
- https://www.bleepingcomputer.com/news/security/webinar-how-malicious-oauth-apps-can-lead-to-google-workspace-breaches/
author: Security Arsenal
date: 2026/06/08
tags:
- attack.defense_evasion
logsource:
product: google_workspace
service: token
detection:
selection:
event.name: revoke
condition: selection
falsepositives:
- Routine admin and IR-driven token revocation - expected during incident response; use for audit trail validation
level: informational
KQL Hunting — Microsoft Sentinel
If you're ingesting Google Workspace logs into Sentinel via the Google Workspace Reports API connector, the following hunt surfaces consent grants to unvetted applications requesting mail or file access. Run it as a scheduled analytics rule with a 24-hour lookback, and use it ad hoc for retro-hunting after any suspected lure campaign.
// Hunt: High-risk OAuth consent grants in Google Workspace
// Requires: Google Workspace Reports API connector (Token audit stream)
let Lookback = 30d;
let ApprovedClientIds = dynamic(["<your-approved-client-id-1>", "<your-approved-client-id-2>"]);
GoogleWorkspaceReportsAPI_CL
| where TimeGenerated > ago(Lookback)
| where EventName_s == "authorize"
| extend ScopeData = tostring(Scope_s)
| extend ClientId = tostring(AppName_s), Actor = tostring(ActorEmail_s)
| where ScopeData has_any ("gmail.readonly", "mail.google.com", "drive.readonly", "/auth/drive", "admin.directory")
| where ClientId !in~ (ApprovedClientIds)
| summarize FirstGrant = min(TimeGenerated), LastGrant = max(TimeGenerated), Users = dcount(Actor), UserList = make_set(Actor, 25) by ClientId, ScopeData
| extend RiskNote = iif(Users > 5, "WIDESPREAD GRANTS - POSSIBLE CAMPAIGN", "REVIEW")
| sort by Users desc
A second hunt worth running weekly: correlate consent grants with external API access to Gmail/Drive shortly after. A burst of gmail.users.messages.list or Drive export activity against an account that just authorized a new third-party app is your highest-fidelity compromise signal.
Velociraptor VQL — Endpoint Triage
When you suspect a specific user clicked through a consent lure, the fastest endpoint-side confirmation is browser history and cache artifacts showing the OAuth authorization URL and the redirect. This artifact hunts Chrome and Edge history databases for Google OAuth consent flows, letting you reconstruct exactly which client ID the victim authorized.
-- Hunt browser history for Google OAuth consent flows (potential illicit grant)
-- Copy locked history DBs via NTFS parser and regex the URLs
LET history_paths = SELECT FullPath FROM glob(globs=[
'C:/Users/*/AppData/Local/Google/Chrome/User Data/*/History',
'C:/Users/*/AppData/Local/Microsoft/Edge/User Data/*/History'
])
SELECT FullPath,
parse_string_with_regex(
string=FullPath,
regex='Users/(?P<user>[^/]+)/').user AS AffectedUser
FROM history_paths
WHERE FullPath =~ 'History$'
-- Then query each copied DB (via sqlite()) for consent URLs:
-- SELECT url, title, datetime(last_visit_time/1000000-11644473600,'unixepoch') AS VisitTime
-- FROM urls
-- WHERE url =~ 'accounts.google.com/o/oauth2'
-- OR url =~ 'accounts.google.com/signin/oauth'
-- ORDER BY VisitTime DESC
Remediation Script
The following PowerShell script uses GAM (the standard Workspace admin CLI) to enumerate every third-party OAuth token in the tenant, flag tokens holding high-risk scopes, and generate revocation commands for review. Test in a non-production OU first — mass revocation will break legitimate integrations.
# Google Workspace OAuth Token Audit & Revocation - Security Arsenal IR Toolkit
# Requires: GAM (GAMADV-XTD3 recommended) authenticated with a super-admin account
# Step 1: Export all user OAuth tokens to CSV for review
$OutputCsv = ".\workspace_oauth_token_audit_$(Get-Date -Format 'yyyyMMdd').csv"
gam print users allfields token | Out-File -FilePath $OutputCsv -Encoding utf8
Write-Host "[+] Token inventory written to $OutputCsv" -ForegroundColor Green
# Step 2: Identify tokens holding high-risk scopes
$HighRiskScopes = @("gmail.readonly","mail.google.com","drive.readonly","auth/drive","admin.directory")
$Tokens = Import-Csv $OutputCsv
$Suspicious = $Tokens | Where-Object {
$t = $_
$HighRiskScopes | Where-Object { $t.Scopes -like "*$_*" }
}
$Suspicious | Select-Object primaryEmail, clientId, displayText, Scopes | Format-Table -AutoSize
$Suspicious | Export-Csv ".\suspicious_oauth_grants.csv" -NoTypeInformation
# Step 3: Generate revocation commands (REVIEW before executing - do not blind-run)
$RevokeScript = ".\revoke_oauth_grants_REVIEW_FIRST.bat"
$Suspicious | ForEach-Object {
"gam user $($_.primaryEmail) deprovision # revokes all tokens for this user"
} | Out-File $RevokeScript -Encoding utf8
Write-Host "[!] Review $RevokeScript and execute only after validating each grant" -ForegroundColor Yellow
# Step 4 (targeted): Revoke a single malicious app for one user
# gam user victim@yourdomain.com token revoke clientid <MALICIOUS_CLIENT_ID>
Remediation and Hardening
Detection buys you time; configuration closes the door. Prioritize these in order:
-
Restrict third-party API access (highest impact). In the Admin console: Security → Access and data control → API controls → Manage third-party app access. Move from the default "allow everything" to a block-by-default / allowlist model. Only apps you've explicitly vetted — verified publisher, business justification, minimum scopes — get access to high-risk Google services. This single control would have prevented the majority of consent phishing incidents we've worked.
-
Enable app access control for high-risk scopes. Configure Gmail and Drive as Restricted services so that only explicitly trusted apps can request their scopes. Unvetted apps will fail at the consent screen before a token is ever issued.
-
Revoke malicious grants immediately. For a confirmed incident: revoke the specific client ID per user (
gam user <user> token revoke clientid <id>), or deprovision the user's sessions entirely. Then hunt tenant-wide for the same client ID — consent phishing campaigns almost never hit a single mailbox. -
Review the authorized apps report weekly. Admin console reporting shows all apps with active grants. Any app you don't recognize, any app with an unverified publisher banner, any app holding mail/drive scopes outside your allowlist is an investigation.
-
Ship Token audit logs to your SIEM. If your SOC cannot see
authorizeandrevoketoken events, you are blind to this entire attack class. Wire up the Reports API connector today and deploy the Sigma/KQL content above. -
Retrain your users on consent screens specifically. Standard phishing training teaches "check the URL." That advice fails here — the URL is google.com. Teach users that any unexpected "Allow" / consent prompt is itself a red flag, and establish a reporting path for unexpected app authorization requests.
-
Post-incident: assume data exposure. If a malicious app held
gmail.readonlyfor any duration, assume the mailbox contents were exfiltrated. Scope your IR accordingly: identify what was in the mailbox (credentials, contracts, PII), assess BEC risk to contacts, and rotate any secrets found in mail or Drive content the app could reach.
The uncomfortable truth about OAuth abuse is that it exploits trust in a protocol that is working as intended. There is no patch coming. The defense is governance, logging, and the discipline to treat every consent grant as a security decision — because that's exactly what it is.
Related Resources
Security Arsenal Incident Response Services AlertMonitor Platform Book a SOC Assessment incident-response Intel Hub
Is your security operations ready?
Get a free SOC assessment or see how AlertMonitor cuts through alert noise with automated triage.