Identity Security

Device code phishing on Microsoft 365, explained

A short code typed into Microsoft's own sign-in page can hand an attacker your mailbox. How device code phishing works, and how to block it.

SMB

Short answer: Device-code phishing tricks someone into authorising an attacker's sign-in through a legitimate Microsoft login flow. A real Microsoft page does not make an unsolicited code request trustworthy. Do not enter a code supplied through an unexpected message. Review suspicious sign-ins and revoke unauthorised access if a code was accepted.

Device code phishing tricks someone into typing a short code into Microsoft's genuine sign-in page, and the attacker walks away with a working session even though your staff member passed multi-factor authentication correctly.

There is no fake website in this attack. That is what makes it worth ten minutes of your attention.

Obsidian Ridge is a Huntress partner. We cite Huntress's research below and offer the account protection described at the end.

Key facts, checked October 23, 2026, with the Teams booking lure added November 16, 2026:

  • Does MFA stop it? No. Microsoft's February 2025 research describes attackers receiving tokens after a victim signs in on Microsoft's genuine page. The victim completes authentication for the attacker's request.
  • Reported growth: Huntress reports a 1,380% increase in observed device code phishing between July to December 2025 and January to April 2026. These periods differ in length. These are Huntress's observations in protected organizations, not a measurement of Microsoft customers generally. They do not predict how often your business will be targeted.
  • Victim organizations: The same Huntress report counted 344 victim organizations in one wave. That is the observed campaign's scope, not a total for every device code attack.
  • The kit: Huntress describes EvilTokens as a phishing-as-a-service platform that uses AI and genuine Microsoft authentication flows to steal Microsoft 365 tokens.
  • Newest lure: On November 12, 2026, Huntress described a fake Microsoft Teams meeting scheduler that presented the device code as a "booking reference". Details are below.
  • Personalized lures: Huntress says no two phishing lures in that wave were identical. Its report attributes this personalization to AI. For another way attackers exploit AI, see fake AI download ads.

Microsoft tracked the campaign in its February 2025 research as Storm-2372, with lures imitating Microsoft Teams meeting invitations.

How the attack works

Device code sign-in lets a smart TV, conference room display or command-line tool show a code that you enter on another device to finish signing in.

The attack borrows that flow, in four steps.

  1. A message arrives with a reason to enter a code. In the campaign Microsoft described, the lure was a meeting invitation, built after some rapport over WhatsApp, Signal or Teams. The message supplies the code and the link.
  2. The code goes into Microsoft's real page. The attacker starts a legitimate request. The victim enters its code, so checking the address bar alone will not expose the attack.
  3. Your staff member passes their own MFA. They approve a real sign-in, unaware that they are authorising the attacker's request.
  4. The attacker's session collects the tokens. Microsoft says those access and refresh tokens can reach services the account can access, including email, without the password. Access lasts while the tokens remain valid.

In its February 14, 2025 update, Microsoft described the same actor going one step further: using the Microsoft Authentication Broker client to register an attacker-controlled device in Entra ID and obtain a Primary Refresh Token, which is a much more durable foothold than a single session.

Ridge Core

Obsidian Ridge's Ridge Core includes endpoint MDR and Microsoft 365 or Google Workspace ITDR at $25 per person per month, month-to-month with no minimum and business onboarding separate. A security team monitors and acts 24/7; Obsidian Ridge provides CISSP-led follow-through within one business day, serving the Research Triangle and businesses across the United States.

Discuss Ridge Core

The November 2026 version: a fake Teams booking page

On November 12, 2026, Huntress published a case it saw in mid-October at a construction company. It is worth reading because it removes almost every clue staff are taught to look for.

  • The email came from a lookalike domain impersonating a senior vice president at another construction firm.
  • The link did not point at the lookalike site. It was wrapped by Microsoft Safe Links, then passed through a Google short link and a Google redirect before reaching the lure. Huntress says that because the email carried the Google link rather than the lookalike domain, it got past URL reputation checks.
  • The page looked like a Teams meeting scheduler. A "Confirm Your Booking" page showed a "Booking Reference" with a countdown. That reference was the attacker's device code.
  • Clicking Copy or Confirm Meeting copied the code to the clipboard and opened Microsoft's real device sign-in page, where the target pasted it.
  • The attacker's sign-in was approved. Huntress saw a sign-in to the Microsoft Authentication Broker and a captured session token, replayed from attacker infrastructure through a residential proxy. Huntress says it identified and contained the incident before the attacker could escalate.

