Device Code Phishing: Abusing Legitimate Microsoft 365 Authentication

  • FEBRUARY 25TH, 2026
  • 2min read
Device Code Phishing: Abusing Legitimate Microsoft 365 Authentication

In device code phishing, threat actors exploit the device code authentication flow to capture authentication tokens, which they then use to access target accounts, and further gain access to data and other services that the compromised account has access to. This technique could enable persistent access as long as the tokens remain valid, making this attack technique attractive to threat actors. This works because they’re abusing Microsoft’s legitimate OAuth device flow.

How it works

The attacker generates a legitimate device code request and tricks the victim into entering it on a real Microsoft sign-in page (microsoft.com/devicelogin) and because this is Microsoft’s real infrastructure, it passes SPF, DKIM, DMARC, and secure email gateway checks.

When the targeted person enters the code, they will be prompted to log in with their credentials and complete any MFA verifications, just as they normally would when logging in. After authenticating, Microsoft displays the name of the OAuth application that was authorised.

This action issues valid access and refresh tokens to the attacker, allowing them to access the victim’s account and related services (e.g., email or cloud storage) without needing a password. Access persists as long as the tokens remain valid, enabling potential lateral movement within the environment.

How to Protect Your Organization

1. Restrict Device Code Flow: Administrators are also recommended to turn off the device code flow option when not required and to enforce conditional access policies.

2. Harden Conditional Access: Require compliant devices, trusted locations, and phishing-resistant MFA (e.g., FIDO2 keys).

3. Employee Awareness: Users should never enter a login code unless they initiated the request themselves. If unsure, report.

Explore more CIL Advisories

pac4j-jwt Vulnerability: Could Allow Authentication Bypass

pac4j-jwt Vulnerability: Could Allow Authentication Bypass

In modern web applications, JSON Web Tokens (JWTs) act like digital passports. They tell the server who you are and…

MARCH 9TH, 2026

Read More
Critical Patch Management: Closing the Door on Exploits

Critical Patch Management: Closing the Door on Exploits

Unpatched software remains one of the leading causes of enterprise breaches in 2026. Attackers no longer rely solely on zero-day…

MARCH 2ND, 2026

Read More
Reynolds Ransomware: Disables Security Before Encrypting Data

Reynolds Ransomware: Disables Security Before Encrypting Data

Reynolds is a ransomware threat identified in early 2026. Its key capability is disabling security tools before encrypting files.

FEBRUARY 23RD, 2026

Read More

Never miss a CIL Security Advisory

Stay informed with the latest security updates and insights from CIL.

Device Code Phishing: Abusing Legitimate Microsoft 365 Authentication

Contact Us

Message Sent!

Thank you for reaching out. We have received your message and will get back to you shortly.

Check your email for a confirmation from us.

Start a project

Project Request Submitted!

Thank you for your interest. Our team will review your project details and reach out to you soon.

Check your email for a confirmation from us.

We use cookies to enhance your browsing experience, serve personalized ads or content, and analyze our traffic. By clicking "Accept All", you consent to our use of cookies. You can manage your preferences or learn more in our Cookie Policy .