Device Code Phishing: The Microsoft Login Can Be Real

Author: Ami DePierro | Co-Founder, 2 Dog Digital

Ami DePierro is Co-Founder of 2 Dog Digital and a former U.S. Marine Intelligence Analyst who brings analytical precision to cybersecurity strategy for small and mid-sized businesses across the Raleigh/Triangle area. Digit is the voice. Ami is the author.

Table of Contents

One of our clients got phished recently.

The employee did something plenty of smart, competent people could do. They followed what appeared to be a legitimate authentication process and eventually landed on Microsoft’s actual device login page.

Not a convincing copy.

Microsoft.

They authenticated.

And the attacker got access.

Thankfully, our security stack detected the suspicious activity and raised the alarm before the attacker had time to settle in.

That last part matters because this particular device code phishing attack is built around something most employees have been taught to trust: a legitimate Microsoft sign-in.

A Client Just Fell for This Attack

Microsoft has been tracking a widespread device code phishing campaign that abuses a legitimate Microsoft authentication process.

In September 2026, Microsoft Threat Intelligence reported that a phishing-as-a-service platform called EvilTokens had helped compromise more than 12,000 inboxes across more than 10,000 organizations worldwide.

That is not somebody in a basement sending badly spelled emails and hoping Grandma clicks.

The platform gives criminals ready-made phishing infrastructure, templates, victim tracking, token management and AI tools that can tailor phishing messages to specific targets. Microsoft has observed lures involving invoices, RFPs, document signing, voicemail notifications and other ordinary business activity.

In other words, the email may look like something you deal with every Tuesday.

Our client encountered this attack in the real world. Their experience is a good reminder that security controls need to account for what happens after someone clicks, because eventually somebody will.

Digit’s Rule #10: If you clicked before you thought, stop touching things and call IT.

The sooner we know, the more options we have.

What Is Device Code Phishing?

Device code authentication is a legitimate Microsoft process.

It exists because some devices are lousy places to type a password. Think smart TVs, printers and conference-room equipment. The device displays a short code. You open a browser somewhere easier to use, enter the code and authenticate your account.

Perfectly reasonable.

Device code phishing abuses that same process.

The attacker starts an authentication request and gets a device code. The victim is tricked into entering that code and approving the authentication.

The victim thinks they are signing themselves into something.

They are actually authorizing the attacker’s session.

The password does not need to be stolen for the attacker to receive valid authentication tokens.

That distinction is important.

How a Real Microsoft Login Becomes Part of the Attack

Most phishing training teaches employees to inspect the login page.

Check the URL. Look for misspellings. Be suspicious if Microsoft suddenly looks like it was designed in somebody’s garage.

Good advice.

It does not solve this one.

Microsoft documented campaigns in which victims were redirected to the legitimate microsoft.com/devicelogin portal. The malicious infrastructure generates a live device code just before the victim needs it, then sends the victim into Microsoft’s real authentication process.

That is why the attack is so effective.

The fake part happens earlier.

The attacker controls the request that started the process. Microsoft handles the authentication that finishes it.

The front door is real. The person who asked you to open it is the problem.

MFA Did Its Job. The Attacker Used It Against You.

This is where people start saying MFA failed.

Not quite.

If the victim is not already signed in, Microsoft may ask for the password and MFA as part of the device code authentication. The employee successfully proves to Microsoft that they are who they say they are.

Microsoft then issues valid access to the session being authorized.

Unfortunately, that session belongs to the attacker.

In some cases, a user who is already authenticated may only need to paste the device code and approve the request.

Microsoft describes the result as the issuance of valid access and refresh tokens without the attacker stealing the victim’s password.

So no, I am not telling you to turn off MFA.

Quite the opposite.

Digit’s Rule #5: Multi-factor authentication isn’t optional. Neither is locking the front door.

MFA still stops plenty of attacks. Businesses should also be moving toward phishing-resistant authentication methods such as passkeys and FIDO2 security keys where appropriate.

One security control was never supposed to do the entire job.

EvilTokens Turned Phishing Into a Service

The scale gets more interesting when you look at EvilTokens.

Microsoft says EvilTokens emerged in February 2026 and quickly became one of the most widely used phishing-as-a-service platforms. Criminals can buy access to the toolkit rather than building the attack infrastructure themselves. Apparently cybercrime needed subscription software too.

EvilTokens includes prebuilt phishing templates and infrastructure for managing captured tokens. Its AI capabilities can help criminals create messages tailored to a victim’s role.

After compromising an account, the platform can also help analyze mailbox activity to identify valuable targets.

Finance gets interesting.

Executives get interesting.

Anyone with access to sensitive information or authority over money gets very interesting.

Microsoft has observed attackers using compromised access to search for wire transfer information, pending invoices and executive correspondence. Attackers may also create inbox rules to hide messages and maintain access.

