_________________________/\\\\\\\\\\\______________________________________________________________________________________________________________________________________ _______________________/\\\/////////\\\____________________________________________________________________________________________________________________________________ ______________________\//\\\______\///____________________________________________________________/\\\_____/\\\_________/\\\__/\\\_________________________________________ _______________________\////\\\_____________/\\\\\\\\______/\\\\\\\\__/\\\____/\\\__/\\/\\\\\\\__\///___/\\\\\\\\\\\___\//\\\/\\\__________________________________________ __________________________\////\\\________/\\\/////\\\___/\\\//////__\/\\\___\/\\\_\/\\\/////\\\__/\\\_\////\\\////_____\//\\\\\___________________________________________ _____________________________\////\\\____/\\\\\\\\\\\___/\\\_________\/\\\___\/\\\_\/\\\___\///__\/\\\____\/\\\__________\//\\\____________________________________________ ______________________/\\\______\//\\\__\//\\///////___\//\\\________\/\\\___\/\\\_\/\\\_________\/\\\____\/\\\_/\\___/\\_/\\\_____________________________________________ _____________________\///\\\\\\\\\\\/____\//\\\\\\\\\\__\///\\\\\\\\_\//\\\\\\\\\__\/\\\_________\/\\\____\//\\\\\___\//\\\\/______________________________________________ _______________________\///////////_______\//////////_____\////////___\/////////___\///__________\///______\/////_____\////________________________________________________ _____________________________________________/\\\\\\\\\\\__________________/\\\_______________________________________________________________________________________________________ ___________________________________________/\\\/////////\\\_______________\/\\\_______________________________________________________________________________________________________ __________________________________________\//\\\______\///________________\/\\\_________________________/\\\_______________________________________/\\\_______________________________ ___________________________________________\////\\\__________/\\\____/\\\_\/\\\_________/\\\\\\\\\\__/\\\\\\\\\\\__/\\/\\\\\\\___/\\\\\\\\\_____/\\\\\\\\\\\_____/\\\\\\\\____________ ______________________________________________\////\\\______\/\\\___\/\\\_\/\\\\\\\\\__\/\\\//////__\////\\\////__\/\\\/////\\\_\////////\\\___\////\\\////____/\\\/////\\\___________ _________________________________________________\////\\\___\/\\\___\/\\\_\/\\\////\\\_\/\\\\\\\\\\____\/\\\______\/\\\___\///____/\\\\\\\\\\_____\/\\\_______/\\\\\\\\\\\____________ __________________________________________/\\\______\//\\\__\/\\\___\/\\\_\/\\\__\/\\\_\////////\\\____\/\\\_/\\__\/\\\__________/\\\/////\\\_____\/\\\_/\\__\//\\///////_____________ _________________________________________\///\\\\\\\\\\\/___\//\\\\\\\\\__\/\\\\\\\\\___/\\\\\\\\\\____\//\\\\\___\/\\\_________\//\\\\\\\\/\\____\//\\\\\____\//\\\\\\\\\\___________ ___________________________________________\///////////______\/////////___\/////////___\//////////______\/////____\///___________\////////\//______\/////______\//////////____________
_________________________/\\\\\\\\\\\______________________________________________________________________________________________________________________________________ _______________________/\\\/////////\\\____________________________________________________________________________________________________________________________________ ______________________\//\\\______\///____________________________________________________________/\\\_____/\\\_________/\\\__/\\\_________________________________________ _______________________\////\\\_____________/\\\\\\\\______/\\\\\\\\__/\\\____/\\\__/\\/\\\\\\\__\///___/\\\\\\\\\\\___\//\\\/\\\__________________________________________ __________________________\////\\\________/\\\/////\\\___/\\\//////__\/\\\___\/\\\_\/\\\/////\\\__/\\\_\////\\\////_____\//\\\\\___________________________________________ _____________________________\////\\\____/\\\\\\\\\\\___/\\\_________\/\\\___\/\\\_\/\\\___\///__\/\\\____\/\\\__________\//\\\____________________________________________ ______________________/\\\______\//\\\__\//\\///////___\//\\\________\/\\\___\/\\\_\/\\\_________\/\\\____\/\\\_/\\___/\\_/\\\_____________________________________________ _____________________\///\\\\\\\\\\\/____\//\\\\\\\\\\__\///\\\\\\\\_\//\\\\\\\\\__\/\\\_________\/\\\____\//\\\\\___\//\\\\/______________________________________________ _______________________\///////////_______\//////////_____\////////___\/////////___\///__________\///______\/////_____\////________________________________________________ _____________________________________________/\\\\\\\\\\\__________________/\\\_______________________________________________________________________________________________________ ___________________________________________/\\\/////////\\\_______________\/\\\_______________________________________________________________________________________________________ __________________________________________\//\\\______\///________________\/\\\_________________________/\\\_______________________________________/\\\_______________________________ ___________________________________________\////\\\__________/\\\____/\\\_\/\\\_________/\\\\\\\\\\__/\\\\\\\\\\\__/\\/\\\\\\\___/\\\\\\\\\_____/\\\\\\\\\\\_____/\\\\\\\\____________ ______________________________________________\////\\\______\/\\\___\/\\\_\/\\\\\\\\\__\/\\\//////__\////\\\////__\/\\\/////\\\_\////////\\\___\////\\\////____/\\\/////\\\___________ _________________________________________________\////\\\___\/\\\___\/\\\_\/\\\////\\\_\/\\\\\\\\\\____\/\\\______\/\\\___\///____/\\\\\\\\\\_____\/\\\_______/\\\\\\\\\\\____________ __________________________________________/\\\______\//\\\__\/\\\___\/\\\_\/\\\__\/\\\_\////////\\\____\/\\\_/\\__\/\\\__________/\\\/////\\\_____\/\\\_/\\__\//\\///////_____________ _________________________________________\///\\\\\\\\\\\/___\//\\\\\\\\\__\/\\\\\\\\\___/\\\\\\\\\\____\//\\\\\___\/\\\_________\//\\\\\\\\/\\____\//\\\\\____\//\\\\\\\\\\___________ ___________________________________________\///////////______\/////////___\/////////___\//////////______\/////____\///___________\////////\//______\/////______\//////////____________

