Device code phishing security alert: we signed them in, nobody noticed. A diagram shows an employee approving MFA on Microsoft's legitimate sign-in page while the attacker's device gets the access.

Device Code Phishing: The Attack Your People Approve With MFA

December 03, 2026•14 min read

Device code phishing · Part 1 of 4

Has anyone ever taken the time to really walk you through device code phishing? It's the attack where someone, perhaps anywhere in the world, talks one of your good people into signing in for them (on Microsoft's legitimate sign-in page, often showing your company's branding) and then stays in for an extended duration (weeks or months, if nobody notices). If one of your people did exactly that this afternoon, password and MFA included and through no fault of their own, how would you find out?

If those questions land in an uncomfortable zone, you're in good company. This attack is hard to see by design, and it has fooled careful, capable people. Laid out plainly, it's not hard to follow.

In short: Device code phishing is an attack on a normal Microsoft 365 sign-in. An attacker asks Microsoft for a short sign-in code, then gets one of your employees to type it on Microsoft's legitimate sign-in page. Your employee signs in with their own password and approves a genuine MFA (multifactor authentication) prompt. Microsoft then hands the access to whatever asked for the code, and that's the attacker's device.

Below are three documented ways attackers put that code in front of your people (and one that can end with a call to your own service desk), what the access reaches, and what a sharp technologist sees that others miss.

How it works

What is device code phishing, and why does the sign-in look normal?

Device code phishing turns a convenience feature against you. A screen without a keyboard (a meeting-room display, say) signs in by showing a short code that a person types on a phone or laptop. The person signs in on one device, and the screen gets the access. The attacker just plays the part of that "other screen."

The feature comes from an open industry standard (the OAuth 2.0 device authorization grant, RFC 8628). Microsoft calls it device code flow, and your company may rely on it for Teams Rooms devices and some admin tools (for instance, command-line tools your administrators sign in to).

This is the part that matters most (the flow's Achilles' heel): the code proves nothing about who asked for it. Microsoft says Entra ID (the sign-in service behind Microsoft 365) has no reliable way to confirm that the person typing the code is on the device that requested it. Because the page is genuine, the attack is also harder to recognize. Everything your people learned to check (the web address, the padlock, often your own company logo) militates against suspicion here. The MFA prompt is the one your people approve every day, so approving it feels responsible.

Device code phishing: a finance manager approves an MFA prompt on her phone while an attacker's laptop opens her email and files.

Why MFA doesn't stop device code phishing

MFA, as important as it is, doesn't stop this. MFA proves the right person signed in. It conveys nothing about where the access goes. In Your MFA Is On. Is It Actually Covering You? I wrote, "On is easy. Covered is a different word…" Here MFA is on, works as designed, and still doesn't cover you.

One sign-in, two places: in device code phishing, Dana signs in on Microsoft's legitimate page with genuine MFA, and the access goes to the attacker's device.

An old word explains the gap. Technology comes from the Greek tekhne (art, craft, skill) and -logy (the study of). It names the skill of applying a tool, not the tool itself. Owning MFA means having the tool. Knowing where a sign-in sends its access, and spotting this attack as it happens, takes true craft. Most technologists never learned this corner of it, because it rarely seems germane until it shows up in an article or, worse, someone uses it against you.

Want to walk through device code phishing in your own tenant? Contact Shawn to schedule a call.

Three documented methods

How do attackers get the code in front of your people?

Attackers don't need to break anything. They simply need a believable reason for someone to type a code within 15 minutes (its default life). Microsoft has documented three very different reasons that work:

  • Patience and a meeting invite

  • A link that makes a fresh code on the spot

  • A call from someone claiming to be IT

I invented the names below, but Microsoft documented every method.

The trusted contact's meeting invite

Dana runs month-end close in finance. For two weeks she's chatted with someone she believes is a respected contact, first on a messaging app, then on Teams. A Teams invite arrives with a code to join. She types it on Microsoft's page and approves MFA. The meeting never starts. In the campaign Microsoft tracked as Storm-2372 (which Microsoft now ties to Midnight Blizzard), the attackers searched mailboxes for words like "password" and "admin," phished coworkers from the victim's own account, and registered their own device in the company directory to stay in.

The link that writes its own code

Lena works in accounts payable. An email about a pending invoice asks her to verify her identity first. She clicks, and the page shows a code (already on her clipboard) and a button to continue to Microsoft. The page made that code the moment she clicked, so her 15 minutes start then, not when the email arrived. In the campaign Microsoft described in April 2026, AI-written lures matched each target's role. The attackers hunted for wire transfer details and pending invoices, set inbox rules to hide messages, and sometimes registered a new device within ten minutes. Microsoft's VP of security research told The Register that 10 to 15 distinct campaigns were launching every 24 hours, with hundreds of compromises a day.

The call from "the help desk"

