Device-Code Phishing Abuses Legitimate OAuth Sign-In to Steal Microsoft 365 Tokens
Social Engineering & Fraud · 4 sources · Updated 2mo ago · First seen Sep 22, 2026

Attackers are abusing the OAuth 2.0 Device Authorization Grant to obtain Microsoft 365 account tokens without stealing passwords. They initiate a legitimate device-code sign-in on an attacker-controlled application or device, then persuade targets through meeting, document-sharing, chat, or security-themed lures to enter the supplied temporary code on a genuine Microsoft sign-in page. Because victims complete the authentication and consent themselves, URL checks and MFA may not stop the attack; the resulting tokens can expose email, files, contacts, and other authorized services.
Post-authentication activity can include device registration or Primary Refresh Token issuance, Microsoft Graph queries, mailbox access, and Exchange inbox rules that hide alerts or forward data externally. Defenders should correlate phishing delivery and click telemetry with device-code sign-ins, new-device events, Graph activity, and mailbox-rule changes; contain confirmed incidents by revoking sessions and refresh tokens, disabling unrecognized devices, removing malicious rules, and assessing accessed data. Microsoft recommends blocking device-code flow by default with Entra Conditional Access, first in report-only mode, while maintaining tightly scoped persistent exceptions for legitimate Teams resource accounts and excluding the Device Registration Service where required for enrollment.
Why it matters
Impact assessment
Device-code phishing enables attackers to obtain valid Microsoft 365 OAuth tokens without learning passwords or defeating MFA technically; the victim completes authentication on a legitimate Microsoft page. Affected organizations face email and file-data exposure, fraudulent external mail, persistence through device registration and refresh tokens, and operational disruption during account containment.
- Affected environments: Microsoft Entra ID and Microsoft 365 tenants that permit OAuth 2.0 Device Authorization Grant/device code flow, particularly organizations with users susceptible to Teams, document-sharing, chat, or security-alert lures.
- High-risk users: privileged administrators, executives, finance, HR, users with broad SharePoint/OneDrive access, and Teams resource-account administrators.
- Data at risk: Exchange Online email, contacts, calendars, Microsoft Graph-accessible directory data, OneDrive/SharePoint files, and other services authorized to the requesting application.
- Persistence and evasion: attackers can register an unrecognized device, obtain or maintain Primary Refresh Token-related access, create inbox rules to hide alerts, and forward messages externally.
- Scope: broadly applicable to tenants where device code flow is enabled; legitimate dependencies such as Teams Rooms, Teams Android/shared devices, Azure CLI, developer tooling, and legacy command-line workflows complicate blanket blocking.
- Known exploitation: the reporting describes active abuse patterns and identifies EvilTokens as a phishing kit supporting this technique. The provided references do not identify victim organizations or provide incident-specific IOCs.
Supporting facts
- Microsoft classifies device code flow as a high-risk authentication flow because an attacker can initiate the flow and persuade a user to authorize it.
- Microsoft reportedly observed device registrations within ten minutes of compromise in this activity pattern.
- MFA and URL-reputation controls alone do not reliably prevent this activity because the victim signs in and approves an attacker-initiated request at a genuine Microsoft verification site.


