An active phishing campaign tricks Microsoft 365 users into approving a legitimate device sign-in code. Attackers then register their own Windows device, allowing continued access to mailboxes and files even after the victim changes their password. The activity has affected hundreds of organizations and is aimed at OneDrive, SharePoint, and Exchange data.
How the attack worked
This campaign targets Microsoft 365 users through a technique known as device code phishing. Instead of harvesting passwords on a fake login page, attackers initiate a legitimate Microsoft sign-in themselves and then trick the victim into entering the resulting approval code on a genuine Microsoft authentication page. The lure is disguised as a routine business activity, such as accessing a shared document or joining a meeting. Once the victim approves the code, the attacker registers a rogue Windows device in Microsoft Entra ID and obtains a long-lived Primary Refresh Token, giving them standing access to the account.
Why it succeeded
The technique avoids the usual warning signs defenders train people to spot. The victim never visits a spoofed domain and never types a password into an attacker-controlled form. They personally approve the multi-factor authentication prompt on a page that is, in fact, genuinely Microsoft's. Because the device code flow exists to support hardware like smart TVs and printers that lack a keyboard, nothing about the underlying mechanism is broken or exploited technically. The weakness is entirely in how the request is framed to the user, which is what makes it difficult to recognize even for people who know to check a URL before entering credentials.
What to watch for
- Any request to enter or approve a Microsoft device sign-in code that you did not personally initiate.
- A code approval tied to an unexpected document request or meeting invitation.
- Assuming that because a sign-in page looks genuinely like Microsoft's, the surrounding request must be safe.
- Continued unusual activity in OneDrive, SharePoint, or Exchange after a password has already been changed.
Building resistance
According to the findings, more than 450 rogue devices were identified across hundreds of organizations, underscoring that this is not an isolated incident. Organizations can reduce exposure by training users to treat device code approval requests with the same scrutiny as any unsolicited sign-in attempt, and by instructing staff to only approve codes for sign-ins they personally started. Because a password reset does not remove a rogue device's access, incident response processes should explicitly include revoking active sessions and refresh tokens, removing unauthorized device registrations from Entra ID, and reviewing potentially compromised accounts and applications. Security and IT teams should also encourage prompt reporting of any unexpected sign-in or device approval prompt, since early reporting gives responders the best chance to contain access before data in Exchange, OneDrive, or SharePoint is exposed or used for further compromise, including business email compromise.
Key findings
- Huntress identified more than 450 rogue devices across 305 organizations, registered against 326 identities.
- Victims are tricked into approving a device code on a genuine Microsoft authentication page rather than entering a password on a fake website.
- Attackers use the approved session to register a rogue Windows device in Microsoft Entra ID and obtain a long-lived Primary Refresh Token (PRT).
- A password reset alone does not remove the attacker's access; responders must remove rogue devices and revoke active sessions and tokens.
- The apparent objective is access to Microsoft 365 resources, including OneDrive, SharePoint, and Exchange, enabling data theft and potential business email compromise.
- The article says the activity could not yet be attributed to a named threat actor.
Who’s being targeted
- Commonly targeted roles: All Microsoft 365 users, Executives, Finance and accounts-payable staff, Human resources staff, Sales and client-facing teams, IT help desk and identity administrators, Security operations and incident-response teams.
- Affected industries: Organizations using Microsoft 365, Organizations using Microsoft Entra ID.
- Attack channels: email, website.
- Impersonated: A trusted business contact or routine Microsoft 365 workflow.
Red flags to watch for
- The recipient did not personally start the device sign-in process.
- The request asks the user to enter or approve a device code for an unexpected document or meeting.
- A genuine Microsoft page can still be part of a social-engineering attempt when the sign-in was initiated by someone else.
Frequently asked questions
Does resetting a password stop this Microsoft 365 attack?
No. Once a rogue device is registered in Entra ID with a long-lived Primary Refresh Token, a password reset alone does not remove the attacker's access. Responders must manually delete the rogue device and revoke active sessions and tokens.
How do attackers get victims to approve a device sign-in code?
Attackers start a legitimate Microsoft sign-in themselves, then trick the victim into entering the approval code on a genuine Microsoft authentication page, often disguised as a request to access a document or join a meeting.
Why is this attack hard to detect with normal phishing training?
The victim never visits a fake website or types a password into a fake form, and personally approves the MFA prompt on a real Microsoft page, which makes the request look legitimate.
What should employees do if asked to enter a device code unexpectedly?
Only enter a device code when they personally initiated the sign-in or have independently confirmed a trusted party started it, and report any unexpected prompt to IT or security immediately.
Read the video transcript
A meeting invite asks you to enter a Microsoft device code. Hold on. This is device-code phishing. The Microsoft page is real, but you didn’t start that sign-in. Approving the code gives someone else’s session access. That session can register a rogue Windows device in Microsoft Entra ID. Its Primary Refresh Token can keep OneDrive, SharePoint, and Exchange accessible even after a password reset. The giveaway: you never started the sign-in. If a document or meeting asks for a device code, report the request to security.