· Cybersecurity

Microsoft 365 Device Code Phishing: Why a Password Reset Is Not Enough

By 7 min read Updated

A password reset will not lock out an attacker who got into Microsoft 365 through device code phishing. In a campaign Huntress reported on December 3, 2026, attackers registered their own fake Windows devices on staff accounts, and those devices kept working after the password changed. To get them out, block the person’s sign-in and disable and delete the fake device. Then sign them out everywhere and reset the password.

What did Huntress find?

Huntress, a security company we partner with, counted 468 fake device registrations in November 2026. They were tied to 326 staff accounts at 305 organizations. Huntress said the campaign was still active when it published. It was also tracking two other groups of fake device registrations that may or may not come from the same attacker.

Once inside, the attackers usually signed in to Microsoft Entra ID and Microsoft Office, then often moved on to OneDrive, SharePoint or Exchange. That is where your files and email live.

How does device code phishing work?

Device code sign-in is a real Microsoft feature. It lets you sign in to something without a keyboard, like a meeting room screen, by typing a short code on your phone or laptop. Here is how attackers abuse it:

  1. A message asks for a sign-inIt points to a document, such as a fake NDA.
  2. You type a codeThe code is the attacker’s. The page is Microsoft’s real one.
  3. A fake computer is addedThe attacker registers it on your account.
  4. A password reset doesn’t remove itThe fake computer keeps its own sign-in pass.

A staff member gets a message asking them to open a document. One lure was a fake non-disclosure agreement that claimed to be protected by Adobe.

They type a short code on Microsoft’s real sign-in page, so checking the web address won’t catch it. The code belongs to the attacker. Typing it hands the attacker a sign-in pass, and no password is needed.

The trick does not rely on a bug in Microsoft’s software. When Microsoft described the same trick in February 2025, it said it found no vulnerability in its code that made it possible. It works because a person approves a sign-in they didn’t start.

Why doesn’t a password reset lock the attacker out?

With that first pass, the attacker registers a fake Windows computer on the account. Microsoft gives that device its own long-lasting sign-in token, called a Primary Refresh Token.

A password reset does cancel the account’s ordinary sign-in tokens. Microsoft only cancels a device’s Primary Refresh Token on a password change if that token was first obtained with the password. In this attack the token came from a phished code, so the fake device keeps its pass.

In Huntress’s words: “Password resets alone do not remove the threat actor’s access.” Someone has to remove the fake device.

Is your office exposed?

If your team uses Microsoft 365, it could be. For a dental, law, accounting or manufacturing office, email and shared files hold client details, invoices and referrals. That is what’s at risk.

Your settings matter more than your size. Every Microsoft 365 business plan includes security defaults. The setting is on by default in newer tenants. Older tenants, or tenants where someone turned it off, may not have it. Microsoft’s current security defaults settings include blocking device code sign-ins. The device code block is a recent addition. Ask IT to check the sign-in logs and confirm that device code sign-ins are actually blocked in your tenant.

Business Premium (and Microsoft 365 E3/E5) adds Conditional Access, which lets your IT person write a rule that blocks device code sign-ins. You can use security defaults or Conditional Access, but not both at once. If security defaults was turned off and no rule replaced it, nothing blocks device code sign-ins.

What should you check this week?

Forward this list to whoever looks after your Microsoft 365.

  • Give staff one rule: only type a code into a Microsoft page if you started that sign-in yourself. If an email asks you to, stop and call IT.
  • Confirm that security defaults is on or that a Conditional Access rule blocks device code sign-ins. Then check that the sign-in logs show those sign-ins are blocked.
  • In the Entra admin center, go to Entra ID, then Devices, then All devices. Look for names starting with MH-, any Windows device reporting build 10.0.19041.928, or any device nobody can explain. Other groups in Huntress’s report used names like DESKTOP- or GraphSpy-Device.
  • For any account that looks off, review its registered devices and multi-factor authentication methods, and remove anything you don’t recognize.
  • Check that account for inbox rules nobody set up.
  • Limit who can add devices to your Microsoft 365 (ideally only IT), and require MFA (the second step at sign-in) when one is added. This helps, but a phished pass already carries the person’s MFA.

What do you do if you find a fake device?

Do these steps together, in this order. To keep evidence for IT, disable the device before you delete it, or export its details first.

  1. Block sign-in and remove the fake deviceBlock the person’s sign-in, then disable the fake device and delete it.
  2. Sign them out everywhereUse Revoke sessions in the Entra admin center.
  3. Reset the password and check the accountLook for sign-in methods, inbox rules and app permissions someone added.

A password reset on its own is not enough. The fake device keeps its pass until someone disables or deletes it.

For your IT person

  • Find current use: filter Entra sign-in logs (interactive and non-interactive) for the device code protocol.
  • Block device code flow with Conditional Access (Authentication flows). Exclude break-glass accounts and documented exceptions, and run it in report-only first.
  • Limit who can join and register devices to IT only, and lower the device limit per user.
  • Require compliant or managed devices for Microsoft 365.

How can Benson Hunt help?

We’ve looked after small offices since 2013, with local technicians in Vancouver, Edmonton and Calgary. We’re a Microsoft partner and a Huntress partner, and our support is built on ITIL best practices. A person answers emergencies 24/7.

Our IT review covers these checks: rogue devices, device code sign-ins, and who can add devices to your Microsoft 365. It’s part of how we look after your cybersecurity, and we explain what we find without the jargon. Security awareness training also helps staff learn the one-code rule before a lure shows up.

Quick answers

What is device code phishing?

It’s a trick that gets someone to type an attacker’s code into Microsoft’s real sign-in page. That gives the attacker a sign-in pass for the account without the password.

Does a password reset remove the attacker?

Not on its own. If the attacker registered a fake device, its token can survive a password reset. Block the person’s sign-in, disable and delete the device, sign them out everywhere, then reset the password and check the account.

How do I check for a fake device in Microsoft 365?

In the Entra admin center, go to Entra ID, then Devices, then All devices, and look for names starting with MH- or any device nobody recognizes. Other attackers use other names.

Can Microsoft 365 block device code phishing?

Yes. Microsoft’s security defaults now include a device code block, and plans with Conditional Access (Business Premium, E3, E5) can block it with a rule. Either way, have IT confirm the block is working.

What if someone already typed a code?

Tell your IT person right away. They should block the person’s sign-in, disable and delete any device they don’t recognize, sign them out everywhere, reset the password and check the account for anything added.

Sources

Leave a comment

Tony Fung, Founder and CEO of Benson Hunt

I write up what we find in real offices. If it sounds like your setup, call me.Tony Fung, Founder and CEO

Built on ITIL best practices. 40+ years of combined experience. Proudly Canadian.

Talk to a person.

(604) 813-7881

Mon to Fri, 7am to 5pm Alberta time. Emergency support 24/7 at (604) 813-7881, always answered by a person.
Or contact us