Digital security

Device code phishing: the genuine Microsoft sign-in that hands over your account

E
ElaraTeq
Cover: title “Device code phishing”, NCSC subtitle on Microsoft 365 accounts, night lake with mountains, purple grid and glass panels with email, code, padlock, alert and shield icons

The NCSC reports cases of device code phishing: with a code entered on a genuine Microsoft page, scammers gain access to the account and use it to send new messages to all contacts. What SMEs should do.

An email from a familiar business contact, a link to an “important” PDF and a genuine Microsoft sign-in page: this is the pattern of so-called device code phishing, described by the National Cyber Security Centre (NCSC) in its week 48 review, published on 1 December 2026. The NCSC observed several cases the previous week and says it is seeing the method more and more often. For SMEs working with Microsoft 365, the tricky part is that the victim does not type a password into a fake site: they confirm a sign-in on a real one.

How it works, in short

The “device code flow” is a legitimate procedure designed for devices with limited input options, such as printers or specialised equipment: the device shows a code, which the user enters on a normal office computer to authorise it to access their account. According to the NCSC, the code is valid for 15 minutes by default.

In the case described by the NCSC, an employee received a credible email from an external contact asking them to download a PDF. The link instead led to a site controlled by the scammers, which displayed a code to be entered on an official Microsoft page. The code had been generated by the scammers themselves: by entering it, the victim unknowingly authorised their device. In return, the scammers obtain an access token that lets them read the account’s email, calendar and files without knowing the password. If the victim already has an active Microsoft session, they are not even asked for a username and password.

Chain phishing

After taking over the account, the scammers sent the same message to more than a thousand of the victim’s contacts. The NCSC calls this “chain phishing”: every compromised account becomes the credible sender of the next round, and the campaign can spread quickly within a company and across its network of customers and suppliers. As soon as a compromised account is detected, it is therefore important to alert all potential recipients immediately.

The technique is used to bypass protections such as multi-factor authentication (MFA): MFA remains essential, but here the person completes a genuine sign-in on someone else’s behalf. In its documentation on authentication flows, Microsoft calls device code flow a high-risk method and recommends blocking it wherever possible.

What to do in your company

For all staff, based on the NCSC recommendations:

  • only enter a device code if you started the sign-in process yourself, for example when setting up a printer or a meeting room;
  • be wary of authentication requests even when they come from known contacts, especially if they come with documents to open;
  • verify unusual requests through a second channel, for example by calling a number you already know;
  • remember that even an official Microsoft website can be misused for fraud: the correct address in the browser does not guarantee that the request is legitimate.

For Microsoft 365 administrators:

  1. Check whether device code flow is really needed. Microsoft Entra sign-in logs can be filtered by authentication protocol; Microsoft also suggests first creating a policy in report-only mode to see who uses it.
  2. Block it if it is not needed. Microsoft describes how to block authentication flows with a Conditional Access policy, excluding emergency access accounts. If some devices need it, the NCSC recommends restricting its use to specific IP address ranges or regions.
  3. Check your licences. Conditional Access requires Microsoft Entra ID P1 licences, which are included for example in Microsoft 365 Business Premium. With plans that do not include it, discuss the alternatives with your IT provider and put even more emphasis on awareness.
  4. Check the logs regularly for suspicious sign-ins, as the NCSC recommends.

If an account has been compromised

The NCSC recommends acting quickly: end active sessions, revoke access tokens and reset the password. Changing the password alone is not enough, because tokens already issued may remain valid; Microsoft explains how to revoke a user’s access in Microsoft Entra. Recipients of suspicious messages should then be informed as soon as possible to break the chain. It is also worth checking whether forwarding rules or other changes the user does not recognise have been created in the mailbox.

The incident can be reported to the NCSC through its reporting form; for most SMEs reporting is voluntary, while operators of critical infrastructure have a reporting obligation for cyberattacks within 24 hours. If the scammers accessed emails or files containing personal data of customers or staff, you need to assess whether this is a data security breach that, under Article 24 of the FADP, is likely to result in a high risk and must be reported to the FDPIC as soon as possible; the FDPIC guidelines help with the assessment.

Our approach

ElaraTeq Sagl supports SMEs in configuring secure sign-ins and raising staff awareness. On related topics, see also our posts on the five levels of secure sign-in, on WhatsApp accounts hijacked with fake polls and on company websites as a source for scammers. To have your configuration reviewed, you can request a consultation or contact us.

Sources

Tags: #phishing #Microsoft 365 #MFA #account #UFCS #nLPD #PMI
Share:

Want to Work With Us?

Let's discuss how we can help bring your vision to life.

Get in Touch