TL;DR: A phishing email sent from an already-compromised mailbox led a second victim through a link-in-bio lure, a bot-filtering “human check,” and a fake SharePoint page, and finally to Microsoft’s real sign-in page. By typing in a code and completing MFA, the victim handed the attacker access and refresh tokens to their Microsoft 365 account. No password was stolen, MFA didn’t help, and a password reset alone won’t kick the attacker out.
Device code phishing has been around for a while, but it keeps working because nothing about the final step looks wrong. The URL is Microsoft’s, the certificate is Microsoft’s, and the MFA prompt is real. Below is a stage-by-stage walkthrough of one live sample, followed by what defenders can actually do about it.
The attack chain at a glance
- Initial compromise: The attacker takes over an email account.
- Delivery: That account sends a phishing email claiming files were shared via SharePoint.
- Lure page: The link opens a linkie[.]bio page announcing “2 New Fax Documents.”
- Evasion gate: “GET YOUR FILES HERE” leads to a fake human-verification page on Cloudflare Workers that screens out automated scanners.
- Phishing page: Visitors who pass the check see a fake SharePoint page displaying a Microsoft device code.
- Token theft: The “Open” button launches Microsoft’s legitimate device login page. Entering the code and signing in gives the attacker the account.
The phishing email
The email came from a legitimate account the attacker had already compromised. That means it passed SPF, DKIM and DMARC and showed up looking like a message from a trusted contact. Sender authentication only tells you the mail came from the account it claims to. It can’t tell you who’s sitting behind that account.
There’s one small tell, though. The email talks about files shared via SharePoint, but the landing page announces fax documents. The attacker stitched two lures together and didn’t bother to make them match.
Stage 1: The lure page on linkie[.]bio
The email link opens hxxps://linkie[.]bio/3985, a page on a legitimate link-in-bio service. Hosting the first hop on a reputable domain helps the link slip past URL reputation filters. The page announces “You Have 2 New Fax Documents” under a SharePoint-style logo, with a single GET YOUR FILES HERE button.

Figure 1. The lure page on linkie[.]bio.
Stage 2: The “are you human?” gate
The button leads to a fake verification page hosted at vault-link-31yh[.]p-tzc4oj4x[.]workers[.]dev, complete with a Microsoft-colored logo and an “I’m not a bot” checkbox. This page isn’t there to stop bots for your benefit. It’s there to keep security scanners and sandboxes away from the phishing page while letting real people through.
The page’s script gives every visitor a “human score”:
- Penalties for traits of automated browsers:
navigator.webdriverset, no browser plugins, no languages, or a zero-size window. - Bonuses for human behavior: mouse movement, touch and scrolling, and waiting more than one second before clicking.
- Low score: The visitor gets redirected to http://www.google.com, so a scanner logs a harmless result.
- Passing score: The score, interaction data and a per-visitor token are encrypted with a simple XOR-based cipher and submitted to the Worker, which then serves the phishing page.
The page is also regenerated on every load with fresh random class names, tokens, keys and cipher constants. That defeats signature- and hash-based detection, so block on the domain, not the page content.

Figure 2. The fake human-verification gate.
Stage 3: The fake SharePoint page
Visitors who pass the check get a page styled as a SharePoint share from “Microsoft User”, still served from the same workers[.]dev domain. A SharePoint page hosted on Cloudflare Workers is the single clearest red flag in the whole chain.
The page shows a verification code (BEEDWDY6L in this sample) along with step-by-step instructions: open the sign-in window, enter the code, authenticate, and come back to view your documents. That code isn’t fake. It’s a genuine Microsoft device code that the attacker’s backend requested moments earlier, and it expires in about 15 minutes. A “Checking access…” spinner polls in the background, waiting for the victim to finish signing in.
The Copy code button puts the code on the clipboard, and the Open button launches Microsoft’s sign-in page.

Figure 3. The fake SharePoint page on Cloudflare Workers (domain outlined in red).
Stage 4: Microsoft’s real device login
The Open button launches login.microsoftonline.com/common/oauth2/deviceauth, Microsoft’s legitimate device authorization page. I checked the page source to confirm it: Microsoft’s own domain, Microsoft’s content delivery network and Microsoft’s page ID (ConvergedRemoteConnect).
The irony is that the page itself warns users: “Do not enter codes from sources you don’t trust.” The attacker is counting on the SharePoint pretext to talk the victim past that warning.

Figure 4. The legitimate Microsoft device code sign-in page.
How device code phishing works
The device code flow exists so devices without a keyboard or browser (smart TVs, command-line tools, conference room gear) can sign in. You start the login on the device, it shows you a short code, and you approve it from your phone or laptop. Attackers flip that around:
- The attacker starts a sign-in. On their own system, they kick off Microsoft’s device code flow and Microsoft issues a short code.
- The phishing page hands the code to the victim. The fake SharePoint page displays it and sends the victim to Microsoft’s real sign-in page.
- The victim approves the attacker’s session. By entering the code and signing in, MFA included, the victim authorizes the attacker’s session instead of their own.
- The attacker receives tokens. Microsoft issues access and refresh tokens to the attacker, opening up the victim’s mail, OneDrive, Teams and SharePoint, depending on which app was requested.
Why it works so well
- Legitimate infrastructure. The sign-in URL, certificate and page are all genuinely Microsoft, so URL checks and password managers raise no alarms.
- MFA doesn’t stop it. The victim completes MFA themselves. Even phishing-resistant methods like passkeys pass, because the sign-in really is happening on Microsoft’s domain.
- It survives a password reset. The refresh token stays valid until sessions are explicitly revoked, and it can last for months.
- Built-in urgency. The code expires in about 15 minutes, and the lure leans on that.
What defenders can do
- Restrict the device code flow. Most users never need it. In Microsoft Entra ID, a Conditional Access policy using the Authentication flows condition can block device code flow for everyone except the accounts and devices that genuinely require it.
- Hunt in the sign-in logs. Look for sign-ins where the authentication protocol is device code, especially for users who have never used it before or from unfamiliar IPs and locations.
- Revoke sessions, don’t just reset passwords. If someone entered a code, revoke their sessions and refresh tokens, then review mailbox rules, OAuth app consents and newly registered devices for persistence.
- Trace it back. The email came from a compromised account somewhere upstream. Notify that sender’s organization so the chain gets cut at the source.
- Block the infrastructure, not Microsoft. Block the lure and Worker domains below. Don’t touch login.microsoftonline.com.
- Teach the one rule that matters. Never enter a sign-in code you didn’t generate yourself on a device in front of you. A document doesn’t need you to type a code to open.
Indicators of compromise
| Type | Indicator | Notes |
|---|---|---|
| URL | hxxps://linkie[.]bio/3985 | Stage 1 lure page (legitimate link-in-bio service, abused) |
| Domain | vault-link-31yh[.]p-tzc4oj4x[.]workers[.]dev | Stage 2 human-verification gate and Stage 3 fake SharePoint page |
| Device code | BEEDWDY6L | Sample code shown to the victim; expires in about 15 minutes |
| Lure text | “You Have 2 New Fax Documents” / “GET YOUR FILES HERE” | Lure page wording |
Indicators are defanged. Note that login.microsoftonline.com appears in this chain but is legitimate Microsoft infrastructure. It is not an IOC.
Wrapping up
The scary part of device code phishing is that the victim does everything “right”: they land on the real Microsoft domain, they see a valid certificate and they complete MFA. The only wrong move is typing in a code that someone else gave them. If your organization doesn’t need the device code flow, turning it off removes this whole class of attack from the board.

Leave a Reply