PART 2: Microsoft 365 Under Siege - The OAuth Phishing Campaign

Welcome to Part 2 of our series exploring December 2025's cybersecurity landscape. If you're just joining us, this is a six-part deep dive into the major threats facing organizations today and the practical steps you can take to protect yourself. You don't need to have read Part 1 to understand this article—each part stands on its own—but if you haven't checked out our discussion on zero-day vulnerabilities in network security appliances, I'd encourage you to read that next.

Today, we're talking about Microsoft 365 security. If your organization uses Office 365, Outlook, Teams, OneDrive, or any part of the Microsoft cloud ecosystem (and statistically, about 75% of enterprises do), this article is for you.

Here's what's happening right now: Multiple threat actor groups—including a Russia-aligned group called UNK_AcademicFlare and various criminal organizations—are running large-scale phishing campaigns that target Microsoft 365 users. But these aren't the clumsy phishing emails your spam filter usually catches. These attacks are sophisticated, use Microsoft's own legitimate infrastructure, and here's the really concerning part: they can bypass multi-factor authentication (MFA).

Let me be clear about what that means. You've probably spent years implementing MFA across your organization. You require employees to use the Microsoft Authenticator app on their phones. You've trained people to be suspicious of phishing. You might even have advanced email security gateways. And yet, this attack technique can bypass all of those defenses.

The attack works by abusing something called "OAuth device code flow"—a legitimate Microsoft feature designed to let you authenticate on devices without web browsers, like smart TVs or IoT devices. Attackers send you an email with a link to a real Microsoft website (not a fake phishing site) and a code to enter. When you authenticate—yes, even with MFA—you're actually granting the attacker's application access to your account.

