# The Microsoft 365 phishing attack that can get around your password and MFA

> Device code phishing can bypass Microsoft 365 MFA without your password. See how it works, why MFA isn't enough and how Conditional Access blocks it.

Source: https://gwbtec.co.uk/guide-microsoft-365-device-code-phishing

Guide · Cyber security · Microsoft 365

What if someone could get into your Microsoft 365 account without knowing your password, and without defeating your MFA? Device code phishing makes that possible. Here is how it works and how to shut it down.

By [Grant Baxter](https://gwbtec.co.uk/about), founder of GWB Tec, 18+ years in business IT · Published 27 November 2026

Most staff have been told the same thing: check the web address, and if it's really Microsoft, it's safe to sign in. Device code phishing turns that advice against them. The page is genuine. The sign-in is genuine. The only thing wrong is who the sign-in is for.

## What is device code phishing?

Microsoft has a sign-in method called the device code flow . It exists for things that can't easily show a login box, such as a meeting-room screen or a smart TV. The device shows a short code, and you type it in at **microsoft.com/devicelogin** on your own phone or computer to approve it.

Criminals use the same process. They ask Microsoft for a code, then trick someone into entering it. When the victim approves it, Microsoft hands the sign-in to whoever asked for the code, and that's the attacker.

## How the attack works

![Four-step diagram: the attacker requests a code from Microsoft, sends it to the victim in a convincing message, the victim signs in on the real Microsoft page, and the attacker's session is approved.](https://gwbtec.co.uk/assets/device-code-flow.svg)

The victim only ever sees step 3, and it takes place on a genuine Microsoft website.

A typical example looks like this. A member of your team receives an email, or a Teams message, saying a colleague has shared a document or a meeting recording. To view it, they're told to go to Microsoft's sign-in page and enter a code.

- They visit the real Microsoft device login page.

- They type in the code from the message.

- They sign in and approve the request, usually with their normal password and MFA.

- The attacker is now signed in as them, and can read email and files without ever seeing the password.

Nothing on the page looks wrong, because nothing on the page is wrong. That's why it works.

## Is this a real risk, or hype?

It's real, and it's growing, but it needs putting in proportion. Microsoft documented a state-linked group, Storm-2372, using fake Teams meeting invitations to run device code phishing from August 2024. In April 2026, Barracuda reported detecting more than 7 million device code phishing attacks over four weeks.

Those are **detections**: attempts that Barracuda's systems saw. They are not successful compromises, and the figure covers Barracuda's own customers rather than the whole internet. The point isn't that your account is about to be taken. It's that a well-known gap is being exploited at scale, and it can be closed.

## Why MFA isn't always enough: the Microsoft 365 MFA bypass explained

MFA is still essential. It stops the great majority of password-based attacks, and nobody should switch it off.

The weakness here is that the attacker never has to beat MFA. The victim completes it for them. Checking the web address doesn't help, and completing MFA doesn't prove the request was yours. The code is what links the sign-in to the attacker's device.

Passkeys and FIDO2 security keys are worth having, but they don't stop this attack: the victim is still signing in to the genuine Microsoft page. The control that works is to stop the device code flow being usable at all.

## How to protect your business

For most small businesses the fix is a single Conditional Access policy that blocks the device code flow, backed up by staff awareness.

- **Block device code sign-in where you don't need it.** Microsoft recommends blocking it wherever possible, using a Conditional Access policy. Most small businesses have no need for it. Run the policy in report-only mode first, keep an emergency access account excluded, and check that nothing you rely on, such as meeting-room devices or admin scripts, uses it.

- **Teach one rule.** Never enter a code you didn't request yourself, whoever sent it and however friendly the message looks.

- **Review sign-in logs in Microsoft Entra ID** for device code sign-ins you can't explain.

- **Look for unfamiliar devices** registered to your users.

- **Check mailbox rules and forwarding,** and the apps that have been given permission to access your data.

- **Know how to cut off a session quickly.** Changing a password alone may not end a session the attacker already holds.

## Does your Microsoft 365 licence protect you?

This is where the plan you pay for matters. Conditional Access, the tool that can block device code sign-in, needs Microsoft Entra ID P1. Microsoft states that P1 is included in Microsoft 365 Business Premium. It can also be bought separately for other plans.

Plan Conditional Access What it means for this attack

Business Basic Not included Security defaults and MFA, but no policy to block it unless P1 is added
Business Standard Not included Same as Basic
Business Premium Included (Entra ID P1) Able to block it, **once the policy is set up**

**Having the licence is not the same as being protected.** Conditional Access does nothing until someone builds, tests and turns on the policy.

## If you think someone has been compromised

- **Keep the logs.** Save the sign-in and audit logs before you change anything.

- **Revoke the user's sessions and refresh tokens** straight away. Access already granted can keep working for a short time, so for a serious case, block the account from signing in while you investigate.

- **Remove unfamiliar registered devices** in the same step, because a registered device can be used to get back in.

- **Reset the password** and remove any MFA methods you didn't add.

- **Check mailbox rules and forwarding,** which attackers often add to keep watching email.

- **Review app consents and sign-in activity,** and remove any permission you don't recognise. These survive a password reset.

- **Find out what was accessed** and whether others received the same message. A personal data breach may need reporting to the ICO within 72 hours.

If you're unsure, treat it as a compromise until you've shown it isn't, and get help early.

## How GWB Tec can help

We can review how your Microsoft 365 is set up, look at your MFA and Conditional Access policies, and check whether device code sign-in is open. We can also look through recent sign-in activity for anything suspicious and give you a short list of what to fix first. It fits with our [GWB Tec Protect](https://gwbtec.co.uk/gwbtec-protect) work and [managed IT support](https://gwbtec.co.uk/managed-it-support). For a one-off project, see [IT consultancy](https://gwbtec.co.uk/it-consultancy). If you're moving to Microsoft 365, our [migration checklist](https://gwbtec.co.uk/guide-microsoft-365-migration-checklist) covers security from day one.

**Want a Microsoft 365 security review?** [Get in touch](https://gwbtec.co.uk/contact) and we'll check your set-up and tell you plainly where the gaps are.

Sources: Barracuda, [Threat Spotlight: Device code phishing](https://blog.barracuda.com/2026/04/23/threat-spotlight-device-code-phishing) and [The MFA bypass that uses a real login page](https://blog.barracuda.com/2026/11/02/device-code-phishing-real-login-page); Microsoft, [Storm-2372 conducts device code phishing campaign](https://www.microsoft.com/en-us/security/blog/2025/02/13/storm-2372-conducts-device-code-phishing-campaign/), [Block authentication flows with Conditional Access](https://learn.microsoft.com/en-us/entra/identity/conditional-access/policy-block-authentication-flows) and [Entra licensing](https://learn.microsoft.com/en-us/entra/fundamentals/licensing).

Frequently asked

## Quick answers

### What is device code phishing?

It's an attack where a criminal gets you to enter a code, issued by Microsoft to the attacker, on Microsoft's genuine device login page. Approving it gives the attacker a signed-in session on your account.

### Does MFA stop device code phishing?

Not by itself. The victim completes MFA as part of the attack, so the attacker's session is approved. MFA remains essential, but it needs to be combined with blocking the device code flow.

### Which Microsoft 365 plan lets me block device code sign-in?

You need Conditional Access, which requires Microsoft Entra ID P1. Microsoft includes this in Microsoft 365 Business Premium. The policy still has to be configured and switched on.

### How do I block device code phishing in Microsoft 365?

Create a Conditional Access policy that blocks the device code authentication flow for users who don't need it, test it, then turn it on. Microsoft documents this under blocking authentication flows. It also helps to teach staff never to enter a code they didn't request.

### How can I tell if someone has already used this on my account?

Review Entra ID sign-in logs for device code sign-ins, look for unfamiliar registered devices, and check mailbox rules, forwarding and app permissions. We can do this for you as part of a security review.

Keep reading

## Related services and guides

Protect

### [GWB Tec Protect](https://gwbtec.co.uk/gwbtec-protect)

Device protection with optional monitoring.

Support

### [Managed IT Support](https://gwbtec.co.uk/managed-it-support)

Ongoing, proactive support from one IT partner.

Guide

### [Microsoft 365 migration checklist](https://gwbtec.co.uk/guide-microsoft-365-migration-checklist)

Moving email and files without the disruption.

## Is your Microsoft 365 set up to stop this?

Book a Microsoft 365 security review and find out where you stand, in plain English.

[Talk to GWB Tec](https://gwbtec.co.uk/contact)[Call 01249 471139](tel:+441249471139)

---
GWB Tec (formerly GWBrix) is a trading name of GWBaxter Ltd, Chippenham, Wiltshire. Company no. 17269247. Phone 01249 471139 · hello@gwbtec.co.uk · Open 9am to 8pm, 7 days a week.
