Defending and Threat Hunting OAuth Consent Phishing

by  and  | Aug 18, 2026

Summary

OAuth consent phishing bypasses the controls most organizations rely on to stop account takeover. The victim authenticates on real identity provider infrastructure, completes MFA legitimately, and hands an attacker-controlled application a token that survives a password reset. Over the past year, phishing-as-a-service operators have turned this into a subscription product, and the device code variant once reserved for state-aligned actors now ships as a turnkey kit. This post covers how the attack works, what changed to make it commodity-grade, and the detections and controls that catch it where MFA and password resets cannot.

 

How OAuth Consent Phishing Works

Specific campaigns differ in delivery and payload, but the attack chain follows a consistent pattern.

Step 1: Malicious App Registration

The threat actor registers an OAuth application in an identity provider they control (Entra ID tenant, Salesforce org, Google Cloud project). Naming and branding are chosen to look legitimate or unremarkable, such as “Document Viewer,” “Data Loader,” or “My Ticket Portal.” The actor sets a redirect URI pointing to attacker infrastructure and selects the scopes the app will request. A multi-tenant configuration lets the application solicit consent from users in any organization.

Step 2: Phishing

The actor distributes the consent link by email, Teams or Slack message, watering hole site, or voice phishing call. The lure frames the prompt as an expected authorization step for a document, meeting, helpdesk ticket, or security alert. The goal is simply to get the user onto the real identity provider’s consent screen, where the URL and branding will appear trustworthy.

Step 3: User Clicks OAuth URL

The user signs in on the legitimate identity provider and completes MFA if required. Because authentication happens against the real platform, MFA is satisfied without the attacker ever handling the credential.

Step 4: App Generates Authentic Consent Prompt

The identity provider renders a genuine consent screen listing the permissions the application requests. Nothing about the page is spoofed, which is what makes the technique effective against user awareness training focused on fake login pages.

Step 5: User Grants Data Permissions

The user clicks Accept. The identity provider creates a service principal for the application in the user’s tenant, binding the attacker’s app to the organization.

Step 6: Authorization Code Created and Sent

The identity provider issues an authorization code and sends it to the attacker-controlled redirect URI.

Step 7: Attacker Gains Persistent Access

The application exchanges the code for an access token and, if offline_access or an equivalent scope was granted, a refresh token. The actor now holds valid credentials and needs no further interaction with the victim. Those tokens are used to query APIs for email, files, contacts, CRM records, or whatever the granted scopes permit, with the refresh token minting fresh access tokens for roughly 90 days or until the grant is revoked. In more mature tradecraft, the actor uses the service principal to register additional backdoor applications, modify mail flow rules, or join devices to the tenant, extending access beyond the original grant.

 

Why OAuth Consent Phishing Is Different

Most phishing attacks target authentication. The attacker wants the password, the session cookie after MFA, or a refresh token from a reverse proxy. OAuth consent phishing targets the authorization layer instead. The user signs in on a legitimate Microsoft, Google, or Salesforce domain, satisfies every Conditional Access check, and is presented with a consent screen asking for permissions. If they approve, the identity provider issues a valid access token to the attacker’s application. No credentials are stolen. No sign-in is spoofed. The authentication system did what it was designed to do.

This changes the defensive problem in three ways. First, MFA provides no protection because the user completes MFA during the legitimate sign-in that precedes the consent grant. Phishing-resistant authenticators and passkeys are no different. Second, password resets do not revoke OAuth tokens. Refresh tokens remain valid by default for 90 days in Entra ID and can be used to mint new access tokens throughout that window. Third, the resulting access is legitimate by design. The application is using a token the identity provider issued to it, so malicious activity blends with normal API traffic from authorized integrations.

SRA covered one variant of this attack class in March 2025 with Purple Team PSA: Disable Device Code Flow, which demonstrated the technique offensively and provided the Conditional Access controls to block it.

 

Recent Threat Activity

