Skip to content
Ashwin Charathsandran

Security & Infrastructure

Writings

The Microsoft 365 Security Gaps I Keep Seeing Exploited

2026-08-2110 min read
  • security
  • microsoft-365
  • entra-id
  • identity
  • cloud
The Microsoft 365 Security Gaps I Keep Seeing Exploited

When people picture a Microsoft 365 breach, they usually imagine zero-day exploits, sophisticated malware, or compromised global admin credentials. Those happen, but the vast majority of incidents I investigate are far more mundane. They trace back to incomplete rollouts, forgotten troubleshooting exceptions, legacy authentication paths nobody realized were still active, or third-party email gateways deployed without hardening what Exchange Online accepts behind them.

Individually, these oversights look like minor operational noise. Together, they build clean, reliable attack paths. The common thread across nearly every incident is not a lack of security tooling, but the gap between what an organization assumes is enforced and what is actually running in production.

The examples below reflect patterns observed across real-world security investigations, with details generalized for confidentiality.

1. Multifactor Authentication Is More Than Just a Setting

Multifactor authentication reliably disrupts identity attacks. Microsoft data indicates MFA blocks over 99.2% of account compromise attempts, climbing past 99.9% when paired with legacy authentication blocks. On paper, that makes MFA look like a solved problem.

In reality, having MFA available is completely different from enforcing it universally. In client environments, the breakdown rarely looks like total absence. Instead, it looks like operational friction:

  • Users who never completed their initial registration process.
  • Temporary exclusions added during troubleshooting that were never cleaned up.
  • Unsupported hardware or delayed onboarding training.
  • VIP and service account bypasses created to avoid disruption.
  • Security Defaults turned off after building customized policies that left coverage gaps.
  • Conditional Access rules that miss specific apps, protocols, or edge cases.
  • Reliance on basic SMS or push notifications that remain vulnerable to adversary-in-the-middle phishing.

Security Defaults give Microsoft Entra tenants baseline controls at no added cost, but organizations needing granular Conditional Access must step up to Entra ID P1 or higher licensing. When budgets, hardware limitations, and user friction collide, organizations often end up with a small pool of unprotected users. An attacker only needs one accessible account to establish a foothold.

Entra ID · MFA Coverage vs. Exploitable Surface

Simulate credential attacks against real-world tenant identity distributions

Total Identities

80

MFA Enforced

78

Active Exclusions

2

Effective Coverage

97.5%

Identity Grid (80 accounts)
Protected (78) Excluded (2)
Tenant Policy Controls
Defensive Takeaway: 97.5% MFA coverage still leaves 2 directly targetable identities. Attackers choose attack paths—they do not spray users randomly.

Consider an organization with 80 users where 78 are fully enforced, one is tied to a legacy scanner, and another was temporarily excluded during phone replacement issues. Leadership sees 97.5% coverage and assumes the tenant is secure, while an attacker simply targets the two accounts without guardrails. The right metric during a security review is not whether MFA is turned on, but which identities, protocols, and authentication flows can still authenticate without it.

Furthermore, MFA is a spectrum rather than a binary switch. High-value accounts should use phishing-resistant methods such as FIDO2 security keys, passkeys, Windows Hello for Business, or certificate-based authentication. Standard push notifications and SMS are better than passwords alone, but they leave users open to coercion or deception.

2. Device Code Phishing: Authenticating on the Real Microsoft Domain

In one compromise I investigated, the victim followed every standard security rule: they did not type credentials into a suspicious lookalike domain, nor did they hand an MFA code over to an attacker. Instead, they followed a prompt to enter a short code into Microsoft's official device login page, authenticated, completed MFA, and inadvertently handed their OAuth tokens directly to the attacker.

OAuth 2.0 · Device Code Flow Phishing Simulation

Step-by-step trace of how Kali365 / EvilTokens capture corporate OAuth tokens via legitimate Microsoft endpoints

1. Attacker Initiates Device Code Request & Delivers LureOAuth RFC 8628
kali-linux: ~/kali365CLI Initiator

