# What is device code phishing?

> The attacker starts a real Microsoft sign-in, then persuades you to enter their code on Microsoft's genuine device-login page. You finish MFA, but for their session. The address is real, so checking it won't help; admins should block device-code flow where it isn't needed.

Haven Field Guide · Threat dossier
Canonical page: https://www.starthaven.com/field-guide/threats/device-code-phishing

## Mechanism

Device-code sign-in exists for things without a keyboard, like a TV or a conference-room device: the device shows a short code, and you enter it on another device to approve. In the attack:

1. The attacker starts a sign-in and gets a code.
2. They send it to you with a reason: join this meeting, view this document, "verify" your account.
3. You enter it on Microsoft's real page and complete MFA as normal.
4. The attacker's device now holds valid tokens for your account.

MFA wasn't broken. You passed it, for the wrong session.

## Why it's hard to spot

Every page involved is genuine Microsoft, so "check the address" and "look for a fake page" both come back clean. Microsoft itself treats the flow as high-risk for this reason.

## Tells

- Being asked to type a code you didn't generate yourself.
- A code that arrives in an email, chat or Wi-Fi portal rather than on a device in front of you.
- "Enter this code to see the file."

## Admin controls

1. Find real dependencies in sign-in logs first.
2. Create a Conditional Access policy blocking device-code flow, in report-only mode, then enforce it with narrow exceptions.
3. Alert on device-code sign-ins that remain.
4. Use phishing-resistant MFA and token protection for high-value accounts.

## Haven's role

Haven does not flag device-code phishing that runs entirely on Microsoft's genuine sign-in pages, because there is no fake page to detect.

## How Haven handles this

- Haven does not flag device-code phishing that runs entirely on Microsoft's genuine sign-in pages, because there is no fake page to detect. That variant is handled with identity controls, such as blocking device-code flow in Conditional Access, and phishing-resistant MFA. (verified by engineering 2026-10-28)

## Related questions

- [How to protect employees from phishing on hotel and conference Wi-Fi](https://www.starthaven.com/field-guide/guides/protect-business-travelers-on-hotel-wifi.md): Run an always-on, full-tunnel VPN so the venue's network never answers DNS for your laptops, enforce strict encrypted DNS, block Microsoft device-code sign-in where you can, switch off WPAD, and teach travelers to distrust unexpected sign-in prompts.
- [An employee's MFA was bypassed by phishing. How do we respond?](https://www.starthaven.com/field-guide/fix/respond-to-mfa-bypass-session-theft.md): Reset the password, but also revoke every active session and refresh token, because a stolen session cookie keeps working until you do. Then check for new mailbox rules, OAuth apps and sign-in methods, and move that account to passkeys or security keys.
- [Can phishing get past multi-factor authentication?](https://www.starthaven.com/field-guide/learn/can-phishing-get-past-mfa.md): Yes. Adversary-in-the-middle kits relay your sign-in to the real site and capture the session issued after you finish MFA, so the attacker can reuse it. Passkeys and security keys resist this because they're bound to the real domain.

## Sources

- [Microsoft 365 Phishing That Beats MFA: Fake Logins — Haven blog](https://www.starthaven.com/blog/microsoft-365-phishing-bypasses-mfa), checked 2026-10-19
- [Phishing Without the Phishing Email — Haven blog](https://www.starthaven.com/blog/phishing-without-email-business-travelers), checked 2026-10-19
- [Block authentication flows with Conditional Access — Microsoft Learn](https://learn.microsoft.com/en-us/entra/identity/conditional-access/policy-block-authentication-flows), checked 2026-10-19

## Review

Signed off by Miluse Najmr (2026-11-26).
Last reviewed 2026-11-26.

## More

- Field Guide: https://www.starthaven.com/field-guide
- Every Field Guide entry, with short answers: https://www.starthaven.com/llms-full.txt
- Report a mistake: https://www.starthaven.com/contact?topic=issue
