A large-scale phishing operation that abuses the OAuth Device Code Authentication flow to seize control of organizational accounts has been discovered by MSFT Defender team . The campaign leverages automation and on-demand code generation to circumvent the standard fifteen-minute expiration window on these codes. AI-assisted tooling further amplifies the operation, enabling attackers to coordinate and scale their efforts at speed.

Attack overview

Device Code Authentication is a legitimate login mechanism designed for devices that lack the capability to render a full login interface. In this model, a user receives a short code on one device and is directed to enter it into a browser on a separate device to complete authentication. Attackers exploit this by decoupling the login process from the actual user session. When a target enters the supplied code into the genuine login portal, access is silently granted to a session under the attacker’s control. This technique enables account compromise without directly harvesting passwords, effectively bypassing conventional multi-factor authentication safeguards.

Attack flow

Phishing attack

The operation begins with a reconnaissance phase roughly ten to fifteen days before the phishing attempt itself. During this window, attackers verify whether targeted email accounts are active within a given organization. The delivery mechanism is structured as a multi-stage sequence engineered to evade standard email security and endpoint protection systems. Initial access is triggered when a user clicks a malicious link or opens a compromised attachment.

To avoid detection by automated security scanners, attackers leverage hijacked legitimate domain names and cloud hosting infrastructure. The phishing interface is frequently rendered using a technique that spawns a fake browser window within a webpage, making it appear to be a genuine login prompt. In other cases, the interface is embedded inside a document preview that obscures the underlying content while displaying interactive buttons and device codes.

Social engineering lures are tailored to maximize user interaction, commonly impersonating document requests, e-signature tasks, or voicemail notifications. In some instances, users are prompted to enter their email address, which is then used to instantly generate a corresponding device code. The phishing site operates with automated scripts to manage the workflow seamlessly. To maintain the illusion of legitimacy, attackers replicate the visual identity of trusted brands with precision.

Phishing emails are distributed in varied formats and styles to improve deliverability past security filters. These messages funnel users to pages visually indistinguishable from authentic login environments, yet entirely under attacker control. When a user interacts with the page, they are redirected to a site that runs background automation to request a genuine device code from the Microsoft identity platform in real time. This code is then presented alongside instructions directing the user to the official login portal.

In some cases, the automation script even copies the code directly to the user’s clipboard to reduce friction. If the user is not currently signed in, they are prompted to enter their credentials and complete multi-factor authentication. If already authenticated, simply pasting the code and confirming the prompt is sufficient to hand the attacker access. Once the official login page is opened, the attacker’s script continuously polls for the session status. The moment the user completes the process, the system confirms success, and the attacker obtains a valid access token to the compromised account.

Post-compromise activity

The actions taken after account compromise vary depending on the attacker’s objectives. In some cases, attackers rapidly entrench themselves by enrolling new devices within minutes of gaining entry, ensuring persistent long-term access. In other scenarios, threat actors remain dormant for several hours before resuming activity, a deliberate tactic to avoid triggering immediate detection. Subsequently, they may establish covert email forwarding rules or exfiltrate sensitive messages. Following initial access, activity typically expands to include network reconnaissance and enumeration of account details through programmatic interfaces. This allows attackers to catalog all compromised accounts, prioritize high-value targets, and orchestrate subsequent lateral movements or data exfiltration operations across the organization.

To stop AI-generated content threats, protection must start before malicious data enters the environment. FileDNA secures this pre-execution stage by treating all incoming files, such as archives and installers, as potential threats. By performing deep structural analysis, FileDNA inspects file composition and validates internal components to find hidden or suspicious data. Instead of waiting for a file to run or checking for known signatures, it neutralizes threats by cleaning or removing high-risk elements before delivery. This proactive method works well against unknown threats where malicious intent is buried deep within layers of data or legitimate software. FileDNA uses recursive unpacking and object-level inspection to reveal these hidden payloads, allowing it to strip away dangerous code and provide safe, reconstructed files to the user.