Campaign Date Attribution Platform Key Detail
Midnight Blizzard Microsoft corporate compromise Nov 2023 – Jan 2024 APT29 (Russia/SVR) Microsoft 365 / Entra Password-sprayed a legacy test tenant, then abused a privileged legacy OAuth app to grant full_access_as_app to attacker apps and read senior leadership email.
Storm-1286 OAuth spam operations Ongoing Financially motivated Microsoft 365 / Entra Compromised users register line-of-business apps with high Exchange permissions to send spam at scale from victim tenants.
Tycoon OAuth app impersonation Early 2025 – present Criminal (Tycoon operators) Microsoft 365 / Entra Entra apps impersonating RingCentral, DocuSign, Adobe, and SharePoint funnel users to AiTM kits. Around 3,000 accounts targeted across 900+ M365 tenants, success rate above 50%.
Storm-2372 device code phishing Feb 2025 – present Russia-linked Microsoft 365 / Entra Device code phishing of government, NGO, defense, and energy targets. Pivots to the Authentication Broker app to register a device and mint a Primary Refresh Token.
UNC6040 / ShinyHunters Salesforce vishing Late 2024 – present The Com / ShinyHunters-linked Salesforce Vishing as IT support gets victims to authorize a malicious Connected App (“Data Loader,” “My Ticket Portal”). Victims include Google, Cisco, Adidas, Qantas, LVMH, and Workday.
UNC6395 / GRUB1 Salesloft Drift supply chain Aug 2025 Unattributed (possible China nexus) Salesforce + Google Workspace via Drift Tokens stolen from Salesloft Drift used to reach 700+ customer Salesforce instances; support cases scanned for AWS keys, Snowflake tokens, VPN creds, and passwords. Impacted include Cloudflare, Palo Alto Networks, Proofpoint, Zscaler, Tanium, and PagerDuty.
CoPhish Oct 2025 Proof-of-concept Microsoft 365 / Entra via Copilot Studio A Copilot Studio demo agent on copilotstudio.microsoft.com wraps an OAuth consent flow, bypassing URL reputation by living on a Microsoft domain.
ConsentFix Dec 2025 Unattributed (linked to APT29-aligned activity) Microsoft 365 via Azure CLI ClickFix lure tricks the victim into pasting an Azure CLI authorization-code URL into a phishing page. Abuses Azure CLI as a first-party app, sidestepping third-party app governance.
OAuth redirection abuse Observed through March 2026 Multiple actors Microsoft 365 / Entra Invalid scope plus prompt=none forces an error redirect through login.microsoftonline.com; the state parameter carries the victim’s encoded email to prefill phishing pages. Hands off to EvilProxy AiTM kits or delivers ZIPs with LNK shortcuts and HTML smuggling loaders.
EvilTokens device code PhaaS Feb 2026 – present Criminal (PhaaS operator) Microsoft 365 / Entra (Gmail, Okta planned) First turnkey device code PhaaS, sold on Telegram with AI-generated lures and SaaS templates (Adobe Acrobat Sign, DocuSign, SharePoint, OneDrive). One campaign hit 340+ M365 orgs across the US, Canada, Australia, New Zealand, and Germany.
Kali365 device code PhaaS Observed through May 2026 Criminal (PhaaS operator) Microsoft 365 / Entra Telegram device code PhaaS with AI lures, victim dashboards, OAuth token capture, and a separate AiTM cookie mode. Integrated by ODx/FlowerStorm.
Tycoon 2FA device code module 2026 (post-takedown) Criminal (Tycoon operators) Microsoft 365 / Entra After the March 2026 takedown, operators rebuilt and added a device-code module impersonating the Microsoft Authentication Broker first-party app.
AI-enabled device code campaign April 2026 Financially motivated Microsoft 365 / Entra Spun up thousands of short-lived polling nodes on a cloud host and used GenAI for tailored lures (RFPs, invoices); post-compromise mailbox rules and Graph recon. Microsoft called it a significant escalation beyond Storm-2372.

Three Attack Patterns

The campaigns above fall into three distinct patterns. Each pattern has implications for which detections and controls are most effective.

Pattern 1: Direct consent phishing. The attacker sends a link that leads to an OAuth consent prompt. The user clicks through the prompt and authorizes the application. This is the classic pattern documented in Microsoft’s consent phishing guidance. Tycoon OAuth app impersonation, CoPhish, and OAuth redirection abuse all follow this shape, though each exploits different facets of the OAuth protocol or the identity provider’s UX. OAuth redirection abuse is particularly interesting because it does not even require a successful consent grant. The attacker triggers an intentional OAuth error through an invalid scope and prompt=none, and uses the error redirect path to bounce the victim to attacker-controlled infrastructure for phishing or malware delivery.

Pattern 2: Vishing-to-consent. The attacker uses voice phishing to walk the victim through the consent or authorization code flow in real time. UNC6040’s Salesforce campaign is the definitive example: operators impersonate IT support, guide the victim to the Salesforce Connected Apps setup page, and talk them through authorizing a malicious Data Loader application. The device code phishing variant covered in Purple Team PSA fits here as well, with the attacker generating an 8-character code and vishing the victim into entering it at microsoft.com/devicelogin. ConsentFix is a hybrid of this pattern and ClickFix, where the user is socially engineered into pasting an Azure CLI authorization URL into a phishing page. What unifies these attacks is that the victim is socially engineered through the authorization step in real time by an operator on the other end of a phone call or phishing page.

