What it is
Device-code phishing abuses a genuine Microsoft sign-in method, the kind made for devices and tools that cannot show a full browser. The attacker starts a sign-in, then persuades someone to enter the resulting code on Microsoft's real sign-in page. The victim completes their usual checks and, without knowing it, approves the attacker's session. No password is stolen and no malware is used.
EvilTokens is a criminal service, sold on Telegram, that packages this technique for buyers. Huntress reports a 16-day wave beginning on 2 March that affected 344 organisations across five countries. It arrives as an email with a link. Lures were matched to the reader's work, such as construction bids and document-signing requests. A separate case in mid-October used a fake Teams meeting booking.
Microsoft says it worked with industry and law enforcement partners to disrupt EvilTokens in September 2026. Huntress saw the technique again in October and says similar kits are operating. Email filtering alone did not stop it, because the links and sign-in pages were genuine. What works is restricting device-code sign-in, phishing-resistant two-step sign-in, and watching sign-in behaviour.
Who uses it: EvilTokens is a phishing-as-a-service kit sold on Telegram to other criminals; the sources do not name its operators or its buyers. Huntress does not attribute the mid-October Teams booking case to EvilTokens or to a named group, and Microsoft separately names Storm-2372 as one earlier device-code phishing campaign.
How it attacks
Technique IDs are as listed by Huntress for the October 2026 Teams booking case (T1566.002 and T1528 are also listed by Microsoft for its lab simulation), except T1114.002, which is our mapping of the mailbox scanning Huntress describes for EvilTokens.
| Stage | What it does | ATT&CK techniques |
|---|---|---|
| Resource development | Criminals buy access to a ready-made kit such as EvilTokens, which supplies the phishing pages, the lures and the token capture. In the October case the attacker registered a lookalike domain eight days beforehand and placed Teams-themed landing pages on it. | T1583.001 Acquire Infrastructure: DomainsT1608.005 Stage Capabilities: Link Target |
| Initial access | A phishing email carries a link to a lure page, sometimes passed through redirects on trusted services so that the link looks clean to email security. EvilTokens lures were generated with AI to match each reader's role. | T1566.002 Phishing: Spearphishing Link |
| Execution | The lure page shows a code, presented as a verification code or booking reference, and opens Microsoft's real device sign-in page. The victim enters the code and completes two-step sign-in as normal. | T1204.001 User Execution: Malicious Link |
| Credential access | Once the code is entered, Microsoft issues valid tokens to the attacker's waiting sign-in request. EvilTokens generated the code at the moment the victim opened the page, which removed the short time limit that used to restrict this attack. | T1528 Steal Application Access Token |
| Defence evasion and command and control | In the October case the phishing kit was delivered encrypted and unpacked only in the browser, so scanners that do not run JavaScript saw nothing useful. The attacker's sign-in came through a home internet address used as a proxy; the EvilTokens campaign relayed sign-ins through a legitimate cloud hosting platform, Railway. | T1027.013 Obfuscated Files or Information: Encrypted/Encoded FileT1090 Proxy |
| Lateral movement and collection | The captured session is reused from the attacker's own systems to act as the victim. EvilTokens could then scan the inbox, calendar invites and documents, and draft and send payment-fraud emails in the victim's own style within minutes. | T1550.004 Use Alternate Authentication Material: Web Session CookieT1078.004 Valid Accounts: Cloud AccountsT1114.002 Email Collection: Remote Email Collection |
How to detect it
- Microsoft Entra sign-in logs: Device-code sign-ins by users or roles that have no need for them, especially from unmanaged devices, new regions or home-broadband addresses used as proxies. Huntress lists the sign-in value Cmsi:Cmsi as marking the successful device-code sign-in in its case.
- Microsoft Entra sign-in logs (interactive and non-interactive): Sign-ins that follow with scripted user agents such as python-requests or node, which point to automated tooling rather than a person.
- Session records in sign-in logs: The network provider and region changing within one session ID, which shows a session being reused from somewhere else.
- Sign-in source addresses: Sign-ins arriving from cloud application hosting platforms. Huntress found the EvilTokens wave because hundreds of sign-ins came through the same Railway infrastructure.
- Directory audit logs: New device registrations, and after a suspected compromise any added two-step sign-in methods, unrecognised registered devices or unexpected app consents.
- Mailbox audit and mail flow: New or odd mailbox rules and unusual outbound mail from the account, such as payment requests the user did not write.
- Email, Teams and code-hosting audit logs (developer accounts): A suspicious message or click followed by a new sign-in token for a developer tool. Microsoft built detections on this pattern after showing in a lab, not in real attacks, that the same trick works against an AI coding tool's sign-in.
What reduces the risk
- Use Conditional Access to block device-code sign-in, allowing it only for the users and scenarios that need it. M1036 Account Use Policies
- Move to phishing-resistant two-step sign-in (FIDO2 security keys or passkeys). Huntress says SMS codes are not enough. M1032 Multi-factor Authentication
- Teach one rule: enter a sign-in code only for a sign-in you started yourself. Check unexpected requests with the sender through a contact you already know. M1017 User Training
- Watch for new device registrations and unfamiliar device-code sign-ins, and revoke the account's refresh tokens as soon as compromise is suspected. M1018 User Account Management
- After any suspected case, review the account for added sign-in methods, registered devices, app consents and mailbox rules, and remove what should not be there. M1047 Audit
- For developers, review the apps authorised on code-hosting accounts, revoke unexpected ones, and limit repository access to what each role needs. M1018 User Account Management
Sources
- How EvilTokens Turbocharges Old School Phishing with AI Huntress, 11 May 2026
- Crafty Microsoft Teams Booking Flow Disguises Device Code Phishing Huntress, 12 November 2026
- The risks of device code authentication for AI coding agents Microsoft Security Blog, 17 November 2026
Every statement was checked against the sources below on 2026-11-28. The technique IDs are those listed by Huntress and Microsoft, apart from T1114.002, which is our own mapping; the mitigation IDs are our mapping to MITRE ATT&CK. Written by us from the public sources above, unlike the vulnerability entries, which are built by rule. General information, not advice for your systems.