Hidden Relay: phishing that hides the device code
KnowBe4 found a phishing kit that fuses AiTM with Microsoft device code phishing and never shows the victim a code. Why it beats passkeys and how to block it.
By Yaali. November 14, 2026, 6 min read, Phishing, Identity.
KnowBe4 ThreatLabs published research on November 12, 2026 describing a phishing kit it calls "The Hidden Relay". It abuses Microsoft's OAuth (the open standard that lets an app get access to an account without handling the password) device code sign-in, but unlike earlier device code phishing it never shows the victim a code. The victim signs in on the genuine Microsoft page, approves the request, and hands an attacker working access to a Microsoft 365 account. Phishing-resistant sign-in, including passkeys and FIDO2 security keys, does not stop it.
What is new is the combination. The kit fuses adversary-in-the-middle (AiTM) phishing, where an attacker sits between the victim and the real site, with device code phishing, in a hybrid KnowBe4 says it had not seen before. KnowBe4 first observed the phishing URL in August 2026. Any Microsoft 365 tenant that still allows the device code flow for ordinary users is exposed.

How it works
The OAuth 2.0 device authorization grant exists for devices that cannot show a full browser or take a typed password, such as smart TVs, printers and conference-room systems. The device asks Microsoft for a short user code, shows it on screen, and you type that code on a phone or laptop at Microsoft's real device-login page. Once you approve and clear multi-factor authentication (MFA, the extra sign-in step beyond a password), Microsoft issues the device the access and refresh tokens it needs to act as you.
Device code phishing turns the device into the attacker. The earlier version of the trick, tracked for over a year, shows the victim a code and a lure, such as a shared document that "needs" the code to open. The victim types it on the genuine Microsoft page, and the waiting attacker collects the tokens. Because every page is real, telling people to check the address bar does nothing, and MFA does not help because the victim passes it themselves.
Passkeys and FIDO2 security keys (a sign-in method cryptographically bound to the real website's address, so it refuses to work on a lookalike) are the usual answer to phishing. They do not help here. The approval happens entirely on Microsoft's own domain, so the origin check a passkey relies on passes cleanly. KnowBe4 notes the approved session even carries Microsoft's ngcmfa claim, which Microsoft treats as equivalent to a fresh MFA check. The victim authenticates correctly. They are just authorising the attacker's device while they do it.
The Hidden Relay removes the last step a defender could still catch, the code on screen. The kit opens the device code grant on its own backend, pre-loads Microsoft's live session parameters into the phishing page, and sends the victim straight to the genuine sign-in. The user code is generated but never written to the page, so there is nothing for the victim to notice and nothing for a detection tuned to the code-entry screen to see.
What attackers are doing
KnowBe4 traced the flow through the kit's own calls. A request to /api/device/start opens the grant and returns a user code valid for 900 seconds, about fifteen minutes. Rather than relay the victim's traffic live, the way a classic AiTM kit does, this one pre-stages Microsoft session state in the page before the victim submits anything. The same 810-byte flow token appeared in both the attacker's data and Microsoft's own sign-in configuration, which shows the two sides sharing one authentication session.
The lure KnowBe4 analysed was a non-disclosure agreement sent as an urgent approval request, delivered through Mandrill, a legitimate transactional mail service, to get past basic filtering. The consent screen the victim sees names the client as Microsoft Authentication Broker, a trusted first-party Microsoft app, and asks for Microsoft Graph, the API behind mailboxes and files. Approval gives the attacker access to mail, files and other account data, plus a refresh token that keeps working after the victim closes the tab.
The same kit build ships three modes. The one KnowBe4 saw uses a silent redirect and shows no code. A second writes the code into the page and polls the backend once a second for approval, which is the older behaviour. KnowBe4 tells defenders to keep their existing AiTM and device code phishing detections running, because the same build still contains that classic branch. New detections also have to account for a flow that never loads a device-login page or an otc code parameter, which is exactly what older rules watch for.

What to do
Block or restrict the device code grant. In the Microsoft Entra admin center (Entra is Microsoft's identity platform, formerly Azure AD), go to Entra ID, then Conditional Access, then Policies, and create a new policy. Scope it to all users while excluding your emergency break-glass accounts, and to all resources. Under Conditions, open Authentication Flows, set Configure to Yes and select Device code flow. Under Access controls, Grant, choose Block access. Start it in Report-only, confirm nothing legitimate breaks, then switch it On. Where a few accounts genuinely need the flow, such as shared room devices, exclude only those.
Find real use before you enforce. Filter the Entra sign-in logs by the device code authentication protocol, or leave the policy in report-only mode for a week. Legitimate use is usually a short list of room systems and a few command-line tools. KnowBe4 also recommends hunting for device code grants that name the Microsoft Authentication Broker client (29d9ed98-a469-4536-ade2-f981bc1d605e), while warning not to block that client outright, since it is a normal Microsoft component.
Shrink what a stolen session can reach. Lower the device registration limit from its default of 50 per user, under Entra ID, Devices, Device settings, Maximum number of devices per user; the CIS benchmark suggests 20 or fewer. Audit app registrations and remove any that are unused, so there are fewer apps an attacker can request tokens for.
Tell people a simple rule: Microsoft will not ask you to approve a sign-in you did not start. An unexpected request to approve access to a document, especially an urgent one, is the attack.
Two caveats on the controls. Conditional Access needs Entra ID P1 licensing or higher. Tenants on the free tier can still reach this through Security Defaults, which block the device code flow outright; Microsoft now turns that block on by default for new tenants and for tenants that have not used the flow in recent weeks.
Strong sign-in is not the whole job
Phishing-resistant MFA stops someone signing in as you on a fake page. It does not stop you consenting to an attacker's app, or approving a grant you did not start, and the Hidden Relay is built around that gap. Treat consent and authorisation as a problem of their own, with the device code flow closed off and app consent governed, rather than assuming strong sign-in already covers it.
If you want to know whether your tenant would approve one of these grants today, that check is part of our safeguarding and hardening work, and the sign-in patterns it leaves behind are what we watch for in security operations. Open the chat and Yaali, our AI agent, will pass your question to the engineer who would run it.
Sources: KnowBe4 ThreatLabs: The Hidden Relay, tech2geek, Microsoft Learn: Block authentication flows with Conditional Access, Microsoft Learn: Security defaults. </content> </invoke>
Read next
- Attackers enroll their own passkeys to keep access
- A fake IT call exposed 5.68 million at Marathon Health
- Google Calendar invite phish relays MFA to steal sessions
Back to the blog, or tell us about your system in the chat. Yaali, our AI agent, answers first and brings in an engineer.