Pattern 3: OAuth token theft and SaaS-to-SaaS supply chain abuse. The attacker does not phish the victim directly. Instead, they compromise a third-party SaaS vendor and steal the OAuth tokens that vendor holds for its customers’ tenants. UNC6395’s compromise of Salesloft Drift is the textbook case: the attacker stole tokens Drift held for hundreds of customer Salesforce instances and used them to query support case data at scale, harvesting credentials embedded in case content. Midnight Blizzard’s post-access OAuth lateral movement is a related variant at the tenant level: once inside Microsoft’s corporate environment, the attackers used a legacy OAuth application with elevated privilege to create additional backdoor applications and grant them full_access_as_app to Exchange Online. The common thread is that the malicious access rides through tokens the identity provider considers legitimate, and the victim organization may have no relationship with the attacker at all.

 

Phishing-as-a-Service and the Shift to the Authorization Layer

Phishing-as-a-service lowered the cost of authorization-layer attacks. Operators who once sold only reverse-proxy kits now sell consent-grant and device-code modules, and at least one platform now exists for the sole purpose of running device code phishing at scale. The barrier to entry for stealing an OAuth token is now a Telegram subscription rather than custom tooling.

Device Code Phishing Moves From APT to Commodity

The OAuth 2.0 device authorization grant is designed for input-constrained devices such as smart TVs and IoT hardware. The flow issues a short user code and directs the user to a sign-in page (microsoft.com/devicelogin) to authorize the device. Device code phishing abuses this by having the attacker generate the code, then socially engineering the victim into entering it and completing their own MFA on the real Microsoft page. The victim authorizes the attacker’s session. As with consent phishing, MFA is not bypassed. It is redirected. Phishing-resistant authenticators and passkeys provide no protection because the user completes a legitimate authentication ceremony on genuine infrastructure.

Storm-2372, assessed as Russia-aligned, ran the campaign that brought the technique to wide attention in February 2025, targeting government, NGO, defense, telecom, healthcare, higher education, and energy organizations. Volexity tracked multiple Russia-linked clusters using the same technique against government and defense targets in the same window, including activity that overlaps with APT29. EvilTokens, advertised on Telegram in February 2026 and analyzed by Sekoia in March 2026, is the first popularized turnkey device code phishing-as-a-service. It ships with AI-generated lures, SaaS-themed templates, and post-compromise business email compromise tooling. One campaign linked to the platform compromised more than 340 Microsoft 365 organizations across multiple countries and sectors. Kali365, flagged in an FBI public service announcement in May 2026, is a competing device code PhaaS distributed through Telegram with AI-generated lures, victim-tracking dashboards, and OAuth token capture. It offers both a device-code mode and an AiTM cookie mode in the same kit. After the March 2026 takedown of Tycoon 2FA infrastructure, the operators rebuilt and added a device-code module that impersonates the Microsoft Authentication Broker first-party application.

Over the past year the technique went from a handful of state-aligned operators to a subscription product, and that trajectory points one direction. Expect device code phishing to grow more common and more accessible as kits compete on price and ease of use.

Behavioral Detection and Threat Hunting

The detection logic below spans Microsoft 365 and Salesforce telemetry. Because OAuth consent phishing operates through legitimate authorization flows, most of these behaviors will overlap with normal activity. Hunt and baseline first, then tune for alerting.

Behavior Platform Detection Logic Significance MITRE
New service principal created following user consent to a multi-tenant app M365 / Entra Entra ID audit events for Add service principal correlated with Consent to application by the same user in a short window Every new-app consent creates a service principal. This is the canonical consent phishing event. T1528
Consent to app requesting offline_access plus high-risk delegated scopes M365 / Entra Consent to application where ConsentContext.Scope includes offline_access with Mail.ReadWrite, Files.ReadWrite.All, Sites.Read.All, or equivalent offline_access issues a refresh token, signaling persistence intent. Paired with sensitive scopes, high confidence. T1528
Credential or secret added to an existing OAuth application M365 / Entra Entra ID Update application - Certificates and secrets management events, especially against legacy or rarely used apps Midnight Blizzard tradecraft: add a secret to a privileged existing app and authenticate as it. T1098.001
OAuth authorization request with prompt=none and invalid scope from a user-clicked URL M365 / Entra Sign-in logs filtered for error code 65001 correlated with prompt=none in the request parameters OAuth redirection abuse pattern. The forced error redirect bounces victims to AiTM kits or malware delivery. T1566.002
Device code sign-in from an unexpected host, location, or user agent M365 / Entra Sign-in logs where the auth protocol is Device Code and origin diverges from the user’s baseline Device code flow is rare outside Teams rooms and CLI tooling. Interactive device code sign-ins by standard users warrant review. T1528, T1621
Device registration immediately after device code token issuance M365 / Entra Entra audit for device registration by the Microsoft Authentication Broker app (29d9ed98-a469-4536-ade2-f981bc1d605e) correlated with a recent device code sign-in Storm-2372 escalation: register a device and mint a Primary Refresh Token for broad SSO. T1098.005
New Salesforce Connected App authorized with broad API scopes Salesforce Event logs for OAuthConnectedApp authorization where scopes include api, full, refresh_token, or web UNC6040 Data Loader pattern. Review new broad-scope Connected Apps against approved integrations. T1528
Salesforce API or Connected App activity from TOR or Mullvad infrastructure Salesforce Login history filtered against known TOR exit nodes and Mullvad IP ranges UNC6040 and UNC6395 both routed through TOR and Mullvad. Connected App auth from these networks is high confidence. T1090.003