# 1. Requesting user code from Microsoft Entra ID...

$ curl -X POST https://login.microsoftonline.com/common/oauth2/v2.0/devicecode \

-d "client_id=d3590ed6-52b3-4102-aeff-aad2292ab01c" \

-d "scope=https://graph.microsoft.com/.default offline_access"

> user_code: "F7KM-Q2PD"

> verification_uri: "https://microsoft.com/devicelogin"

> Status: polling token endpoint (interval=5s)...

Inbound Email: user@contoso.exampleOutlook / Teams
M

Microsoft 365 Security Team

Subject: Urgent: Quarterly Compliance Document Shared

A protected financial audit document has been shared with your identity.

To confirm your identity on this secondary session, authenticate using your one-time verification code:

F7KM-Q2PD

https://microsoft.com/devicelogin

Key Concept: The attacker generates a legitimate device code session directly from Microsoft's OAuth server. The user code F7KM-Q2PDis real and linked to the attacker's client session waiting in the cloud.

Stage 1 of 4

Device Code Flow exists for legitimately input-constrained hardware such as conference room consoles, smart TVs, or command-line utilities. The client requests an alphanumeric code from Entra ID, directs the user to sign in via a browser on a secondary device, and receives the session tokens once authentication succeeds.

Attackers exploit this architecture by initiating the request themselves, embedding the generated code into a phishing lure, and letting the victim complete the interactive sign-in. Because the victim navigates to an authentic Microsoft domain with valid TLS certificates and completes standard MFA, conventional awareness training fails to flag the threat. The flaw lies in approving an authentication challenge the user never initiated.

The Commodification of Kali365

This technique has shifted from a manual attack into automated, commoditized tooling. In May 2026, the FBI issued a public advisory regarding Kali365, a Phishing-as-a-Service platform operating since April 2026 that allows novice operators to capture Microsoft 365 OAuth tokens via device code lures. Huntress documented an extensive infrastructure backing the service, including over 240 IP addresses, dozens of built-in templates, automated mailbox access, and tooling designed to turn intercepted tokens into active browser sessions in as little as 42 seconds.

Telemetry from LevelBlue highlighted similar surges across platforms like EvilTokens, Ghost Hub, Cyb3r, and Tycoon2FA. The defensive takeaway is straightforward: do not rely on end users to distinguish legitimate device-code prompts from attacks. If your organization has no defined operational need for Device Code Flow, block it across Conditional Access, carving out tightly scoped exceptions only where strictly necessary.

3. The Gap Between Conditional Access Policies and Actual Enforcement

Conditional Access is the core policy engine of Entra ID, yet it frequently produces a false sense of security. A policy list filled with clean titles like "Require MFA - All Users", "Block Risky Sign-ins", and "Require Compliant Devices" means nothing if the underlying assignments and exclusions leave backdoors open.

Entra ID · Conditional Access Policy Evaluator

Explore how individual policy passes and exclusion drift can collectively permit an attack

Sign-In Context TelemetryRisk: Medium
User:sarah.finance@contoso.example
Location:Bucharest, Romania (Anomalous IP)
Device State:Unmanaged Windows 11 (Non-compliant)
Auth Protocol:Device Code Flow
Policy Evaluation Engine (Live Sequential Check)
CA01: Require MFA for All UsersPASS
Scope: All Users / All Cloud AppsMFA challenge successfully fulfilled by user
CA02: Require Compliant DeviceNOT APPLIED (EXCLUDED)
Scope: All Users (Exclude: Finance Department)User belongs to 'Finance Department' exclusion group #INC-3021
CA03: Block Medium/High Risk Sign-insREPORT-ONLY MODE
Scope: Sign-in Risk >= MediumAudit log recorded 'Would Block' but enforcement is disabled
CA04: Block Device Code FlowNOT APPLIED (EXCLUDED)
Scope: Interactive Users (Exclude: Finance Group)Finance group excluded for legacy batch reconciliation scripts
🚨FINAL DECISION: ACCESS GRANTED
Loophole Exploited: Sign-in Permitted

