Cybercriminals are increasingly using a technique known as device code phishing to gain access to Microsoft 365 accounts. Unlike traditional phishing attacks that steal passwords through fake login pages, this method tricks users into approving a legitimate Microsoft sign-in request that grants access to their account.
Because the authentication takes place on a genuine Microsoft website, the request can appear trustworthy and may even bypass the protections users expect from Multi-Factor Authentication (MFA).

In this post, I’ll walk through a real-world example of a device code phishing attack
At first glance, this email may appear genuine, claiming that a contact has shared an onboarding pack via a file-sharing service. However, a closer look reveals several warning signs. The email subject states that the file was shared using Box, while the branding within the email is for WeTransfer.

After clicking the “Get your files” button, the user is redirected to a webpage designed to resemble a Microsoft security verification prompt. The page displays Microsoft branding and informs the user that a sign-in attempt has been detected from a new device or location, creating a sense of urgency and legitimacy. The user is then presented with a code and instructed to visit Microsoft’s device login page, enter the code, and sign in with their Microsoft account.

At this stage, the attacker is no longer trying to steal the user’s password directly. Instead, they are attempting to convince the user to complete a legitimate Microsoft authentication process on their behalf. If the user follows the instructions and successfully signs in, they may unknowingly grant the attacker’s application access to their Microsoft 365 account.
Another important warning sign is the address shown in the browser. While the page uses Microsoft branding and references Microsoft services, the website itself is hosted on cornwalled.shop, which is not a Microsoft-owned domain. Users should always verify the website address before entering credentials or following authentication instructions, regardless of how convincing the page appears.
Following the instructions on the previous page takes the user to a genuine Microsoft sign-in page hosted on the legitimate login.microsoftonline.com domain. This is a key reason why device code phishing attacks are so effective. Unlike traditional phishing campaigns that use fake login pages to steal passwords, this attack leverages Microsoft’s real authentication platform, which can make the request appear trustworthy.

The page informs the user that they are signing in to Microsoft Office on another device and states that the device is located in Germany. The user is then prompted to enter their Microsoft 365 email address and continue through the normal sign-in process, including any Multi-Factor Authentication (MFA) prompts that may be configured on their account.
At this stage, the attacker is relying on the user believing they are simply verifying access to a shared document. In reality, by entering their credentials and approving the sign-in request, the user is authenticating the attacker’s session and potentially granting access to their Microsoft 365 account. The sign-in page itself is legitimate, but the request was initiated from a malicious website and is therefore not a legitimate authentication request.
A key warning sign in this example is the message indicating that the sign-in is taking place on a device located in Germany. As the recipient was not attempting to sign in from Germany, this immediately raised suspicion. Rather than continuing, the recipient stopped the process and reported the activity. This allowed us to investigate the email, identify it as a phishing attempt, and prevent the attack from progressing further.
This highlights the importance of staying alert and reporting anything unusual. Even when a login page is genuine, an unexpected sign-in request, unfamiliar location, or unusual authentication prompt should always be treated with caution and reported to your IT team.