In this article, you'll learn:

  • How the OAuth device code attack works (explained in plain English, no PhD required)
  • Why it bypasses traditional security controls and MFA
  • Real-world scenarios showing how this impacts organizations
  • Who's behind these attacks (Russia-aligned APTs and criminal groups)
  • Exactly how to protect your Microsoft 365 environment (with PowerShell commands you can run today)
  • What to do if you've already been compromised

Whether you're an IT administrator managing Microsoft 365, a security professional trying to understand modern phishing techniques, or a business leader wondering if your organization is at risk, this article will give you the knowledge and tools you need.

Let's start by walking through exactly how this attack works, step by step.


How the Attack Works (Explained Simply)

Let me walk you through what happens when someone falls for this attack:

Step 1 - The Phishing Email:
You receive an email that appears to come from a trusted source—often a government agency or a colleague whose account was previously compromised. The email says something urgent like "Your account requires security verification" or "Confirm your identity to maintain access."

Step 2 - The Legitimate Microsoft Link:
Here's the clever part: the email contains a link to https://microsoft.com/devicelogin—an actual, legitimate Microsoft website. Your email security gateway sees a link to microsoft.com and doesn't block it because it's not a phishing domain.

Step 3 - The Code:
The email also contains a code like "ABCD-EFGH" and tells you to enter it on the Microsoft page to verify your account.

Step 4 - You Authenticate:
You click the link (which goes to a real Microsoft page, not a fake one). You enter the code. Microsoft then asks you to log in with your username, password, and even your MFA token (like from the Microsoft Authenticator app on your phone).

Step 5 - The Trap Springs:
Here's what's happening behind the scenes: The attacker initiated something called an "OAuth device code flow"—a legitimate Microsoft feature designed to let you authenticate on devices without a web browser (like smart TVs or IoT devices). When you enter that code and authenticate, you're authorizing the attacker's application to access your Microsoft 365 account.

Step 6 - Account Takeover:
The attacker now has an OAuth token that gives them access to your account. They don't need your password. They can:

  • Read all your emails
  • Access your OneDrive and SharePoint files
  • View your Teams conversations
  • Create mailbox rules to forward copies of all future emails to themselves
  • Use your account to send phishing emails to your colleagues and customers
  • Stay persistent even if you change your password (because they have the OAuth token)

Why this is so effective:

  1. Uses legitimate Microsoft infrastructure: Traditional phishing uses fake websites (like "micros0ft.com" instead of "microsoft.com"). This attack uses the real microsoft.com, so URL filters don't catch it.
  2. Bypasses MFA: You actually do authenticate with MFA—Microsoft verifies your identity. But you're granting access to the attacker's application, not protecting yourself.
  3. Hard to detect: IT security teams see a login from a legitimate Microsoft service, from a valid user who authenticated with MFA. It looks completely normal.
  4. Persistent access: Even if you change your password, the OAuth token remains valid. The attacker keeps access until you specifically revoke it.

Real-World Scenario: How This Impacts Your Organization

Let me paint a picture of how this plays out in a real company:

Day 1 - Monday, 9:00 AM:
Sarah, your VP of Finance, receives an email that appears to come from a government agency she regularly works with. It says her account needs verification for compliance reasons. She's busy, clicks the link, enters the code, authenticates (including MFA), and thinks nothing of it.

Day 1 - Monday, 9:05 AM:
Attackers now have access to Sarah's email. They spend the day quietly reading her messages, learning about upcoming payments, vendor relationships, and financial processes.

Day 2 - Tuesday:
Attackers create a mailbox rule that forwards copies of all Sarah's emails to an external account. They also download sensitive documents from SharePoint: financial reports, customer contracts, M&A discussions, and employee data.