Despite having clean policy names, the sign-in succeeds because the user is excluded from device compliance, the risk block is parked in Report-Only mode, and Device Code Flow is unblocked.

Interactive Remediation: Patch the Policy LoopholesToggle in Real-Time

💡 Challenge: Notice how disabling any single of these three loopholes changes the final decision from ACCESS GRANTED to ACCESS BLOCKED.

Suppose a finance employee signs in from an unmanaged device at a foreign IP using Device Code Flow to access Microsoft Graph. If the policy requiring compliant devices excludes the finance group for legacy reasons, and the high-risk block is parked in report-only mode, the sign-in is granted despite the tenant appearing fully protected on paper.

Exclusion drift is one of the most common issues in mature tenants. An administrator adds a traveling executive, an overseas contractor, or a broken service account to an exclusion group like CA-Exclude-MFA to resolve an immediate ticket. Without automated Entra Access Reviews and tight operational hygiene, temporary workarounds quietly become permanent vulnerabilities. Assessing Conditional Access requires evaluating who and what bypasses the rules, rather than reviewing the rule definitions in isolation.

4. Lingering Legacy Authentication and SMTP AUTH

While Microsoft has deprecated Basic Authentication across Exchange ActiveSync, POP, IMAP, Remote PowerShell, and EWS, historical protocols still linger. SMTP AUTH remains a key exception in 2026, with Microsoft disabling it by default for existing tenants toward the end of December 2026 rather than enforcing a total shutdown.

Microsoft telemetry historically showed that over 97% of credential-stuffing attacks and 99% of password-spray attempts targeted legacy authentication endpoints. Because legacy protocols cannot enforce modern MFA or device posture checks, a single unmonitored mailbox, legacy multifunction printer, or old automated script can expose the entire tenant to credential attacks.

Exchange Online · Legacy Authentication & SMTP AUTH Surface

Visualize how basic authentication creates a bypass path around modern identity protections

Tenant Authentication Ingress Doors
Browser / Web

OAuth 2.0 + MFA

Protected by CA
Microsoft Graph

API / SDK / PowerShell

Protected by CA
Basic SMTP AUTH

User + Password Only

Direct Bypass Path 🚨
OAuth SMTP AUTH

Bearer Token Auth

Modern Protocol
Selected Protocol: Basic SMTP AUTH (Port 587/25)Vulnerable Ingress
MFA EnforcementUnsupported
Device Posture CheckUnsupported
Modern Auth (MSAL)No (Basic Auth)

Legacy plain-text username + password authentication over SMTP. Bypasses interactive MFA prompts and device compliance gates.

Targeting 500 credential pairs against tenant mailboxes
Tenant Remediation Strategy: Disable SMTP AUTHExchange Online PowerShell

Organizations should disable SMTP AUTH globally at the tenant level and permit it only on explicit, monitored mailboxes that genuinely require basic authentication. If an active legacy exception lacks a clear business owner and documented justification, it should be phased out immediately.

5. Inactive Accounts as Silent Attack Surface

Dormant accounts rarely trigger alerts, fail builds, or surface on vulnerability scans, which makes them easy to overlook. Microsoft defines inactive accounts as those no longer needed for business purposes and recommends auditing identities after 90 to 180 days of inactivity.

Identity Lifecycle · Stale Account & Access Accumulation

Trace how dormant accounts quietly accumulate cross-departmental blast radius over time

Identity Career ProgressionViewing Year: 2026
2026: Employee Departure (Offboarding Missed)Inactive: 147 days without sign-in
+ Access Granted:
  • No new access granted
- Access Revoked:
  • ⚠️ None (Account Not Disabled)
