
The link was real. The Microsoft sign-in page was real. The MFA prompt was real. And the attacker still walked straight into the mailbox.
For years, the security advice has been consistent: check the URL, look for the padlock, turn on multi-factor authentication. Device code phishing quietly makes all three of those checks irrelevant. The victim never sees a fake login page. They sign in on the genuine one, and if required complete MFA, exactly as they always do, and in doing so hand an attacker a working key to their account.
This is no longer a niche technique.
First documented in 2020, it was picked up by nation-state groups and has now gone fully mainstream. In April 2026, Microsoft reported 10 to 15 new device code phishing campaigns every 24 hours. Barracuda recorded 7 million attacks in just four weeks. Researchers are tracking more than 25 distinct phishing kits that package the technique for anyone willing to pay.
At NormCyber we are seeing the same surge. Here is what you need to know, and what to do about it.
How a helpful feature became an attack
You have almost certainly used device code authentication without knowing its name. Sign in to a streaming app on a smart TV and it shows you a short code. You type that code into a website on your phone, sign in, and the TV is suddenly logged in. The same flow is used by command-line tools such as Azure CLI, headless servers, IoT devices and automation scripts: anything where typing a password directly is impractical.
The weakness is simple. The code does not prove whose device is waiting on the other end. It just links whichever session requested it to whoever signs in. Attackers exploit that gap in five steps:
- The attacker requests a code. They ask a legitimate service, most often Microsoft 365, for a genuine device code. It is valid for about 15 minutes.
- They send it to you with a story. A Teams meeting invite, a shared document, a salary notification, a secure chat request. The code is presented as a “verification code” you need to proceed.
- You enter it on the real sign-in page. Typically, www.microsoft.com/devicelogin. The URL is genuine, the branding is genuine, nothing looks wrong.
- You sign in and complete MFA if prompted. Your password, your authenticator app, even your passkey all work exactly as designed.
- The attacker’s session is now signed in as you. The code links your sign-in to the attacker’s request. If Microsoft allows the request, the attacker receives an access token that could let them read your email or files without knowing your password.
Why your usual defences don’t see it
Device code phishing doesn’t attack authentication, the part where you prove who you are. It attacks authorisation, the part that follows, where an application is granted access to your account. That one distinction undoes a lot of standard protection.
- MFA, including passkeys, doesn’t stop it. Authentication succeeds, because the real user really did sign in. Hardware keys and phishing-resistant MFA prove identity; they don’t check which device ends up with the token.
- There’s no fake page to flag. The critical step happens on Microsoft’s own website. Email gateways, URL reputation tools and web proxies have nothing malicious to catch.
- The lures are built to evade scanners. Recent campaigns have hidden behind Google Sites, chains of redirects through compromised legitimate websites, and fake “human verification” checks that keep automated security tools out.
- Nothing touches the endpoint. In one Microsoft 365 takeover case, all of the attacker’s activity happened in the cloud. Tools that focus on the user’s laptop saw nothing.
- New kits appear faster than they can be blocklisted. Phishing-as-a-service platforms such as EvilTokens, Tycoon2FA and Kali365 now include device code phishing, and AI-assisted development means near-identical variants appear within days. Proofpoint saw around seven in a single 10-day period.
A real attack, step by step
A case documented by Trend Micro shows how patient and convincing these attacks have become. It didn’t start with a suspicious email. It started with a conversation.
An attacker posing as a law firm contact got in touch about a possible business collaboration. Several friendly messages went back and forth before a link was ever sent. When it arrived, it looked like a routine part of an existing thread. The link led to what looked like a Microsoft shared-document page, which displayed a code and asked the user to enter it on the genuine Microsoft sign-in page to open the file.
Within hours, the attacker had signed in from another country, registered several new devices on the account, and created a hidden mailbox rule to bury replies and bounce-backs. They then used the mailbox to send phishing emails to hundreds of people outside the organisation.
The one rule every employee needs
If you remember one thing from this blog, make it this: never enter a code that someone else gave you. A genuine device code is one that your own device shows you. If a code arrived by email, Teams, WhatsApp, Signal, a PDF or a QR code, stop.
Other warning signs to look out for:
- A “verification code” needed to open a document or join a meeting. Real SharePoint files and Teams calls don’t work this way.
- A sign-in screen that says, “Enter code to allow access”. Microsoft’s own page warns: “Do not enter codes from sources you don’t trust.” Take this literally!
- Urgency around a time limit. Codes expire after about 15 minutes, so attackers push you to act now, sometimes staying on a live chat to make sure you do.
- A trusted-looking contact who has built rapport first. State-backed groups such as Storm-2372 and UTA0304 have spent days messaging targets, impersonating government officials, law firms and colleagues, before sending the code.
- A prompt to approve an app you didn’t knowingly open. If you’re asked to sign in to something you didn’t start, it isn’t yours.
A genuine sign-in page does not mean the process is safe. When in doubt, verify the request through a separate channel you already trust, and report it to your IT or security team.
Seven steps to protect your organisation
Training matters, but you cannot rely on people alone against an attack that looks completely legitimate. These are the controls we recommend, in priority order.
- Block device code flow where you don’t need it. Most users never need it. In Microsoft Entra ID, use Conditional Access to block the device code flow, and confine any remaining use to specific, documented and controlled cases. This single change removes most of the risk.
- Test in Report-only mode first. Before enforcing, run the policy in Report-only mode to find legitimate dependencies such as developer CLI tools, meeting-room devices and automation scripts. Keep exclusions, including break-glass accounts, to a minimum and review them regularly.
- Monitor for device code sign-ins. Treat every device code authentication as a signal worth investigating. In Entra ID sign-in logs, look for the deviceCode authentication protocol and originalTransferMethod: deviceCodeFlow, and check for unexpected locations, unfamiliar IP addresses and new device registrations shortly afterwards.
- Hunt for what attackers do next. Watch for new mailbox rules that move or hide messages, sudden device registrations, unusual Microsoft Graph or mailbox access, and spikes in outbound email to external recipients.
- Tighten application consent. Don’t let users approve third-party applications that request sensitive access on their own. Route elevated permission requests through admin approval.
- Apply least privilege to tokens. A stolen token can be used without a password. Limit scopes, permissions and token lifetimes to what the business needs, and make token governance part of your identity security programme.
- Update your awareness training. Most phishing training still teaches people to spot fake websites. Add device code and OAuth consent phishing explicitly, using real examples of the lures above.
The threat isn’t limited to Microsoft. The device authorisation grant is a cross-platform OAuth 2.0 standard, and attackers have already used it against Salesforce. GitHub, AWS and other developer platforms support similar flows, so review them too.
Think you’ve entered a code? Act fast
Speed matters: in the case above, the attacker was active within hours. A password reset alone is insufficient to contain the compromise, because the attacker holds tokens, not credentials.
If you’re an employee: report it to your IT or security team straight away. Don’t feel embarrassed. These attacks are designed to fool careful people, and a quick report limits the damage.
If you’re the security team:
- Revoke all of the user’s sessions and refresh tokens.
- Remove any devices registered to the account during or after the incident.
- Check for and delete suspicious mailbox rules, forwarding and newly consented applications.
- Review sign-in and audit logs for data accessed and emails sent from the account.
- Warn internal and external contacts who may have received phishing from the compromised mailbox.
- Reset credentials and re-register MFA as a precaution.
The bottom line
Device code phishing works because it turns trust against you: trust in a familiar contact, trust in a real Microsoft page, trust in MFA. The answer is not to abandon those things, but to stop treating a successful login as proof that everything is safe. Close the door technically where you can, watch closely where you can’t, and make sure every employee knows that a code someone else sends you is a red flag.
NormCyber helps organisations review their exposure to device code phishing, configure and test Conditional Access policies, monitor identity activity for token-based attacks, and respond quickly when an account is compromised. If you’d like to understand your risk, get in touch with our team.