Week 2:
Using knowledge from Sarah's emails, attackers send a carefully crafted email to the Accounts Payable team. It looks exactly like Sarah's writing style, references real ongoing projects, and requests a urgent wire transfer of $485,000 to a vendor for a "time-sensitive project." The email includes a PDF invoice that looks legitimate.

Week 2 - Friday, 4:30 PM:
Accounts Payable processes the wire transfer. The money goes to an attacker-controlled account and is immediately dispersed through cryptocurrency mixers.

Week 3 - Monday:
The real vendor contacts Sarah asking about payment for the project. Sarah checks and realizes she never sent that email. IT investigates and discovers the compromised account.

Financial Damage:

  • Stolen funds: $485,000 (unrecoverable)
  • Incident response: $150,000 (forensics, legal, IT remediation)
  • Customer notification: 12,000 customers whose data was in SharePoint: $200,000 (legal review, notification letters, call center)
  • Regulatory fines: GDPR violation for inadequate security: potentially €500,000-€5,000,000
  • Reputation damage: Three major customers pause business pending security review: $1,000,000 in lost revenue
  • Insurance: Deductible and premium increases: $100,000 immediate, $50,000/year ongoing

Total impact: $2.4M-$6.9M

And this assumes they catch it in three weeks. The average dwell time for this type of attack is 60-90 days.


Who's Behind This?

UNK_AcademicFlare (Russia-aligned):
This is a sophisticated nation-state threat actor that has been running this campaign since September 2025. They primarily target:

  • Government entities
  • Defense contractors
  • Technology companies
  • Enterprise organizations

Their goal is espionage—collecting intelligence, stealing intellectual property, and maintaining long-term access for future operations.

Raccoon0365 Phishing-as-a-Service:
This was a criminal operation that sold access to an automated platform for running these attacks. Nigerian law enforcement arrested the developers on December 19, 2025, but copycat platforms continue operations. These criminals target:

  • Any organization with Microsoft 365
  • Focus on financial theft through business email compromise
  • Rent their platform to other criminals for $200-$500/month

Multiple other cybercrime groups:
The technique has spread widely across the criminal ecosystem. We're seeing everyone from ransomware gangs to cryptocurrency scammers using this method.


How to Protect Your Organization

For IT and Security Teams:

Option 1: Block OAuth Device Code Flow Entirely (Recommended)

If your organization doesn't need the device code flow feature (most don't), disable it:

# Connect to Microsoft Graph
Connect-MgGraph -Scopes "Policy.ReadWrite.Authorization"

# Disable device code flow at the tenant level
Update-MgPolicyAuthorizationPolicy -AllowUserConsentForRiskyApps $false

# Verify it's disabled
Get-MgPolicyAuthorizationPolicy | Select-Object -ExpandProperty DefaultUserRolePermissions

Why this works: If device code flow is disabled, attackers can't use this technique. Even if an employee clicks the link and enters the code, Microsoft will reject the authentication because the feature is turned off.

Option 2: Conditional Access Policy (If You Need Device Code Flow)

Some organizations legitimately use device code authentication for IoT devices or specific applications. If that's you, use Conditional Access to restrict it:

# Create a policy that allows device code flow only from trusted locations
# or requires additional verification

# This requires Azure AD Premium P1 licensing
# Configure via Azure Portal:
# Azure AD > Security > Conditional Access > New Policy

# Settings:
# - Name: "Restrict Device Code Authentication"
# - Users: All users (exclude break-glass admin accounts)
# - Cloud apps: All apps
# - Conditions:
#   - Client apps: Mobile apps and desktop clients
#   - Locations: Exclude trusted office IPs
# - Grant controls: Block or Require compliant device

# Set to "Report-only" first to test impact, then enable

Option 3: Enhanced Monitoring

Even if you block device code flow, monitor for attempts:

// Azure Sentinel / Log Analytics query
SigninLogs
| where TimeGenerated > ago(7d)
| where AuthenticationProtocol == "deviceCode"
| summarize
    Attempts = count(),
    UniqueIPs = dcount(IPAddress),
    Countries = make_set(LocationDetails.countryOrRegion)
    by UserPrincipalName, AppDisplayName
| where Attempts > 3 or UniqueIPs > 2
| project UserPrincipalName, Attempts, UniqueIPs, Countries

Set up alerts when this query finds suspicious activity.

For Employees (User Awareness Training):

Your employees need to know about this attack. Here's how to explain it:

Red flags to watch for:

  • Unexpected emails asking you to "verify your account" or "enter a code"
  • Links to microsoft.com/devicelogin that you didn't request
  • Emails with codes like "ABCD-EFGH" asking you to authenticate
  • Messages claiming to be from IT asking for device verification

What to do if you receive a suspicious email:

  1. Don't click the link or enter any codes
  2. Forward the email to your security team
  3. Delete the email
  4. If you already entered a code and authenticated, contact IT immediately

Teach the "verify through alternate channel" rule:
If you receive an email asking you to authenticate or verify your account:

For Business Leaders:

Investment required to protect against this threat:

  • Phishing-resistant MFA (FIDO2 keys): $15-$25 per user/year
  • Microsoft 365 E3/E5 with Conditional Access: Included in licensing (most organizations already have this)
  • Security awareness training: $30-$50 per employee/year
  • Enhanced email security: $5-$15 per user/year

Total cost for 1,000-employee organization: $50,000-$100,000 annually

Cost of a successful attack: $500,000-$5,000,000 (based on actual incident data)

ROI: 5× to 100× cost avoidance

Recommended board-level action:

  1. Approve immediate deployment of device code flow restrictions ($0-$25,000 implementation)
  2. Mandate FIDO2 keys for all employees with access to financial systems or sensitive data (start with 100-200 high-risk users: $5,000-$10,000)
  3. Include full security awareness program in 2026 budget ($50,000-$100,000)

If You've Already Been Compromised

Immediate response steps:

Step 1 - Revoke all active sessions:

# For the compromised user account
Revoke-AzureADUserAllRefreshToken -ObjectId user@domain.com

This kills all active OAuth tokens immediately, kicking the attacker out.

Step 2 - Force password reset:

Set-AzureADUserPassword -ObjectId user@domain.com -ForceChangePasswordNextLogin $true

Step 3 - Check for malicious mailbox rules:

Attackers commonly create forwarding rules to continue receiving copies of emails even after you reset the password. Check and delete these:

Get-InboxRule -Mailbox user@domain.com |
    Where-Object { $_.ForwardTo -ne $null -or $_.RedirectTo -ne $null -or $_.DeleteMessage -eq $true }

# Delete any suspicious rules:
Remove-InboxRule -Mailbox user@domain.com -Identity "<rule name>"

Step 4 - Review OAuth application consents:

See what applications the user authorized:

Get-AzureADUserOAuth2PermissionGrant -ObjectId <user-object-id>

# Remove suspicious grants:
Remove-AzureADOAuth2PermissionGrant -ObjectId <grant-id>

Step 5 - Audit for unauthorized access:

Check what the attacker accessed:

# Review email access
Search-UnifiedAuditLog -StartDate (Get-Date).AddDays(-30) -EndDate (Get-Date) `
    -UserIds user@domain.com -RecordType ExchangeItem

# Review file access
Search-UnifiedAuditLog -StartDate (Get-Date).AddDays(-30) -EndDate (Get-Date) `
    -UserIds user@domain.com -RecordType SharePointFileOperation

This tells you what data was exposed and helps determine breach notification requirements.

Step 6 - Incident response decision tree:

Was financial data accessed?

  • Yes → Contact your bank/payment processor immediately, review all recent transactions, notify customers if their payment data was involved