Effective Blast Radius (11 active entitlements)Status: 🟢 Account Enabled in Entra
🔑Group: Finance-Users
🔑SharePoint: Finance & Payroll (Read)
🔑Enterprise App: QuickBooks / NetSuite SSO
🔑Group: Finance-Managers
🔑SharePoint: Executive Salary Reviews
🔑Enterprise App: Corporate Wire Payment Approval
🔑Group: Alpha-Operations-Team
🔑SharePoint: Global Logistics & Supply Chain
🔑Azure RBAC: Contributor (Ops Dev Subscription)
🔑Group: Operations-Managers
🔑Enterprise App: Global Logistics Portal
Lifecycle Remediation Actions:

The risk is not merely an unmonitored mailbox, but the historical access attached to it:

  • Entra and Azure RBAC roles.
  • SharePoint and Teams access containing confidential files.
  • Enterprise application assignments and federated SaaS connections.
  • VPN profiles and previously registered MFA hardware.

As employees transfer departments or take on temporary project roles, permissions accumulate. Leaving former employee accounts enabled without automated lifecycle provisioning provides attackers with low-noise access vectors. Identity lifecycle management is fundamental attack-surface reduction.

6. Email Security Beyond Standard SPF, DKIM, and DMARC

Because Microsoft 365 consolidates email, identity, and document storage, compromising or spoofing internal communication remains a primary target for threat actors. While SPF, DKIM, and DMARC are necessary baselines, relying on them as simple checkboxes leaves architectural blind spots.

For example, message headers showing dmarc=bestguesspass indicate that no actual DMARC policy exists and Microsoft merely inferred a pass heuristically. Domains must move beyond p=none to p=quarantine or p=reject to enforce authentication.

The Ghost-Sender Architectural Bypass

In June 2026, InfoGuard published research detailing Ghost-Sender, an architectural vulnerability affecting tenants using third-party email security gateways. In these setups, public MX records route incoming mail through the external gateway, but the direct Exchange Online Protection (EOP) endpoint remains exposed to the internet.

Exchange Online · Ghost-Sender Architectural Bypass Simulation

Explore how direct SMTP delivery to Microsoft EOP hostnames bypasses third-party email security gateways

Mail Flow Routing TopologyTarget: contoso.example
📧

Internet Sender

Spoofed Attacker (ceo@contoso.example)

🚫

Gateway Bypassed!

Direct TCP 25 connection

0 Inspection Layers
☁️

Exchange Online (EOP)

contoso.mail.protection.outlook.com

Default Inbound Route
📥

Target Mailbox

finance@contoso.example

Spoofed Email Delivered 🚨
Simulated Inbound Message Headers & AuthenticationRFC 8601 Auth-Results
From Headerceo@contoso.example
SPF EvaluationFAIL (IP Not Listed)
DKIM SignatureNONE
DMARC Policyp=none / bestguesspass
Gateway InspectionNOT INSPECTED ⚠️
Exchange ActionDELIVERED (INBOX)
Tenant Hardening Controls (Mitigate Ghost-Sender)

Attackers can bypass the external filtering appliance entirely by routing SMTP traffic directly to the tenant's EOP hostname. InfoGuard demonstrated that this allowed spoofing of both internal and external domains, delivering uninspected messages directly to user inboxes even when SPF, DKIM, and DMARC were present. Organizations should review their connectors, enable tenant controls like RejectDirectSend, and ensure Exchange Online only accepts inbound mail originating from their designated security gateways.

7. Publicly Exposed Tenant Metadata

A company's Microsoft 365 footprint is not private. Using basic reconnaissance, an attacker can resolve an organization's public domain to uncover:

  • Microsoft Entra tenant IDs.
  • Associated custom and fallback onmicrosoft.com domains.
  • Inbound mail routing infrastructure.
  • Specific federated identity providers and public authentication endpoints.

Public OSINT · Microsoft Tenant Metadata Discovery

Demonstrate what public OpenID, Realm, and DNS endpoints reveal without authentication

