Your M365 Tenant Is One AI Phishing Email From a 90-Day, MFA-Invisible Compromise
The Attack Chain Your Controls Can't See
An active phishing campaign is exploiting a structural gap in Microsoft's authentication architecture: the OAuth device code flow. Originally designed for input-constrained devices like smart TVs and IoT hardware, this flow is enabled by default for all users in most Entra ID configurations. Attackers have turned it into a full MFA bypass.
The attack works like this: AI-generated phishing emails — using QR codes, file-share links, and highly varied lures — direct victims to initiate a Microsoft device authentication flow. The attacker captures the resulting OAuth token, which grants persistent access for up to 90 days without requiring the victim's password or triggering any MFA challenge. The phishing infrastructure runs on Railway, a legitimate cloud PaaS, so URLs pass reputation-based email filters.
This attack succeeds after your email filter, after your MFA — at the identity layer where most organizations have the least detection coverage.
Why Traditional Detection Fails
| Detection Method | Effectiveness | Why It Fails |
|---|---|---|
| Email signature/pattern matching | Low | AI-generated lures with high variability defeat pattern matching |
| URL reputation filtering | Low | Railway PaaS domains are initially reputation-neutral |
| MFA enforcement | None | Device code flow sidesteps MFA entirely by design |
| Failed login alerting | None | No failed logins occur — token grant is clean |
| Standard identity monitoring | Low | Token usage looks like legitimate API access |
Hundreds of businesses are already compromised. Huntress pushed emergency conditional access policy updates to tens of thousands of tenants. If you haven't taken equivalent action, you're exposed.
The Broader Pattern
This campaign is a proof point for a structural shift in cybercrime. The combination of generative AI for high-variability lure generation at scale, easy-to-deploy cloud platforms for disposable infrastructure, and authentication protocol design gaps creates an operating model that will produce increasingly diverse, increasingly evasive attacks. Your defensive architecture needs to shift from pattern-matching at the perimeter to behavioral analysis at the identity and data layers.
What to do
Block device code authentication flow in Entra ID conditional access policies for all users except explicitly exempted service accounts — this is a single-policy change with the highest ROI available today
Query Entra ID sign-in logs for 'deviceCode' grant type over the past 90 days; investigate anomalous locations, bulk mailbox access, and new forwarding rules
Add railway.app and associated subdomains to email gateway and web proxy blocklists; conduct retroactive email log search for Railway-linked URLs
Run a purple team exercise using AI-generated phishing with QR codes and varied templates to measure your SEG's detection rate; if below 80%, procure supplementary behavioral detection