Was customer PII accessed?

  • Yes → Legal review for breach notification requirements (GDPR 72-hour deadline, state laws vary)

Was the compromised account used to send emails?

  • Yes → Notify recipients that the account was compromised, warn them not to click links or send sensitive info

Was sensitive business data downloaded?

  • Yes → Assess competitive harm, consult legal on disclosure obligations (SEC for public companies)

Why this works: Revoking tokens immediately cuts off attacker access. Password resets ensure they can't log back in. Removing malicious rules stops ongoing data theft. And auditing the scope helps you understand what was exposed so you can respond appropriately (notification, credit monitoring, damage control).


We've covered a sophisticated and concerning threat to Microsoft 365 environments. The OAuth device code phishing campaign represents a fundamental evolution in social engineering—attackers are no longer fighting against Microsoft's security features, they're using Microsoft's legitimate authentication systems as the attack vector.

The key takeaways from Part 2:

  1. This attack bypasses traditional defenses. Your email security gateway won't catch it (the link goes to legitimate microsoft.com). Your URL filters won't block it. Even MFA doesn't protect you because users are authenticating to a real Microsoft service—they're just being tricked into granting access to the attacker's application.
  2. The technical fix is straightforward. If you don't need OAuth device code flow (and most organizations don't), disable it at the tenant level. It takes 5 minutes and costs nothing. If you do need it, use Conditional Access policies to restrict it to trusted locations or require additional verification.
  3. User awareness is critical. Your employees need to know about this attack pattern. Train them to recognize unexpected emails asking them to "verify their account" or "enter a code," especially if they contain links to microsoft.com/devicelogin. Teach the "verify through alternate channel" rule—if you get an email asking for authentication, don't use the link in the email. Go directly to myaccount.microsoft.com instead.
  4. The financial impact is real. We walked through a realistic scenario where a compromised finance executive's account led to $485,000 in fraudulent wire transfers, plus $1.9 million to $6.4 million in additional costs (incident response, breach notification, regulatory fines, reputation damage). The investment to prevent this—$50,000-$100,000 for comprehensive protection—is 5× to 100× less than the cost of a successful attack.
  5. If you're already compromised, act fast. Revoke all active sessions, force password resets, check for malicious mailbox rules (forwarding), and review OAuth application consents. The PowerShell commands we provided will help you do this quickly.

Looking ahead to Part 3:

In the next article in this series, we're going to zoom out from individual attack techniques and look at something bigger: nation-state cyber operations. This isn't about opportunistic criminals looking for a quick score—we're talking about countries using cyber capabilities as instruments of power.

Part 3 will cover three major trends:

  • North Korea's cryptocurrency theft operations: $2.02 billion stolen in 2025 to fund the regime
  • Russia's destructive attacks on critical infrastructure: The recent attack on a Danish water utility and what it means for the future of hybrid warfare
  • China's espionage campaigns: Multiple APT groups conducting large-scale intellectual property theft

Even if you're not in critical infrastructure or government, these nation-state operations affect commercial organizations. North Korean groups target cryptocurrency companies and their employees. Chinese APT groups steal intellectual property from technology companies, manufacturers, and anyone with valuable trade secrets. Russian destructive attacks create collateral damage and supply chain disruptions.

We'll walk through who these threat actors are, what they're after, how they operate, and most importantly—how to defend against nation-state-level threats even if you don't have a nation-state-level security budget.


This is Part 2 of a 6-part series on December 2025's cybersecurity landscape:

  • Part 1: The Zero-Day Crisis
  • Part 2: Microsoft 365 Under Siege (you just finished this)
  • Part 3: Nation-State Cyber Operations
  • Part 4: Ransomware and Data Extortion
  • Part 5: Hardware and Supply Chain Threats
  • Part 6: Strategic Recommendations

The good news about the OAuth device code vulnerability is that it's fixable, often in minutes. The bad news is that many organizations still haven't implemented the fix. Don't be one of them.

Read more