Skip to content

Device code phishing

noun · also Device code flow phishing · Microsoft Security Blog: Storm-2372 device code phishing

A phishing technique that tricks a user into entering an attacker's device code on the genuine Microsoft sign-in page, handing the attacker valid tokens.

Device code phishing abuses the OAuth device authorization grant, a sign-in method designed for devices without a keyboard. The attacker requests a device code, sends the short user code to the victim with a pretext such as a meeting invitation, and waits. When the victim enters the code on the real Microsoft page and signs in, including MFA, the attacker's script receives the access and refresh tokens.

Example

A user receives a Teams invitation from someone posing as a conference organizer. To "join", they are told to visit the Microsoft sign-in page and enter a code. They do, complete MFA on their phone, and see nothing unusual. Minutes later, the attacker reads their mailbox through Microsoft Graph.

Why it matters for a SOC analyst

Because the sign-in page is genuine and MFA succeeds, URL filtering and even phishing-resistant MFA do not stop it. Look for sign-ins with the device code authentication protocol (AuthenticationProtocol == "deviceCode" in SigninLogs) for users who do not normally use it, and block the flow with Conditional Access wherever it is not needed.

Articles that use this term

  • Phishing

    A message that impersonates someone trustworthy to trick the recipient into clicking a link, opening a file, sharing credentials or sending money.

  • Adversary-in-the-middle phishing

    Phishing that relays the victim's sign-in to the real site through an attacker's proxy, stealing the session cookie after MFA succeeds.

  • Consent phishing

    An attack that tricks a user into granting a malicious cloud app permission to their data, giving the attacker access without stealing a password.

  • Conditional Access

    Microsoft Entra ID's policy engine that decides, at each sign-in, whether to allow access, require MFA or another control, or block.