Sam's personal phone rings, and the caller says he's from IT, finishing Sam's passkey setup. Sam types a code on Microsoft's own page. In the activity Microsoft reported in September 2026, attackers then added their own phone (authenticator app) to the account (their own way through MFA from then on), mapped users, groups and admin roles, and went through large volumes of SharePoint, OneDrive and email. Microsoft's report points to possible extortion.

A service desk technician stops mid-call when an employee reports a timed-out device code from IT: who sent you that code?

When Sam calls your real service desk

Now picture a moment Microsoft's report doesn't describe (an illustration, not a documented case). The fake IT caller is still coaching Sam through the sign-in, but the code only lasts 15 minutes. Time runs out, the sign-in fails, and Sam (frustrated, and still trying to do the right thing) calls your actual service desk. Sam isn't lying. He has no idea he's in the middle of an attack. I've personally seen this type of call go several different ways. Here are two.

Two ways the call can go

Scenario one: the technician trusts Sam. Sam calls in, frustrated. "IT called me about a code, and it timed out. Can you help me get back in?" The technician hears a legitimate employee with a commonplace problem, and he's right to want to help. Sam passes every identity proofing check, because he is who he says he is. So the technician tells him to get a fresh code from "IT" and stays on while he types it in. The ticket closes as resolved. Both of them stay oblivious: the sign-in just handed an attacker Sam's access. The technician did his job exactly the way he was taught.

Scenario two: the technician knows better. Same call, same words. This technician stops at "IT called me about a code." He knows what that line portends. Who called you? What code? Our IT doesn't call people and read them codes. He keeps Sam on the line, tells him not to enter anything, and escalates it to security as a phishing attempt in progress. The attacker never gets in.

Both service desk techs were kind, solicitous and quick. Both followed the business process. The difference between them is their craft and skill. The first one knows the tools and his business process. The second one sees beyond it. He knows how this attack works, so he hears the incongruity in one sentence and quickly acts on it, without making Sam feel foolish. Your people can learn that skill, and it's the gap this series is about.

Three documented device code phishing lures (a meeting invite, an invoice link and a fake help desk call) all end with the attacker getting access.

What's at stake

What's at stake, and where does your tenant stand?

Whatever the employee (the one who typed the code) can reach, the attacker can reach too, for as long as the access lasts. For most people, that's email, files and Teams. For someone with an active admin role, it can also mean administrative control of your tenant (your company's Microsoft 365 environment). Closing the browser doesn't end it.

  • Sensitive data: mail, files and Teams chats, including contracts, payroll and invoices.

  • Administrative control: Microsoft limits an app to what both the app and the signed-in person may do (delegated access). If the person who typed the code has an active admin role, the attacker's app can act with it.

  • Staying power: when the app asks for ongoing access, Microsoft issues a refresh token that lasts 90 days by default and replaces itself each time it's used. Added devices and MFA methods (a device registered in your directory, or an authenticator app on the attacker's phone) can outlast that.

  • Borrowed trust: the next phishing email garners instant credibility because it comes from a coworker's own account, and payment fraud starts from an inbox people know.

Would you know right away?

