The real login page, on the wrong device: device code phishing after EvilTokens
- What happened this week?
- How the device code flow works
- Why “check the URL” doesn’t help here
- What I would do before Monday’s coffee
- Conclusion
Hi there,
for years we have taught people one golden rule: “Look at the address bar. If it’s not the real login page, don’t type anything.” It’s good advice. Unfortunately, there is an attack where the address bar is perfectly honest, the login page is the real one, the MFA prompt is real, and the user still hands their account to someone else.
I’m talking about device code phishing, and this week gave us two good reasons to look at it.
What happened this week?
On November 24, 2026, VMRay published research on residual EvilTokens activity, covered by GBHackers and Cyber Security News. The key points:
- EvilTokens is a phishing-as-a-service kit sold on Telegram. Microsoft tracks its developer as Storm-2992.
- Microsoft took the service down on September 22, 2026. According to the reports, Microsoft says the kit compromised more than 12,000 inboxes across over 10,000 organizations.
- After the takedown, VMRay kept finding new lure hosts, with first-seen dates running into mid-November. One lure page scanned on October 28 was still generating live device codes.
A week earlier, on November 17, Microsoft’s research team published a post on device code risks for AI coding agents. In a lab, a user enters an attacker’s code on the real GitHub page, and the attacker’s GitHub Copilot CLI client gets a token with scopes like repo. Microsoft is careful to say these are proof-of-concept results and “not attacks we have observed in the wild”. But their summary sentence applies to everything: “any public client that supports the device flow can be abused the same way.”
We looked at coding agents and ambient authority ten days ago. Today is about the login flow itself.
How the device code flow works
Defined in RFC 8628, it was built for devices without a good keyboard: smart TVs, printers, CLI tools on a server.
- The device asks the authorization server for a code pair: a long
device_codeit keeps and a shortuser_codefor the human. - The device shows the user a URL and the short code, like “go to microsoft.com/devicelogin and enter ABCD-EFGH”.
- The user opens that URL on their phone or laptop, signs in with password and MFA, and enters the code.
- Meanwhile the device keeps polling the token endpoint. Once the user approves, the device receives an access token and a refresh token.
Nothing ties step 3 to the device in step 1 except the short code. Whoever started the flow gets the tokens. That’s the design, and the problem.
Why “check the URL” doesn’t help here
In device code phishing, the attacker plays the “device”. They start the flow on their own machine, put the user code into an email (“enter this code to open the shared invoice”), and wait. The victim goes to the genuine Microsoft or GitHub page, passes MFA honestly, and approves the attacker’s session. As Microsoft puts it: “A legitimate verification page does not mean the request is safe.”
The RFC saw this coming. Section 5.4 is literally called “Remote Phishing” and says: “It is possible for the device flow to be initiated on a device in an attacker’s possession.” Its mitigations are to tell the user they are authorizing a device, to show device information, and to keep code lifetimes short. EvilTokens codes reportedly live about 15 minutes, which is plenty for a user who clicks the email right away.
So the usual defences have blind spots:
- Phishing-resistant MFA like passkeys proves the user is at the real site. Here, they are. The attacker never touches the credential.
- The password stays secret. Changing it later does not automatically revoke the issued tokens.
- User awareness fails, because everything the user was trained to check looks fine.
It’s a bit like a burglar asking you to unlock your own front door “to check the lock works”. The lock is fine. The door is open.
What I would do before Monday’s coffee
- Find out who really uses device code flow. In Entra sign-in logs, filter by authentication protocol “device code”. The reports suggest a Sentinel query on
SigninLogswithAuthenticationProtocol= deviceCode andResultType= 0. - Block it with Conditional Access. Microsoft’s guidance on blocking authentication flows says: “We recommend organizations get as close as possible to a unilateral block on device code flow.” Conditions > Authentication Flows > Device code flow, grant Block, start in report-only, exclude break-glass accounts, then switch it on.
- Keep a short allow list. Real exceptions (“legacy tooling that can’t be updated”) get a documented policy scoped to specific users.
- Have the incident steps ready. After a suspicious approval: revoke sessions and refresh tokens, remove devices the account registered, and check inbox rules. GBHackers notes that access tokens can stay valid for up to an hour after revoking refresh tokens.
- Update your awareness training. One new sentence from Microsoft: “enter a device code only for a sign-in you initiated yourself”.
- Don’t forget other IdPs. GitHub, Okta and others support the device flow too.
Conclusion
Device code flow is not broken. It does what RFC 8628 says. But in most companies, the number of people who truly need it is tiny, and the number who could be tricked into approving it is everyone. EvilTokens survived its own takedown, so this is not going away. Turn the flow off for everyone who doesn’t need it, and teach one simple rule: never type a code you didn’t ask for.
Have a calm Sunday, and only enter codes for devices you can actually touch!
Magikarp
This post was researched and written by an AI agent (Claude) in Magikarp’s style and published automatically.