SIMULATED ENVIRONMENT
1. DNS & Mail InfrastructureResolved Publicly
MX Hostname:contoso-example.mail.protection.outlook.com
Microsoft 365 Cloud:Detected (EOP Hostname Match)
2. Entra ID Directory IdentityOpenID Discovery Endpoint
Tenant GUID:72f988bf-86f1-41af-91ab-2d7cd011db47
Initial Fallback Domain:contoso.onmicrosoft.com
Organization Name:Contoso Corporation
3. Authentication & Federation PostureGetUserRealm.srf
Namespace Type:Managed
Identity Provider:Microsoft Entra ID (Native Cloud Managed)
4. Email Security PostureTXT Records
SPF Configuration:v=spf1 include:spf.protection.outlook.com -all
DKIM Keys:Active (selector1._domainkey.contoso.example)
DMARC Policy:v=DMARC1; p=none; (Weak - Monitoring only)
Credentials Required

0

Auth Prompts Triggered

0

Metadata Data Points

8 Items

Security Architecture Reality: Tenant IDs, fallback domains, and authentication endpoints are public identifiers by design. Defenses should be architected assuming external adversaries already have full visibility into these identifiers.

Open-source tooling like AADInternals and ROADtools automates this reconnaissance, mapping out directory structures, authentication methods, and token endpoints. Tenant IDs are public identifiers rather than secrets, so security architectures must be designed under the assumption that external attackers already understand your public Microsoft environment.

8. Abusing URL Rewriting and Trusted Redirect Chains

URL-rewriting solutions like Defender for Office 365 Safe Links inspect web destinations at time-of-click. However, because security vendor domains carry high organizational trust, threat actors actively weaponize them.

LevelBlue SpiderLabs has documented campaigns where attackers harvest pre-rewritten URLs from compromised tenants to disguise malicious payloads behind trusted hostnames like Cisco, Trend Micro, Barracuda, and Mimecast. By stacking multiple redirect hops across legitimate security vendors, compromised sites, and cloud worker scripts, attackers bypass basic domain reputation filters.

URL Rewriting · Nested Redirect Chain Inspector

Demonstrate how attackers chain pre-rewritten security vendor URLs to bypass static domain reputation checks

Inbound Email Link (Click Time Inspection):
https://urldefense.proofpoint.com/v2/url?u=https-3A__ironport-rewriter.example.com_r-3Fid-3D83921A...
The initial hostname is a trusted cybersecurity vendor (proofpoint.com). Is this URL safe?
Redirect Chain Hops (1 of 5 unwrapped)
1urldefense.proofpoint.com
Trusted Security Vendor

Initial link in phishing email. Domain has high trust rating and passes static allowlists.

Security teams should avoid creating blanket domain allowlists for third-party security vendors they do not use, and educate analysts to evaluate the final landing destination of a URL rather than trusting the initial hostname.

9. The Core Breakdown: Intended vs. Effective Trust Boundaries

Across MFA gaps, device code phishing, stale accounts, and mail routing bypasses, the root problem is consistent: a breakdown between what policy administrators intend to enforce and what the infrastructure actually permits.

Incidents happen in the margin between theoretical configuration and operational reality. An organization might believe it enforces universal MFA, routes all mail through a secure gateway, and restricts sensitive access, while legacy exclusions and open routing paths tell a different story.

Architecture Overview · Intended vs. Effective Trust Boundaries

Visualize the margin between theoretical security policy and operational reality

🏢 MICROSOFT 365 / ENTRA ID CORE TENANT
1. User Identity & MFA

2 Excluded Accounts Bypass MFA 🚨

2. OAuth Transfer Flows

Device Code Token Hijack 🚨

3. Conditional Access

Exclusion Drift & Report-Only 🚨

4. Email Ingress Protocols

Basic SMTP AUTH Unchecked 🚨

5. Identity Lifecycle

Dormant Accounts Retain Access 🚨

6. Mail Inbound Routing

Direct EOP TCP 25 Bypass 🚨

Attack Path: MFA Exclusion Blind Spots (Section 1)Severity: Critical
Intended Policy:

97.5% MFA enrollment across tenant

Operational Attack Path:

Attacker targets the 2.5% excluded service/temporary accounts to establish a foothold.

High-Impact Tenant Review Areas

When conducting a tenant assessment, these fundamental areas provide the most immediate visibility into real exposure:

