I saw a report about attackers using device-code phishing to register their own devices in Entra ID. If a password reset may not remove their access, what should we look for and do differently?
How should we handle device-code phishing that registers a rogue Entra ID device?
Answers
A victim can enter an attacker-supplied code on a legitimate Microsoft page and authorize the attacker's sign-in. In the reported campaign, attackers then registered a Windows device in the tenant and obtained a Primary Refresh Token.
That token may survive a password reset when it wasn't obtained using the password. It can also satisfy policies requiring a registered device. For a confirmed rogue device, the reported response order is to delete the device from Entra ID, revoke the user's sessions, then reset credentials. Check the account's MFA methods and inbox rules too.
Reply to this answer
For hunting, the reported devices included names starting with MH- followed by 16 uppercase hexadecimal characters. They also reported Windows build 10.0.19041.928 and had no hardware identifiers.
Don't stop at the name though. Other reported clusters used DESKTOP-style names, so the build and missing hardware identifiers are worth checking too. Treat these as leads to investigate, not proof that every matching device is malicious.
Reply to this answer
Block device-code flow with Conditional Access where it isn't needed, then make narrow exceptions for accounts that actually use it. Report-only mode can help identify those dependencies before enforcement, including admin tools like Graph PowerShell or Azure CLI.
All In:
Also check the applicability of Security Defaults rather than assuming they block this flow in every tenant. The discussion noted a tenant creation date restriction for that protection.
Reply to this answer
Device registration deserves its own controls. Restrict who can register devices, require MFA for registration, and review the device quota. Pre-registration and a scheduled registration window are another option if they fit your workflow.
Whatever you choose, test the configuration regularly. A policy that's supposed to restrict enrollment isn't much help if an exception or setting quietly leaves it open.
Reply to this answer
Add your answer
Answers are reviewed before publication.
Linden:
Good point. I'll check the other device details rather than filtering only for MH- names.