MCADDF

[REALWORLD-018]: OAuth Provider Impersonation

1. METADATA HEADER

Attribute Details
Technique ID REALWORLD-018
MITRE ATT&CK v18.1 T1484.002 (Domain or Tenant Policy: Trust Modification); related to T1550 (Use of Web Session Cookie / Token Replay)
Tactic Initial Access; Credential Access; Persistence; Defense Evasion
Platforms Cross-Cloud (Entra ID, Okta, Google Workspace, AWS IAM Identity Center, SaaS using OAuth 2.0 / OIDC)
Severity Critical
CVE N/A
Technique Status ACTIVE
Last Verified 2026-01-10
Affected Versions All major IdPs and SaaS platforms that support OAuth 2.0 / OIDC, including Entra ID and multi-tenant apps
Patched In No single patch; mitigated through OAuth consent governance, verified publishers, Conditional Access, and tenant hardening
Author SERVTEPArtur Pchelnikau

2. EXECUTIVE SUMMARY

Operational Risk

Compliance Mappings

Framework Control / ID Description
CIS Benchmark CIS Microsoft 365 / Entra ID controls for app consent and enterprise apps Improper OAuth governance violates secure configuration requirements.
DISA STIG Application Security and Identity controls Ensure external IdPs and OAuth clients are vetted, approved, and monitored.
CISA SCuBA Cloud identity & SaaS baselines Emphasises granular control of OAuth apps and third‑party access to federal tenants.
NIST 800-53 AC-3, AC-6, IA-2, IA-5 Access enforcement, least privilege, and strong authentication extended to application‑to‑API trust.
GDPR Art. 5, 25, 32 Controller must maintain control of data sharing with processors and sub‑processors; risky OAuth consents breach data minimisation and security of processing.
DORA Art. 9, 11 Governance over ICT third‑party risk including API‑based and OAuth access to financial data.
NIS2 Art. 21 Requires managing supply‑chain and third‑party access risks, including OAuth‑based integrations.
ISO 27001 A.5.19, A.5.23, A.8.23 Managing information security in use of cloud services and third‑party components.
ISO 27005 SaaS OAuth Backdoor Risk scenario where unvetted OAuth apps or IdP impersonation leads to data breach.

3. TECHNICAL PREREQUISITES

Supported Versions:

4. ENVIRONMENTAL RECONNAISSANCE

Entra ID / PowerShell Reconnaissance

# List OAuth service principals and their permissions
Connect-MgGraph -Scopes 'Application.Read.All','Directory.Read.All'
Get-MgServicePrincipal -All | Select-Object AppId, DisplayName, PublisherName

# List OAuth consent grants
Get-MgOauth2PermissionGrant -All |
  Select-Object ClientId, ResourceId, Scope, ConsentType

What to Look For:

Entra ID Portal Reconnaissance

Okta / SaaS Reconnaissance

5. DETAILED EXECUTION METHODS AND THEIRS STEPS

METHOD 1 – Malicious Multi‑Tenant OAuth App in Entra ID

Supported Versions: All Entra ID tenants allowing user or admin consent to multi‑tenant apps.

Step 1: Register Malicious App

Objective: Create a multi‑tenant OAuth app controlled by the attacker.

Portal Steps:

  1. Azure portal → Entra ID → App registrations → New registration.
  2. Set supported account types to multiple organisations.
  3. Configure redirect URI to attacker‑controlled domain.
  4. Add API permissions such as Microsoft Graph Mail.ReadWrite, Files.Read.All, Directory.Read.All, offline_access.

Objective: Trick users into granting the app permissions.

Execution:

Result:

METHOD 2 – OAuth Provider Impersonation via Inbound IdP

Supported Versions: IdPs and SaaS platforms that allow configuring external OAuth providers.

Step 1: Add Attacker‑Controlled OAuth Provider

Objective: Configure a connection that appears to be a trusted provider (for example, corporate IdP or Microsoft) but is actually controlled by the attacker.

Execution:

Step 2: Abuse Subject / Email Mapping

Objective: Map accounts from attacker IdP to privileged accounts in the target tenant.

Execution:

Result:

6. ATTACK SIMULATION AND VERIFICATION (Atomic Red Team)

Generic Command:

Invoke-AtomicTest T1550 -TestNumbers 1

7. TOOLS AND COMMANDS REFERENCE

8. SPLUNK DETECTION RULES

Rule: Suspicious New OAuth App With High‑Privilege Scopes

index=azure OR index=o365 sourcetype="o365:management:activity" \
  Operation="Add service principal" OR Operation="Update application"
| search ModifiedProperties.scope="*Mail.ReadWrite*" OR ModifiedProperties.scope="*Directory.Read.All*" \
  OR ModifiedProperties.scope="*offline_access*"
| stats latest(TimeGenerated) as last_time by UserId, Workload, Operation, ModifiedProperties

9. MICROSOFT SENTINEL DETECTION

AuditLogs
| where OperationName in ('Add service principal','Consent to application','Grant consent to application')
| extend scopes = tostring(parse_json(tostring(TargetResources[0].modifiedProperties))[0].newValue)
| where scopes has_any ('Mail.ReadWrite','Files.Read.All','Directory.Read.All')

10. WINDOWS EVENT LOG MONITORING

Primarily cloud‑based; Windows logs play a secondary role for local token theft and browser compromise, covered in other modules.

11. SYSMON DETECTION PATTERNS

Use generic browser and process monitoring patterns for AiTM proxies and token theft infrastructure running on attacker footholds.

12. MICROSOFT DEFENDER FOR CLOUD

13. MICROSOFT PURVIEW (UNIFIED AUDIT LOG)

Search-UnifiedAuditLog -StartDate (Get-Date).AddDays(-7) -EndDate (Get-Date) \
  -Operations 'Consent to application','Add service principal' \
  | Export-Csv '.\\oauth-consents.csv' -NoTypeInformation

14. DEFENSIVE MITIGATIONS

15. DETECTION AND INCIDENT RESPONSE

Step Phase Technique Description
1 Initial Access OAuth consent phishing User is tricked into granting permissions.
2 Credential Access Token theft / reuse Adversary harvests and reuses OAuth tokens.
3 Current Step REALWORLD-018 – OAuth Provider Impersonation Attacker app or IdP impersonates trusted provider.
4 Persistence OAuth backdoor Rogue app or IdP remains until removed.
5 Impact Data theft and account takeover Wide API access used for exfiltration or further escalation.

17. REAL-WORLD EXAMPLES