Recommendations & Takeaways

The detections above surface activity after the grant has been made. The following controls reduce the attack surface before the user reaches the consent prompt.

  • Restrict user consent to low-risk scopes and verified publishers. In Entra ID, configure custom app consent policies rather than relying solely on the Microsoft default. The microsoft-user-default-recommended policy rolled out in July 2025 blocks consent to site and file permissions for non-admin users, but it still permits several high-value permissions and does not protect admin-tier accounts. Configure policies to allow user consent only for apps requesting low-risk permissions with verified publishers, or apps registered within the tenant. In Salesforce, enable API Access Control, which flips the environment from “users may self-authorize any app” to “only admin-approved apps and pre-authorized users connect.” This control directly blocks the technique UNC6040 used in the Data Loader campaign
  • Train users to recognize and treat consent prompts as credential prompts. Consent phishing succeeds because the prompt itself is legitimate; there is no spoofed login page for users to spot. Awareness content should teach users to read the requested permissions, check the publisher verification status, and report unexpected consent requests instead of clicking Accept. An unrecognized app asking to read mail or maintain access to data warrants the same suspicion as a password prompt on an unfamiliar domain.
  • Route suspicious consent attempts through the admin consent workflow. When consent policies restrict what users can approve, the admin consent workflow in Entra ID gives them a sanctioned path forward instead of a dead end. Users request access, designated reviewers receive the request with the app’s publisher, requested scopes, and requesting user attached, and the security team makes the decision with full context. This converts a risky individual decision into a reviewable one. Requests expire after 30 days by default, and reviewers should be a small, trained group rather than all Global Administrators.
  • Inventory and review third-party OAuth integrations continuously. The UNC6395 campaign affected customers of Salesloft Drift who had no way of knowing their vendor’s token vault had been compromised. Treat every OAuth integration as a piece of the attack surface. Maintain an inventory of connected applications, their granted scopes, and the business justification for each. Revoke unused integrations. For high-value tenants, consider periodic forced re-consent to flush dormant refresh tokens.
  • Block or restrict OAuth flows that are rarely used legitimately. Device code flow is the clearest example. Purple Team PSA walks through the Conditional Access configuration to block it. Microsoft began rolling out a default policy limiting device code flow in February 2025, but organizations should verify the policy is active and scoped correctly. The same principle applies to legacy authentication flows across every SaaS platform.
  • Build response playbooks around OAuth grant revocation. When an account compromise is suspected, password resets and MFA re-enrollment are not sufficient. Incident response procedures need to include revoking refresh tokens, removing consented applications, and revoking service principal credentials. Microsoft Defender for Cloud Apps provides built-in remediation actions for this; Salesforce exposes equivalent controls through the Connected Apps and session management interfaces. Enable Continuous Access Evaluation in Entra ID to reduce token revocation latency from roughly one hour to minutes.
Kofi Atuobi
Sr. Consultant

Kofi holds a BS in Computer Science and a MS in Cyber Security. He is certified by CompTia in Security+, CySA+, and SSCP (Systems Security Certified Practitioner) and is currently pursuing his SANS GMON.

Kofi daily tasks include 24/7 monitoring and incident response for irregular events in corporate environments.

He serves as a Deputy Client Lead. His duties can include analyst training, analyst access management, proactive threat hunts, and tool engineering (CrowdStrike and Cylance) and develop procedures for a more efficient team and process.

Kofi has worked with clients across industries such as healthcare, pharmaceutical, and financial services.

Prior to joining SRA, Kofi worked as a Solutions Architect and Application Developer for finance and retail companies.

Richard Andrews
Sr. Consultant

Richard Andrews is a cybersecurity professional with experience across corporate consulting, security operations, and the federal government.

He specializes in cyber threat intelligence, threat detection, incident response support, and translating emerging threat activity into actionable insights that help organizations understand risk and strengthen defenses.

Richard currently focuses on operationalizing threat intelligence through research, threat hunting, detection development, and client guidance. He is especially passionate about making complex cyber threats understandable, practical, and useful for both technical teams and business leaders.

Richard attended Penn State University, where he majored in Security and Risk Analysis and is a proud Air Force veteran.