Agent Foskett Investigation • Microsoft 365 • OAuth Consent

The OAuth App Asked For Permission

The sign-in looked legitimate.

MFA succeeded.

Then the user clicked Accept.

In this Agent Foskett investigation, we examine how OAuth consent abuse can provide access to Microsoft 365 data without stealing a password.

Agent Foskett investigation into OAuth app permission consent abuse in Microsoft 365 and Entra ID
Investigation focus

Learn how OAuth consent abuse can grant application access to Microsoft 365 data even when MFA appears to work correctly.

OAuth consent prompts
Service principal review
Microsoft 365 app access
🧠 MFA success does not always mean the session is safe.
If the user grants an app access, the attacker may not need the password again.
Read Related Story →

First hunt: find consent-related activity

Start by looking for application consent, permission grant and app-related events in Microsoft 365 activity data.
find-oauth-consent-events.kql
  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
CloudAppEvents
| where Timestamp > ago(30d)
| where ActionType has_any ("Consent", "Grant", "Application", "OAuth")
| project Timestamp, AccountDisplayName, ActionType, Application, IPAddress, RawEventData
| order by Timestamp desc
Plain-English translation:

Show me recent Microsoft 365 activity where users or administrators may have granted application permissions.

What Agent Foskett checks next

Consent activity only tells you that something was approved. The next step is to work out whether the application belongs in the environment.
Who approved it?Identify the user or administrator who accepted the permission request and whether that behaviour is normal for their role.
What did the app request?Review requested permissions such as mail, files, contacts, offline access, directory read or user profile access.
Does the app belong?Check whether the application is known, approved, published by a trusted vendor and expected in the tenant.

Second hunt: review service principal activity

When an application is approved in Entra ID, the tenant may contain a service principal that represents that app. Reviewing service principal creation and updates can reveal suspicious app access paths.
review-service-principals.kql
  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
AuditLogs
| where TimeGenerated > ago(30d)
| where OperationName has_any ("Add service principal", "Update service principal", "Consent to application")
| project TimeGenerated, OperationName, InitiatedBy, TargetResources, Result
| order by TimeGenerated desc

Third hunt: look for application access patterns

After identifying a suspicious app, review how often applications are being used and whether any app activity stands out from normal tenant behaviour.
application-access-patterns.kql
  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
CloudAppEvents
| where Timestamp > ago(30d)
| where isnotempty(Application)
| summarize EventCount = count(), Users = dcount(AccountDisplayName) by Application
| order by EventCount desc

The investigation lesson

OAuth consent abuse is not always loud. It may not begin with malware, failed MFA or a suspicious executable.

Sometimes the compromise begins with a legitimate-looking prompt and a user who clicks Accept. The attacker does not need to steal the password if the application has already been granted permission to access the data.
Consent is accessApproving an app can grant access to sensitive Microsoft 365 data depending on the permission scope.
MFA is not the endMFA can protect sign-in, but it does not automatically stop a user approving a malicious or unnecessary app.
Review the app layerDefenders should review enterprise applications, service principals and granted permissions regularly.

Common mistakes

Only resetting the passwordPassword resets may not remove previously granted app permissions or service principal access.
Trusting the Microsoft promptA real Microsoft consent screen can still be used in a malicious workflow if the requested app is untrusted.
Ignoring low-volume appsA suspicious app may not generate high volume. Sometimes a small number of events is enough to matter.
The logs already knew.
The app asked for permission, the user accepted, and the tenant recorded the evidence.
Read Accept Story →

Related Agent Foskett investigations and KQL guides

The User Clicked Accept And Gave Away The Entire Mailbox Review a related investigation where a simple consent action exposed mailbox access.
The MFA Prompt Looked Normal Learn why a normal-looking authentication prompt can still be part of an attack path.

The OAuth App Asked For Permission

Agent Foskett investigates OAuth consent abuse, Microsoft 365 application permissions, service principals and Entra ID evidence using Microsoft Defender XDR and KQL threat hunting.

Microsoft 365 OAuth Consent Investigation

This article explains how defenders can investigate OAuth app permission grants, suspicious service principals, enterprise applications and consent activity across Microsoft 365 and Entra ID.

KQL Threat Hunting for OAuth Consent Abuse

OAuth consent investigations often involve CloudAppEvents, AuditLogs, ActionType, Application, AccountDisplayName, service principal activity and Microsoft 365 security telemetry.