Back to all lessons
Awareness Lessons
2 months ago

EvilTokens Phishing-as-a-Service Exploits Device Code Authentication Flow

Written by AI from the linked story. Not reviewed by an editor. How this works

The EvilTokens operation exploited Microsoft's device code authentication flow — a legitimate feature designed for input-constrained devices — to trick users into granting persistent OAuth tokens to attacker-controlled applications. Once a token is captured, attackers gain long-term access to Microsoft 365 accounts without needing the user's password or MFA code, effectively bypassing standard credential protections. This matters because phishing-as-a-service platforms lower the technical barrier for attackers, enabling even unsophisticated threat actors to launch enterprise-grade credential theft campaigns at scale. Microsoft's takedown of 50 websites and 150+ domains highlights how critical infrastructure disruption is becoming a key defensive lever, but organizations cannot rely solely on vendor intervention to protect their users.

Tactical Insight

Immediate actions

  • Disable or restrict the OAuth device code flow in Azure AD Conditional Access policies unless it is explicitly required for specific devices.
  • Audit current OAuth application consents across your Microsoft 365 tenant and revoke any unrecognized or overly permissive token grants.

Security awareness measures

  • Train users to never approve device code authentication prompts they did not personally initiate, treating unsolicited requests as a red flag.
  • Run simulated device code phishing exercises to build organizational muscle memory for recognizing this specific attack vector.

Detection and long-term improvements

  • Enable Microsoft Entra ID (Azure AD) sign-in logs and alert on device code authentication events originating from unexpected geographies or devices.
  • Implement Conditional Access policies requiring compliant, managed devices and named locations before permitting OAuth token issuance.
  • Adopt a Zero Trust posture by continuously validating session integrity and enforcing token lifetime limits with refresh token revocation capabilities.

Back this up with a control

All controls and vendors

Training helps people spot this. These controls make the attack fail even on the day someone does not.