A compromised mailbox is useful for more than reading email. It can become the starting point for the next attack.

Why Detection After the Click Matters

I’d love to tell you that enough employee training makes clicking disappear.

It doesn’t.

Train people anyway.

Good security awareness training reduces risk. Employees should know that an unexpected device-code request deserves suspicion, even when the final authentication page belongs to Microsoft.

Then build your security assuming a human will eventually have a human moment.

Our client’s employee completed the authentication. Petra caught the suspicious activity.

That is exactly why monitoring matters.

Prevention gets most of the attention because stopping an attack sounds better than detecting one. Fair enough. Detection matters when prevention misses.

You need controls capable of recognizing activity that does not fit the user’s normal behavior and people who know what to do when the alert appears.

A security alert nobody sees until Monday morning is mostly documentation.

How Businesses Can Reduce the Risk

Microsoft’s first recommendation is pleasantly direct: block device code flow wherever possible.

If your organization legitimately needs it for certain equipment, Microsoft recommends controlling device code authentication through Conditional Access rather than leaving it broadly available.

Your IT or security team should also review:

  1. Where device code authentication is actually needed. If nobody can explain the business reason for it, investigate before leaving it enabled.
  2. Conditional Access policies. Restrict device code flow to the accounts and circumstances that genuinely require it.
  3. Phishing-resistant MFA. Evaluate passkeys, FIDO2 security keys and other phishing-resistant methods, particularly for privileged accounts.
  4. Sign-in risk monitoring. Suspicious authentication patterns should generate action, not merely another line in a log.
  5. Email protections. Microsoft recommends anti-phishing policies and Safe Links in Defender for Office 365. Safe Links can contribute to high-confidence device code phishing alerts.
  6. Employee training. Teach the specific behavior. An unexpected request to enter a device code is something to verify with IT before continuing, even when the browser ends up at Microsoft.

The CIS Controls and NIST Cybersecurity Framework both emphasize layered controls, access management and detection. This attack is a fairly good demonstration of why.

You are trying to prevent the click.

You are also preparing for the day prevention loses.

What to Do If Someone Falls for It

Do not spend the first ten minutes deciding whose fault it was.

Contain it.

Microsoft recommends responding to suspected device code phishing by revoking refresh tokens and considering Conditional Access policies that force reauthentication. Microsoft also warns that existing access tokens may remain active for up to an hour after standard session revocation.

For immediate containment, Microsoft recommends temporarily disabling the compromised account.

Your security team should also investigate for suspicious inbox rules, unusual device registrations and unexpected Microsoft Graph activity. Look for evidence that email was accessed or exfiltrated.

Then determine what the compromised account could reach.

And please tell your IT team what actually happened.

Embarrassment has extended more incidents than clicking ever did.

We cannot investigate the part of the story somebody decided to leave out.

The Part I Want Business Owners to Remember

Device code phishing works partly because the attack borrows trust from Microsoft.

The employee may recognize the Microsoft domain. They may successfully complete MFA. Nothing on the final page necessarily screams “phishing.”

That changes what employees need to understand.

Do not teach people that a real login page proves the entire process is safe. Teach them to think about what caused the authentication request in the first place.

And build the technical controls behind them.

For our client, somebody clicked. Our security stack caught what happened next.

That is what layered security is supposed to look like.

  • Block device code authentication when the business does not need it.
  • Treat unexpected device-code requests as suspicious.
  • Use phishing-resistant MFA where appropriate.
  • Make sure someone is watching for abnormal authentication after the click.

If you are not sure whether device code flow is enabled in your Microsoft 365 environment, or whether your current security stack would detect this kind of attack, 2 Dog Digital can take a look.

We offer a no-charge cybersecurity assessment. You will learn something either way.

2 Dog Digital
Your best friend for IT services.

FAQ

Device code phishing is an attack that abuses Microsoft's legitimate device authentication process. The attacker starts a device-code session and tricks the victim into authorizing it. The victim may authenticate through Microsoft's real website, but the access tokens generated by that authentication can be delivered to the attacker's session.

Device code phishing can succeed even when MFA is enabled because the victim may complete MFA while authorizing the attacker's session. MFA still provides important protection against many attacks. Microsoft recommends combining it with Conditional Access and phishing-resistant authentication methods such as passkeys or FIDO2 security keys.

Start with context. If you are connecting a device and expected a device-code request, it may be legitimate. If an email, shared document, invoice or unexpected link suddenly tells you to enter a device code, stop. Contact your IT team using a known method before approving the request.

Contact your IT or security provider immediately. Microsoft recommends revoking refresh tokens and considering temporary account disablement for immediate containment. Your security team should investigate authentication activity, inbox rules, device registrations and account access to determine what the attacker did after obtaining the token.