Microsoft 365 accounts targeted in phishing wave that abuses OAuth device code flow


Attackers are increasingly hijacking Microsoft 365 accounts without stealing passwords by abusing OAuth device code authentication. Security researchers at ANY.RUN say they found more than 180 phishing URLs tied to this technique in a single week, showing how quickly the tactic is spreading.

The method works because victims complete sign-in on a real Microsoft page. Instead of harvesting credentials on a fake login screen, attackers trick users into entering a short verification code at Microsoft’s legitimate device login page, which then grants the attacker access and refresh tokens for the victim’s account.

This makes the attack harder to catch than classic phishing. Security tools often look for fake domains, cloned login pages, or stolen passwords. In this case, the victim authenticates through genuine Microsoft infrastructure over encrypted traffic, so the compromise may stay hidden until suspicious activity appears later in logs or mailboxes.

Attack chain exposed in the Sandbox

Microsoft has already warned that device code phishing is a growing threat. In its Digital Defense Report 2025, the company said it saw a notable uptick in campaigns that capture access and refresh tokens through device code authentication, enabling account access, data theft, persistent access, and lateral movement while the tokens remain valid.

How the attack works

The device authorization grant was built for devices such as TVs, meeting room systems, and other products that cannot easily display a full login page. Attackers start a real device authorization request, obtain a user code, and then lure the victim into entering that code on Microsoft’s real sign-in page. Once the victim finishes authentication, the attacker receives usable tokens tied to the victim’s Microsoft 365 account.

ANY.RUN says many of the observed lures impersonate document-sharing or signing workflows, including fake DocuSign-style pages. These pages instruct users to copy a code and enter it at Microsoft’s legitimate device login site, which lowers suspicion because the destination domain looks safe.

Fake DocuSign page with a verification code

Microsoft described a similar pattern in its February 2025 write-up on Storm-2372. The company said the actor used device code phishing to capture authentication tokens and gain account access, often by sending lures that resembled messaging or meeting experiences.

Why this technique worries defenders

This attack does not need password theft to succeed. It also does not fail just because a user has multi-factor authentication enabled, since the victim completes the MFA challenge during the legitimate sign-in flow. The result is token-based account takeover rather than credential theft.

SSL decryption allows Suricata IDS rules to detect malicious encrypted traffic

For security teams, that changes the investigation path. Analysts may need to trace OAuth token issuance, suspicious app activity, or unusual sign-ins instead of looking for a password spray or a fake login page. Microsoft notes that device code flow is a high-risk authentication method and specifically recommends controlling it with Conditional Access policies.

Key details at a glance

ItemDetails
TechniqueOAuth device code phishing
Main targetMicrosoft 365 accounts
What attackers getAccess tokens and refresh tokens
Password stolen?Not required
MFA bypassed?The victim completes MFA on a real Microsoft page
Why detection is hardUses legitimate Microsoft infrastructure and encrypted HTTPS
Recent signalANY.RUN reported 180+ malicious URLs in one week
Microsoft’s positionDevice code phishing is a growing and high-risk threat

Sources: ANY.RUN, Microsoft Security, Microsoft Digital Defense Report 2025.

What researchers saw in the latest campaign

ANY.RUN says the campaign often hides activity behind JavaScript loaders and encrypted HTTPS sessions. The company says its sandbox exposed backend API calls such as /api/device/start and /api/device/status/, along with an X-Antibot-Token header in the phishing flow. Those artifacts can help analysts cluster related infrastructure and improve detections.

Traffic decrypted with SSL decryption 

The firm also says the most targeted industries include technology, education, manufacturing, and government and administration, while the United States and India have seen the highest concentration of activity in this dataset.

What Microsoft recommends

Microsoft says organizations should treat device code flow as high risk and manage it through Conditional Access authentication flow policies. The company also recommends security measures such as sign-in risk policies, stronger phishing-resistant authentication where possible, token protection controls, and tighter monitoring for suspicious identity activity.

Microsoft’s May 2025 identity defense guidance says defenders should review sign-ins that use device code flow, monitor unusual application consent behavior, revoke suspicious sessions and refresh tokens, and investigate lateral movement after token theft.

Is your business at risk? Most targeted sectors and countries 

What security teams should do now

  • Review whether your organization actually needs device code flow.
  • Use Conditional Access to block or tightly control device code flow where possible.
  • Hunt for recent sign-ins tied to device code authentication in Entra ID logs.
  • Revoke refresh tokens and active sessions for suspected victims.
  • Train users that real Microsoft login pages can still appear in phishing chains.
  • Watch for document-themed lures that ask users to enter a verification code rather than a password.

FAQ

What is OAuth device code phishing?

It is a phishing method where attackers abuse the legitimate device authorization flow to trick a victim into approving the attacker’s sign-in session on a real Microsoft page.

Does this attack steal passwords?

No. The main goal is to obtain access and refresh tokens, not the user’s password.

Can MFA still be bypassed?

The victim still performs MFA, but the attacker benefits because the victim authorizes the attacker’s device code session. That is why the attack can succeed without password theft.

Is Microsoft aware of this tactic?

Yes. Microsoft has published multiple warnings about device code phishing, including threat reporting on Storm-2372 and broader guidance in its Digital Defense Report 2025 and Entra Conditional Access documentation.

How can organizations reduce the risk?

The strongest step is to restrict or block device code flow where it is not needed, then monitor sign-ins, revoke suspicious tokens, and educate users about code-entry lures that use real Microsoft pages.

Readers help support VPNCentral. We may get a commission if you buy through our links. Tooltip Icon

Read our disclosure page to find out how can you help VPNCentral sustain the editorial team Read more

User forum

0 messages