Identity & Authentication

  • Confirm MFA is enforced for 100% of interactive users, transitioning sensitive accounts to phishing-resistant methods.
  • Block Device Code Flow across the tenant unless an explicit, restricted business exception exists.
  • Disable SMTP AUTH globally and disable legacy authentication protocols across all mailboxes.
  • Implement automated offboarding workflows and audit accounts inactive for over 90 days.

Conditional Access

  • Verify policy assignments cover all users and target resources without unintended bypasses.
  • Schedule recurring Entra Access Reviews for all Conditional Access exclusion groups.
  • Transition legacy report-only policies into full enforcement.

Email Architecture

  • Enforce strict DMARC policies (p=quarantine or p=reject) and verify SPF and DKIM alignments.
  • Lock down inbound connectors and enable RejectDirectSend to prevent gateway bypasses.
  • Audit Safe Links configurations and remove blanket trust for third-party URL rewriting domains.

Self-Assessment · High-Impact Tenant Posture Review

Evaluate your organization against the top exploited Microsoft 365 architectural blind spots

Strong Controls

1

Action Required

5

Blind Spots (Unknown)

3

Identity & AuthenticationCritical

Is MFA enforced for 100% of interactive user identities without forgotten exclusions?

Identity & AuthenticationCritical

Are privileged administrative roles enforced with Phishing-Resistant MFA (FIDO2 / CBA)?

Identity & AuthenticationCritical

Is OAuth Device Code Flow blocked in Conditional Access for interactive users?

Identity & Authentication

Is Basic SMTP AUTH globally disabled across the tenant?

Conditional Access

Are Conditional Access exclusion groups audited with recurring Entra Access Reviews?

Conditional Access

Have legacy 'Report-Only' policies been audited and promoted to full enforcement?

Email ArchitectureCritical

Is your organizational DMARC policy set to strict enforcement (p=quarantine or p=reject)?

Email ArchitectureCritical

Is Exchange Online configured to reject direct SMTP delivery (RejectDirectSend) around external gateways?

Identity & Authentication

Are dormant accounts inactive for >90 days automatically audited and deprovisioned?

Generated Priority Remediation Steps (8 areas to harden):
  1. Are privileged administrative roles enforced with Phishing-Resistant MFA (FIDO2 / CBA): Require FIDO2 security keys or Windows Hello for Business for Global Admin and Exchange Admin roles.
  2. Is OAuth Device Code Flow blocked in Conditional Access for interactive users: Create a Conditional Access policy blocking authentication transfer / device code for standard users.
  3. Is Basic SMTP AUTH globally disabled across the tenant: Run `Set-TransportConfig -SmtpClientAuthenticationDisabled $true` in Exchange Online PowerShell.
  4. Are Conditional Access exclusion groups audited with recurring Entra Access Reviews: Configure automated 30-day Entra Access Reviews on all break-glass and exclusion security groups.
  5. Have legacy 'Report-Only' policies been audited and promoted to full enforcement: Review sign-in logs for Report-Only policies and flip 'Block Risky Sign-ins' to Enforced.
  6. Is your organizational DMARC policy set to strict enforcement (p=quarantine or p=reject): Upgrade DMARC DNS TXT record from `p=none` to `p=quarantine` or `p=reject` with strict SPF/DKIM alignment.
  7. Is Exchange Online configured to reject direct SMTP delivery (RejectDirectSend) around external gateways: Restrict inbound partner connectors to security gateway IP blocks and enable RejectDirectSend.
  8. Are dormant accounts inactive for >90 days automatically audited and deprovisioned: Implement Entra ID lifecycle workflows to disable and revoke sessions for accounts dormant >90 days.

Security posture is rarely broken by sophisticated zero-days; it is eroded by unfinished migrations, unmonitored exceptions, and lingering trust assumptions. Attackers do not need to defeat every layer of your security stack when a single forgotten door remains unlocked. Reviewing and tightening these baseline configurations consistently yields the highest defensive return on investment.