A common belief sits under all of this: "If we get breached, we'll know right away." It's specious: it feels right, because a break-in should be loud. This one isn't. Nothing malicious runs on your devices (there's no malware for your security tools to catch), and no password changes hands. The sign-in record shows a legitimate employee passing MFA, and routine work under that name obscures what follows. The attacks I worry about most look like an ordinary Monday.

Where your tenant stands against device code phishing

Where your tenant stands decides how this ends. It sits in one of five places:

  • No protection: the code works, and the attacker gets in by all three methods.

  • Security defaults (Microsoft's free tenant defaults), tenant created since July 1, 2026: device code sign-ins stop for everyone. The meeting-room screen that genuinely needs a code stops too, because the defaults allow no exceptions.

  • Security defaults, older tenant: Microsoft's documentation leaves this unclear, so it's worth testing rather than blithely assuming you're covered.

  • Conditional Access (Microsoft's sign-in policy engine) with no device code policy: the code still works. (Microsoft's managed block policy, when it's on, counts as a device code policy.)

  • Conditional Access with a device code block: the block obviates all three methods for everyone in scope, while the few devices with a documented business need keep working inside limits someone understands and owns.

Where your tenant stands against device code phishing: five tenant setups compared, from no protection to Conditional Access with a block policy.

Which of those five is your tenant in today? A sharp technologist can answer that in minutes (from the policies themselves, not a cursory look at a dashboard) and elucidate why. He can explain where a sign-in sends its access, name each exception and what it leaves open, and help your service desk recognize the call that comes in mid-attack (the one that starts "IT called me about a code"). He isn't rare by nature. He's usually someone who got to study this before it mattered. When he can do it, leadership sees what's protected and what isn't, and has an honest answer when a board member or an insurer asks.

No alerts, no alarms: an IT dashboard shows sign-in success with MFA while an attacker works through company email for weeks, unnoticed.

Start with ten minutes

Picture a month from now. Someone in finance gets a meeting code that seems a little off, and instead of a compromise nobody notices, you hear about it from your service desk, who caught it while the call was still live. Your technologist shows you where your tenant stands and what each choice leaves open, and nobody in the room is guessing. One thing to do today: spend ten minutes with the Introduction level of the Device Code Phishing What-If Simulator. Watch Dana's Monday play out, then ask your team one question: would our tenant have stopped this? Or hand it to them and ask for the answer.

Try the What-If Simulator

Schedule a call

For your technologists: Part 3, Three Device Code Attacks, Step by Step, Inside Microsoft Entra ID, walks these same attacks one step at a time for the people who read your sign-in logs. Next for you: Part 2, What Each Level of Protection Costs Your Business.

Frequently asked questions

What is device code phishing?

Device code phishing is an attack on Microsoft 365's device code sign-in, which Microsoft built for screens without keyboards. An attacker requests a short sign-in code from Microsoft and persuades an employee to type it on Microsoft's official sign-in page. The employee signs in with their own password and MFA, and Microsoft gives the access to the attacker's device.

Does MFA stop device code phishing?

No. The employee completes MFA honestly, on Microsoft's genuine page, so MFA works exactly as designed. MFA proves the right person signed in. It doesn't check which device receives the access. That's why Microsoft treats device code flow as a high-risk sign-in method and recommends blocking it wherever possible.

Why don't employees notice a device code phishing attack?

Because nothing looks wrong. The address is Microsoft's, the page is real, and the MFA prompt is the same one they approve every day. Microsoft notes that the genuine page makes the attack harder to recognize. Attackers add a believable reason, such as a meeting code, a document to verify or a call from "IT."

What can an attacker reach after a device code phishing attack?

Whatever the employee could reach, within what the attacker's app may do: email, files and Teams for most people, and administrative control if the employee had an active admin role. Attackers in Microsoft's reports also registered their own devices and sign-in methods so they could keep coming back.

How is device code phishing different from regular phishing?

Regular phishing usually sends people to a fake sign-in page to steal a password. Device code phishing uses Microsoft's legitimate sign-in page, so there's no fake page to spot and no password to steal. The employee completes MFA, and Microsoft hands the access to whatever device asked for the code: the attacker's.

Related reading: Your MFA Is On. Is It Actually Covering You?, How to Read a Conditional Access Policy Without Trusting the Name, Phishing-Resistant MFA for Admins Without the Lockout and Security Control Decay: The Risk You Already Signed Off On.

Glossary

  • Device code: A short code a device shows so you can finish signing it in on another device.

  • Device code flow: Microsoft's name for that kind of sign-in, built on an open industry standard (the OAuth 2.0 device authorization grant).

  • Microsoft Entra ID: The identity and sign-in service behind Microsoft 365.

  • MFA (multifactor authentication): A second proof beyond the password, such as approving a prompt on your phone.

  • Access token: The digital pass an app shows to reach email, files or Teams.

  • Refresh token: A longer-lived pass an app uses to get new access tokens without the person signing in again.

  • Tenant: Your organization's own Microsoft 365 and Entra ID environment.

  • Security defaults: Microsoft's free, preset protections for a tenant, either all on or all off.

  • Conditional Access: Microsoft's policy engine that decides, at each sign-in, whether to allow it, ask for more or block it.

  • Service desk: The internal team your employees call for IT help.

Sources

From Microsoft:

Other sources:

Disclaimer

This article provides independent educational guidance from Dynamic Technical Solutions (DTS), based on information and Microsoft documentation available at the time of publication or most recent revision. Microsoft may change features, settings, policies, and procedures. Review the linked Microsoft sources for current guidance and confirm applicability to your environment before making changes.

DTS is not affiliated with, endorsed by, or sponsored by Microsoft. Microsoft, Microsoft 365, Microsoft Entra, Microsoft Graph, Microsoft Teams, SharePoint, and OneDrive are trademarks of the Microsoft group of companies. All other product names and trademarks belong to their respective owners.

Back to Blog

About the author

Shawn May, Principal Security Architect at Dynamic Technical Solutions

Written by Shawn May, founder of Dynamic Technical Solutions (DTS). Enterprise identity and security architect with over 30 years of IT experience, specializing in Microsoft identity security, IAM, and technical mentoring. LinkedIn · My story · Contact

On This Page

The links to this article’s sections fill in here when the page loads.

Shawn May

Talk to Shawn

Questions about your own tenant?

Disclaimer

This article provides independent educational guidance from Dynamic Technical Solutions (DTS), based on information and Microsoft documentation available at the time of publication or most recent revision. Microsoft may change features, settings, policies, and procedures. Review the linked Microsoft sources for current guidance and confirm applicability to your environment before making changes.

DTS is not affiliated with, endorsed by, or sponsored by Microsoft. Microsoft, Microsoft 365, Microsoft Entra, Microsoft Graph, Microsoft Teams, SharePoint, and OneDrive are trademarks of the Microsoft group of companies. All other product names and trademarks belong to their respective owners.