Skip to content
WarningSecurity

Device Code Phishing Adds Rogue Devices. Password Resets Miss Them

Device code phishing planted 468 rogue devices across 305 organizations. Microsoft 365 cleanup needs more than a password reset.

By DC Team · · 6 min read

Microsoft logo and the words One login code. A hacker moves in. An approved code points to a stranger's laptop inside a work account.

Device code phishing has left a second cleanup job inside Microsoft 365: remove the attacker's device. In a December 3 investigation, Huntress reports 468 rogue device registrations tied to 326 identities across 305 organizations during November. The researchers say changing the victim's password alone does not remove this access. Their response sequence is specific: delete the rogue device in Entra ID, revoke the user's sessions, and reset credentials.

For developers who also administer their company's tenant, the important question is whether the incident ticket includes a device inventory check. A password reset receipt cannot answer which machines were added while an account was compromised. Closing the ticket without checking that inventory can leave the attacker with a route back into work resources.

How device code phishing becomes a device identity

The trick abuses a legitimate cross-device sign-in process. An attacker starts authentication and persuades someone else to enter the resulting code on Microsoft's genuine sign-in page. The victim completes authentication, but the initiating client receives the tokens. Microsoft described this mechanism in its Storm-2372 investigation, including a February 2025 update about attackers using Microsoft Authentication Broker to register a device and obtain a Primary Refresh Token.

That earlier report establishes precedent, not attribution for today's campaign. Huntress has not tied the November operation to a named threat actor. Its evidence suggests use of the public ROADtools toolkit; a shared tool is insufficient to identify an operator. Huntress's tooling assessment.

The user-facing lesson is more specific than checking the address bar. A real Microsoft page can be processing a request someone else initiated. Ask whether you personally started the login for the device or application asking for authorization. An unsolicited code accompanying a document or meeting request deserves scrutiny even when the destination domain is familiar.

For incident responders, separate the initial authorization from what follows. Finding the suspicious sign-in tells you where to start. Finding an unauthorized device tells you there is another identity object to contain. Those are separate questions in the response checklist.

Why resetting the password leaves a gap

A Primary Refresh Token supports single sign-on and obtaining application tokens. Microsoft's PRT documentation makes two distinctions that matter here. Password changes invalidate a PRT obtained using that password. Deleting or disabling a device invalidates the PRT obtained on that device, preventing it from obtaining tokens for other applications.

That is the reason to remove the unauthorized device explicitly. It is also a reason to avoid the sweeping claim that password resets never revoke tokens. Microsoft's refresh-token revocation matrix distinguishes password-based and non-password-based tokens, user password changes, and administrator resets through different portals. The revocation effect depends on the credential and operation.

Use the following division of work when reviewing a containment ticket. This is an operational checklist derived from those Microsoft distinctions, rather than a claim that each action instantly ends every application session.

ActionWhat to verify before closing the ticket
Reset the affected user's credentialsRecord how the reset was performed and check the applicable token-revocation behavior.
Revoke the user's sessionsConfirm the revocation action succeeded, then investigate subsequent successful sign-ins.
Remove the confirmed rogue deviceRecord its directory object ID and device ID before removal; verify the object is gone.
Review downstream activityEstablish which resources were accessed and whether attacker-created access remains elsewhere.

Do these jobs within the same incident response. A successful reset is evidence that a password changed. It is insufficient evidence that every identity artifact created during the compromise has been removed.

A read-only inventory check for the November campaign

Huntress's distinctive indicator is a device name beginning MH- followed by 16 uppercase hexadecimal characters. The observed registrations reported Windows build 10.0.19041.928. Use these as investigation leads, not a deletion rule: device names and reported versions can be changed, and a matching string alone does not prove compromise. Campaign indicators.

The command below builds a review queue from the current device inventory. Run it in PowerShell with the Microsoft Graph Authentication and Identity.DirectoryManagement modules installed, using an account authorized to read the tenant's devices. The Device.Read.All delegated permission requires administrator consent; Microsoft's list-devices API documentation describes the supported permissions and roles.

Connect-MgGraph -Scopes "Device.Read.All" -NoWelcome

$properties = @(
  "id", "deviceId", "displayName", "operatingSystemVersion",
  "accountEnabled", "isManaged", "isCompliant"
)

Get-MgDevice -All -Property $properties |
  Where-Object {
    $_.DisplayName -cmatch '^MH-[0-9A-F]{16}$' -or
    $_.OperatingSystemVersion -eq '10.0.19041.928'
  } |
  Select-Object Id, DeviceId, DisplayName,
    OperatingSystemVersion, AccountEnabled, IsManaged, IsCompliant |
  Export-Csv -Path ./device-review.csv -NoTypeInformation

The -All switch retrieves all pages, as documented for Get-MgDevice. The command reads directory objects and writes a local CSV. It contains no tenant write or deletion operation. We checked its parameters against Microsoft's documentation; we have not run it against a customer tenant.

The -or deliberately includes either signal. A device with the reported build and a different name still deserves review. A matching name with another build should also enter the queue. Neither managed nor compliant status should substitute for checking who registered it and why.

Inventory resultNext investigation
Name and reported build both matchPrioritize the registration event, owner and nearby sign-ins.
Only one signal matchesCheck the same evidence and establish a legitimate owner before deciding.
No matchesReview device-code sign-ins and recent registrations anyway; this checks a narrow campaign signature.

A current inventory also cannot show an object that was already deleted. Use retained audit evidence to reconstruct the incident timeline. Preserve the registration event, identifiers and related sign-ins before making containment changes so the team can explain which access it removed.

Blocking the flow has a developer tradeoff

Microsoft recommends getting as close as possible to a universal device-code block. Its policy recipe targets the Authentication flows → Device code flow condition, grants Block access, and starts in Report-only before enforcement. Audit the result and switch the policy to On after confirming its impact. Report-only is a rollout tool; leaving it there does not enforce the block.

The operational catch is legitimate usage. Microsoft's Teams-device guidance calls out provisioning and reauthentication dependencies, as well as developer and administration tools such as Azure CLI. It recommends browser-based or brokered sign-in for people and managed identities or workload identity federation for automation where possible.

Write an owner beside each dependency before creating an exception. Ask what task requires this flow, what replacement exists, and when that replacement can ship. A developer convenience exception deserves the same review as a meeting-room dependency.

Microsoft warns that an account excluded from this block can use device code flow across the apps and resources in its scope. Its Teams guidance also specifies a Device Registration Service resource exception. Follow the applicable deployment guidance carefully and document that remaining exposure rather than calling an excepted policy a universal block.

What to do

If an account is compromised, make rogue-device removal part of containment. Preserve the relevant evidence, follow Huntress's delete-device, revoke-sessions and reset-credentials sequence, and verify each action. Investigate subsequent access before closing the incident. Huntress's response guidance.

If you administer the tenant, give today's hunt a named owner. Run the read-only inventory check, correlate candidates with registration and sign-in history, and document legitimate matches. An empty CSV is a narrow result, not a clean bill of health.

If your team ships tools that request device codes, review the login design. Identify whether browser or broker authentication can replace the flow. Put necessary exceptions through the identity team's policy review, with a business owner and a date to revisit them. Microsoft's authentication-flow documentation also explains protocol tracking: a session started with device code flow can remain subject to the policy during later token refreshes. Test the actual follow-on workflow before enforcement, including the resources your tool accesses after its initial login.