← Back to articles
phishingmicrosoft 365mfacybersecurityaccount takeover

Device code phishing: what it is and how to stop it

By · November 8, 2026 · 6 min read

Device code phishing tricks the victim into typing a code generated by the attacker into Microsoft’s real sign-in page. That gives the attacker access to their Microsoft 365 account without a password and without two-step verification getting in the way. Blocking that sign-in flow stops it.

File JG · DocumentBack to articles

Device code phishing: what it is and how to stop it

Type
Article
Author
Date
Reading time
6 min read
Subjects
phishing, microsoft 365, mfa, cybersecurity, account takeover

Summary

Device code phishing tricks the victim into typing a code generated by the attacker into Microsoft’s real sign-in page. That gives the attacker access to their Microsoft 365 account without a password and without two-step verification getting in the way. Blocking that sign-in flow stops it.

You get an invitation to a Teams meeting or an online event. To join, you're asked to type a code into a Microsoft page. The page is the real one, with the right address and the padlock, and the code works. Nothing odd happens afterwards. But you've just given a stranger access to your email, your files and your Teams, without them ever touching your password and without two-step verification getting in their way.

That's device code phishing. It isn't new, but it's now sold as a service. In May, the FBI warned in a public service announcement from its IC3 complaint center1 about Kali365, a phishing kit first seen in April 2026 and distributed mainly through Telegram, which puts the technique within reach of attackers with little technical skill and even offers them AI-generated lures.

◢What is device code sign-in?

It's a legitimate way to sign in, designed for devices where typing is awkward: a smart TV, a printer, a meeting room display. According to Microsoft's documentation2, the device shows a short code, you type it into a browser on your phone or computer, sign in, and from then on the device gets permission to use your account. By default, the code expires after 15 minutes.

The mechanism is an open standard, not something unique to Microsoft. But the cases documented by Microsoft and the FBI target Microsoft 365 accounts, which makes sense: one employee's account opens their email, their files and their Teams all at once.

◢How does device code phishing work?

The trick is that the device asking for the code isn't yours, it's the attacker's. Microsoft walks through it in its analysis of the Storm-2372 campaign3:

  1. ▹The attacker requests a real code from Microsoft on their own machine.
  2. ▹They send it to you disguised as something else, for example as the ID of a Teams meeting.
  3. ▹You type it into the genuine Microsoft page and sign in as usual, second factor included.
  4. ▹Microsoft hands the permissions to the attacker's machine, which can now get into your account.

Microsoft stresses that there's no flaw in its code: the technique abuses a standard mechanism that works exactly as designed. That's why the usual advice ("check the page address carefully") doesn't help here. The address is correct.

◢Why doesn't two-step verification stop it?

Because you're the one completing it. The attacker doesn't need your password or the code on your phone: they wait for you to use them and keep the result. The FBI puts it plainly in its alert: the attacker reaches services such as Outlook, Teams and OneDrive "without needing a password or completing any additional MFA challenges".

The access also lasts. Microsoft explains that the attacker stays in for as long as the tokens remain valid, which is why it recommends revoking them as soon as you suspect someone has fallen for it.

◢What lures do attackers use?

The documented cases look a lot like ordinary work email:

  • ▹Teams meeting invitations sent by email, where the code appears as the "meeting ID". That's the Storm-2372 case, a campaign active since August 2024.
  • ▹Messages that mimic WhatsApp, Signal or Teams, sent after winning the victim's trust by posing as someone relevant to them.
  • ▹Invitations to online events or meetings that lead to a screen asking for the code.
  • ▹Emails impersonating cloud productivity and document-sharing services, like the ones the FBI describes for Kali365.

The two cases need some context. Microsoft assesses with moderate confidence that Storm-2372 aligns with Russian interests, and its targets were mainly governments, NGOs, tech firms, defense, telecoms, healthcare, universities and energy. Kali365 is a different thing: phishing as a service, which according to the FBI puts the technique within reach of less technical attackers. With a kit like that, the trick no longer depends on a well-resourced group and can reach any company that uses Microsoft 365.

◢What does the attacker do once inside?

In the campaign Microsoft analysed, the attacker searched the mailbox for words like "password", "admin" or "credentials" and took those emails. They also used the hijacked account to send the same lure to other people in the organization, who now received it from a trusted address.

It's easy to picture this in an ordinary company: with the mailbox of someone in accounts, an attacker can read pending invoices and ask a supplier to change bank details. It's exactly the kind of access people preparing CEO fraud look for: watch the mailbox and strike at the right moment.

◢What companies can do to prevent it

The most effective step is technical, and it's up to whoever runs Microsoft 365. Microsoft recommends blocking device code flow wherever possible4 and allowing it only where it's needed, such as meeting room displays. The FBI asks for the same.

In practice:

  • ▹Start by checking whether anyone uses it. In the Entra sign-in logs you can filter by the "device code" authentication protocol.
  • ▹Create a Conditional Access policy that blocks it for all users, with only the exceptions you really need. Microsoft explains the steps in its guide to blocking authentication flows5 and advises turning it on in report-only mode first and excluding emergency access accounts.
  • ▹Consider blocking authentication transfer too (moving the session from your computer to your phone with a QR code), which the FBI includes in its recommendations.
  • ▹If you suspect someone has fallen for it, revoke their sessions as Microsoft advises and check whether a new device has been registered in their name, something the Storm-2372 attacker went as far as doing.

◢What employees need to know

The rule for any employee is simple: never type a code into a Microsoft page unless it was shown by a device in front of you that you're setting up yourself. No legitimate meeting, document or event needs you to type a code into Microsoft's sign-in page to open it.

If someone asks you to do it by email, on WhatsApp or in the middle of a conversation, stop and tell whoever handles IT. And if you've already done it, say so as soon as possible. There's nothing to be embarrassed about: the page was genuine and the trick is designed so that anyone can fall for it. The same habits I go through in how to spot a phishing email help you get suspicious in time.

◢A trick you can't see in the address bar

For years we've taught people to check the page address before typing anything. This attack sidesteps that advice, so it has to be explained specifically, with examples people recognise. That's exactly what I work on in my cybersecurity training for teams: making sure everyone knows what they might be asked for and what they should never do, even when the page looks trustworthy.

Related documents

  1. News

    Crédit Mutuel Arkéa cyberattack: attackers came in through a vendor

    French bank Crédit Mutuel Arkéa suffered an attack that allowed fraudulent transfers from its own account. The attackers got in through a service provider's platform. What we know, what we don't and what to learn.

  2. News

    Claude Code leaks keys on GitHub: the settings.local.json problem

    Claude Code's "don't ask again" option can save passwords and API keys in .claude/settings.local.json. Apiiro found 1,122 public copies on GitHub with secrets inside. What we know and what to do.

  3. Article

    OWASP Top 10 for AI agents: the 10 risks explained

    The OWASP Top 10 for Agentic Applications lists the ten main risks of AI agents that act on their own: goal hijacking, tool misuse, privilege abuse and rogue agents. What each one means and what to check in your company.

End of documentBack to articles