Huntress reports that this account had no MFA enrolled. MFA would not have changed the outcome: as described above, in device code phishing the victim completes MFA for the attacker's request.

The lesson for staff training is narrow and easy to remember: a real device code only comes from a device you are signing in to yourself, such as a TV or conference-room screen in front of you. If a meeting invitation, document or support request asks you to type or paste a code into Microsoft's device sign-in page, stop and call the person who supposedly sent it, using a number you already have.

Why this is not the same as the fake sign-in page

We have written about the attack where a proxy sits in front of a fake sign-in page and steals the session cookie. The advice there is passkeys, because a passkey is bound to the real site and will not sign you in to a copy.

Device code phishing authorises a session you did not start on Microsoft's own page. Proving that the site is genuine does not prove that you intended to authorise that session.

That is not a reason to skip phishing-resistant MFA. Microsoft's guidance in the same post still recommends MFA as an essential pillar of identity security and points to phishing-resistant methods such as FIDO tokens and passkeys. It stops the attacks it was built to stop. This is simply not one of them, and the control that addresses this one is a policy, not a factor.

The fix: block the device code flow

Microsoft's own recommendation is blunt. On the page covering this policy, Microsoft writes: "We recommend organizations get as close as possible to a unilateral block on device code flow."

The policy lives in Conditional Access, and Microsoft's documented steps (last updated April 7, 2026) are:

  1. In the Microsoft Entra admin center, go to Entra ID, then Conditional Access, then Policies, and select New policy.
  2. Under Assignments, include the users you want covered. Microsoft recommends all users.
  3. Under Exclude, select your emergency access or break-glass accounts. Microsoft says to audit that exclusion list regularly.
  4. Under Target resources, include all resources.
  5. Under Conditions, then Authentication Flows, set Configure to Yes and select Device code flow.
  6. Under Access controls, then Grant, select Block access.
  7. Set Enable policy to Report-only, create it, and move it to On once you have reviewed the results.

Report-only first is not optional caution. It is how you find the one person in the office who signs in to a conference room display this way before you lock them out of it.

This is also a benchmark control, not just a vendor recommendation. The CIS Microsoft 365 Foundations Benchmark lists it as 5.2.2.12 (L1) Ensure the device code sign-in flow is blocked, with the same steps and the same note about excluding break-glass accounts.

The license question, answered plainly

Conditional Access requires Microsoft Entra ID P1. Microsoft states it directly on the Conditional Access overview: "Using this feature requires Microsoft Entra ID P1 licenses", and adds that "Customers with Microsoft 365 Business Premium licenses can also use Conditional Access features."

Business Premium includes the required license; Business Standard or Basic alone does not. We have not verified a Microsoft source saying Security Defaults block device code flow. Without Conditional Access, inspect sign-in logs as described below and discuss the licensing needed to block it with your IT provider.

How to see whether anyone uses it today

Before you block anything, look. Microsoft's authentication flows documentation (last updated March 24, 2026) describes device code flow as "a high-risk authentication method that can be part of a phishing attack", and says that "filtering the sign-in logs for device code flow events with the authentication protocol filter can help" before you restrict it.

Open the Microsoft Entra sign-in logs, add the Authentication Protocol filter, and select Device code. Review the results before deciding whether any legitimate use needs an exception.

Two details from Huntress's November case help when you are reading those logs. A successful device code sign-in showed Cmsi:Cmsi, and programmatic user agents such as python-requests or node can point to attacker automation. Huntress notes those often appear only in the non-interactive sign-in logs, so check both views.

If someone has already typed in a code

Treat it as a compromised account, not a near miss. The tokens are already issued.

  • Revoke the sessions. Microsoft's guidance is to revoke the user's refresh tokens, which invalidates what the attacker is holding, and to consider a Conditional Access policy that forces re-authentication.
  • Look for a device registered around the same time. This is the step people skip. Microsoft's February 14, 2025 update describes the attacker registering their own device to obtain a Primary Refresh Token, so a new device enrollment minutes after the sign-in is a finding, not a coincidence.
  • Read the mailbox rules. Forwarding rules, rules that delete on receipt, and rules that hide messages mentioning invoices or payments are the standard next move after an account takeover.
  • Reset the password and re-enroll MFA once the sessions are gone, in that order, so the attacker does not simply continue on an old token.

If nobody in your firm is watching for the stolen session, revoking it is a job that starts whenever someone happens to notice. That is the gap Managed ITDR is for: A security team watches Microsoft 365 and Google Workspace sign-ins around the clock and can revoke a confirmed stolen session, and Obsidian Ridge picks up everything after containment within one business day.

Why identity is where this lands

Huntress, whose platform we operate, reported on June 30, 2026 that over the past year "identity-based attacks accounted for 79% of all critical and high-severity incidents" it responded to. Device code phishing is one route into that number, and it is one of the few with a single setting behind it.

The short version

  1. Device code phishing uses Microsoft's real sign-in page, so MFA is passed, not bypassed.
  2. Block the device code flow in Conditional Access, starting in report-only mode, excluding break-glass accounts.
  3. Conditional Access needs Entra ID P1, which Microsoft 365 Business Premium includes.
  4. Check the sign-in logs with the Authentication Protocol filter before you block, and after.
  5. If someone entered a code, revoke the sessions, check for a newly registered device, and read the mailbox rules.

Ridge Core includes Managed ITDR on Microsoft 365 or Google Workspace, which is the part that watches for a stolen session and gets it revoked. If you would like someone to look at how your own tenant is configured before anything goes wrong, that is what the free review is for.

Ridge Core

Obsidian Ridge's Ridge Core includes endpoint MDR and Microsoft 365 or Google Workspace ITDR at $25 per person per month, month-to-month with no minimum and business onboarding separate. A security team monitors and acts 24/7; Obsidian Ridge provides CISSP-led follow-through within one business day, serving the Research Triangle and businesses across the United States.

Discuss Ridge Core

Last updated

November 16, 2026. We refresh this content as the threat landscape and tools evolve.

Questions readers usually ask next

Does MFA stop device code phishing?

No. The victim types the attacker's code into Microsoft's real sign-in page and passes their own MFA, so there is nothing for MFA to reject. The attacker's waiting session receives the access and refresh tokens instead.

Prevention is blocking device code sign-in where your firm does not need it. Detection is someone watching for the stolen session and revoking it.

What is the device code sign-in flow for?

Microsoft describes it as a way to sign in on a device that cannot show a normal sign-in page, such as a smart TV, a conference room display or a command-line tool.

The device shows a short code, and you finish signing in on a phone or laptop. Most small offices never use it, which is why Microsoft recommends blocking it where it is not needed.

What license do I need to block device code sign-in?

Conditional Access, which is where the block is configured, requires Microsoft Entra ID P1. Microsoft states that customers with Microsoft 365 Business Premium licenses can also use Conditional Access features.

Without one of those, you cannot create the policy, and the realistic answer is to watch the sign-in logs and get the license.

How do I tell whether anyone in my firm uses device code sign-in?

In the Microsoft Entra sign-in logs, filter on the Authentication Protocol field and choose Device code. Microsoft also recommends creating the blocking policy in report-only mode first, which shows who the policy would have affected before it blocks anything.

What is the fake Microsoft Teams booking reference scam?

It is device code phishing dressed as a meeting booking.

In a case Huntress published on November 12, 2026, a fake Teams meeting scheduler showed the attacker's device code as a booking reference, copied it to the clipboard, and opened Microsoft's real device sign-in page.

Pasting the code there approved the attacker's sign-in. A real device code only comes from a device you are signing in to yourself, never from a meeting booking.

Full bio & provenanceSee related service