How the attack works
Microsoft Entra ID lets users and administrators grant third-party applications access to their data through OAuth consent. In a consent phishing attack, the victim follows a link to a legitimate Microsoft sign-in page and approves permissions such as Mail.Read, Files.Read.All or offline_access for an application the attacker controls.
The resulting tokens belong to the application, not to a password, so resetting the user's password does not cut off access. Admin consent to application permissions (app role assignments) is worse: it grants tenant-wide access with no user present at all. A delegated permission that an administrator grants on behalf of all users reaches every user who signs in to the application, and a rule on this page reads that grant for high-privilege scopes. Another rule reads the consent attempts that Microsoft Entra ID stopped as risky, which show a consent phishing attempt that did not succeed.
What an attacker needs
- User consent to applications allowed in the tenant, or an administrator who can be convinced to grant admin consent.
- A multi-tenant application registered by the attacker with a convincing name and logo.
Impact
Persistent, MFA-independent access to mailboxes, OneDrive and SharePoint content, and any other API the consent covers. Attackers use it for business email compromise, data theft and internal phishing from a trusted account.
Detection rules
Application Permission Granted to a Service Principal
Detects an application permission (app role assignment) granted to a service principal. Unlike delegated consent, application permissions such as Mail.Read or Files.Read.All give tenant-wide access with no signed-in user.
title: Application Permission Granted to a Service Principal
id: 8029bf50-78c6-4b3f-964e-66535417ef9c
status: experimental
description: >-
Detects an application permission (app role assignment) granted to a service
principal. Unlike delegated consent, application permissions such as
Mail.Read or Files.Read.All give tenant-wide access with no signed-in user.
references:
- https://attack.mitre.org/techniques/T1528/
author: Forestall
date: 2026-11-10
tags:
- attack.persistence
- attack.t1528
logsource:
product: azure
service: auditlogs
detection:
selection:
OperationName: Add app role assignment to service principal
Result: success
condition: selection
falsepositives:
- Administrators onboarding approved integrations; confirm a change record exists for each grant.
level: high
False positives
- Administrators onboarding approved integrations; confirm a change record exists for each grant.
Consent Granted to an Application in Entra ID
Detects a successful OAuth consent to an application, by a user or an administrator. Each event deserves a quick review of the application and the permissions it received; consent phishing relies on nobody looking.
title: Consent Granted to an Application in Entra ID
id: 922fb1b9-4a81-4b85-a62f-b7ac65863bdb
status: experimental
description: >-
Detects a successful OAuth consent to an application, by a user or an
administrator. Each event deserves a quick review of the application and the
permissions it received; consent phishing relies on nobody looking.
references:
- https://attack.mitre.org/techniques/T1528/
author: Forestall
date: 2026-11-10
tags:
- attack.credential-access
- attack.t1528
logsource:
product: azure
service: auditlogs
detection:
selection:
OperationName: Consent to application
Result: success
condition: selection
falsepositives:
- Users adopting approved SaaS applications; allow-list known application IDs after review.
level: medium
False positives
- Users adopting approved SaaS applications; allow-list known application IDs after review.
High-Privilege Delegated Permission Granted for All Users
Detects a delegated permission grant made on behalf of all users of the tenant (consent type AllPrincipals) whose scope includes a high-privilege permission. With such a grant the application can act with the rights of every user who signs in to it, for the granted scopes, and no user is asked again. Microsoft's security operations guide for applications rates this event as high risk and names the fields: the activity "Add delegated permission grant", DelegatedPermissionGrant.ConsentType with the value AllPrincipals and DelegatedPermissionGrant.Scope. Microsoft does not list which scopes count as high privilege. The list in this rule holds delegated permissions that write to the directory, to role assignments, to applications and their grants, to users, groups, authentication methods and Conditional Access, and that read or send mail or reach all files. Each name is in the Microsoft Graph permissions reference. Extend the list with the permissions you treat as sensitive.
title: High-Privilege Delegated Permission Granted for All Users
id: b20f5f06-6557-44ac-9e44-9acafc19bdc2
status: experimental
description: >-
Detects a delegated permission grant made on behalf of all users of the
tenant (consent type AllPrincipals) whose scope includes a high-privilege
permission. With such a grant the application can act with the rights of
every user who signs in to it, for the granted scopes, and no user is asked
again. Microsoft's security operations guide for applications rates this
event as high risk and names the fields: the activity "Add delegated
permission grant", DelegatedPermissionGrant.ConsentType with the value
AllPrincipals and DelegatedPermissionGrant.Scope. Microsoft does not list
which scopes count as high privilege. The list in this rule holds delegated
permissions that write to the directory, to role assignments, to
applications and their grants, to users, groups, authentication methods and
Conditional Access, and that read or send mail or reach all files. Each name
is in the Microsoft Graph permissions reference. Extend the list with the
permissions you treat as sensitive.
references:
- https://learn.microsoft.com/en-us/entra/architecture/security-operations-applications
- https://learn.microsoft.com/en-us/entra/identity/monitoring-health/reference-audit-activities
- https://learn.microsoft.com/en-us/graph/permissions-reference
- https://attack.mitre.org/techniques/T1528/
author: Forestall
date: 2026-11-18
tags:
- attack.credential-access
- attack.t1528
logsource:
product: azure
service: auditlogs
detection:
selection_activity:
OperationName: Add delegated permission grant
TargetResources|contains: AllPrincipals
selection_scope:
TargetResources|contains:
- Directory.ReadWrite.All
- Directory.AccessAsUser.All
- RoleManagement.ReadWrite.Directory
- AppRoleAssignment.ReadWrite.All
- Application.ReadWrite.All
- DelegatedPermissionGrant.ReadWrite.All
- User.ReadWrite.All
- Group.ReadWrite.All
- UserAuthenticationMethod.ReadWrite.All
- Policy.ReadWrite.ConditionalAccess
- Mail.Read
- Mail.Send
- Files.ReadWrite.All
- Sites.FullControl.All
- EWS.AccessAsUser.All
filter_failed:
Result: failure
condition: all of selection_* and not filter_failed
falsepositives:
- Administrators who grant tenant-wide admin consent to an approved application, such as a mail client, a backup product or an administration tool. Confirm a change record and the publisher of the application for each grant.
- Mail.Read also matches Mail.ReadWrite and Mail.ReadBasic, which is intended.
level: high
False positives
- Administrators who grant tenant-wide admin consent to an approved application, such as a mail client, a backup product or an administration tool. Confirm a change record and the publisher of the application for each grant.
- Mail.Read also matches Mail.ReadWrite and Mail.ReadBasic, which is intended.
User Consent Stopped by Risk-Based Step-Up Consent
Detects a consent attempt that Microsoft Entra ID stopped because it judged the request risky. Microsoft gives the example of a newly registered multitenant application that is not publisher verified and asks for permissions that are not basic: the user cannot consent and the request needs an administrator. No grant was made, so nothing has to be removed. The event still matters, because it says that a user was led to a consent prompt for such an application, which is how consent phishing starts. The same application may have been offered to other users. Microsoft documents the event as the activity "Consent to application" with a status reason, but its two pages give the reason differently: the security operations guide for applications writes Microsoft.online.Security.userConsentBlockedForRiskyAppsExceptions, and the page on risk-based step-up consent writes "Risky application detected". The rule matches either text in the ResultReason field.
title: User Consent Stopped by Risk-Based Step-Up Consent
id: 47351ab9-9b89-4c0c-9b96-1611754afa3d
status: experimental
description: >-
Detects a consent attempt that Microsoft Entra ID stopped because it judged
the request risky. Microsoft gives the example of a newly registered
multitenant application that is not publisher verified and asks for
permissions that are not basic: the user cannot consent and the request
needs an administrator. No grant was made, so nothing has to be removed. The
event still matters, because it says that a user was led to a consent prompt
for such an application, which is how consent phishing starts. The same
application may have been offered to other users. Microsoft documents the
event as the activity "Consent to application" with a status reason, but its
two pages give the reason differently: the security operations guide for
applications writes
Microsoft.online.Security.userConsentBlockedForRiskyAppsExceptions, and the
page on risk-based step-up consent writes "Risky application detected". The
rule matches either text in the ResultReason field.
references:
- https://learn.microsoft.com/en-us/entra/architecture/security-operations-applications
- https://learn.microsoft.com/en-us/entra/identity/enterprise-apps/configure-risk-based-step-up-consent
- https://attack.mitre.org/techniques/T1528/
author: Forestall
date: 2026-11-18
tags:
- attack.credential-access
- attack.t1528
logsource:
product: azure
service: auditlogs
detection:
selection:
OperationName: Consent to application
ResultReason|contains:
- userConsentBlockedForRiskyAppsExceptions
- Risky application detected
condition: selection
falsepositives:
- A user who tries a new but legitimate application from a publisher that is not verified. Check the application and its publisher, and have an administrator review the request if the application is needed.
level: medium
False positives
- A user who tries a new but legitimate application from a publisher that is not verified. Check the application and its publisher, and have an administrator review the request if the application is needed.
Detection logic
Patterns that need more than one event, a baseline or knowledge of your own environment. Each is a hypothesis to build and tune in your SIEM, not a ready rule.
Consent given by an account that was created shortly before
An attacker who can create users makes a fresh account and uses it to consent to an application they control, so that the grant does not sit on a known person. Consent by an account that is only hours or days old is rarely ordinary use when the permissions are broad.
- A user is created: audit activity
Add user, with the new account inTargetResources. - Within 7 days that account grants access:
Consent to application,Add delegated permission grantorAdd app role assignment to service principalwith the account inInitiatedBy. - Read the application and the permissions in
TargetResources, and check whether the application was added to the tenant in the same period.
EventsAdd userConsent to applicationAdd delegated permission grantAdd app role assignment to service principal
LimitsNew employees consent to the applications they need in their first days, so the hypothesis is strongest for administrator consent and for high-privilege permissions. The 7 days are a starting point.
Consent blocked as risky, then granted for the same application
A consent that Microsoft Entra ID stopped as risky shows that an application is being pushed to users. If consent to the same application succeeds afterwards, through another user or through an administrator who approved the request, the campaign reached its goal.
- A consent is stopped: activity
Consent to applicationwith a failure and the status reason of the risky application block. Keep the application fromTargetResources. - Within 14 days: a successful
Consent to applicationorAdd delegated permission grantfor the same application inTargetResources. - Check who granted it. An administrator who approved the request after the block should be able to name the reason.
EventsConsent to applicationAdd delegated permission grant
LimitsAn administrator who reviews a blocked request and approves a legitimate application produces the same sequence, which is the intended process. The 14 days are a starting point.
Newly consented application reads mail or files through Microsoft Graph
A consent grant becomes a breach when the application uses it. In consent phishing the application starts to read the user's mail or files through Microsoft Graph soon after the consent, from the attacker's infrastructure. The Microsoft Graph activity log records each request with the application, the user and the address, which the audit log does not.
- Audit log:
Consent to applicationwith the user inInitiatedByand the service principal inTargetResources. Look up the application (client) ID of that service principal. - Microsoft Graph activity log, the following 7 days: requests whose
AppIdis that application and whoseUserIdis the consenting user. - Keep the requests whose
RequestUrireads mail or files (paths under messages, mailFolders or drive), and readIPAddressandRequestMethod. - Alert when such requests come from an address outside your egress ranges, and raise the priority for an application that is new to the tenant.
EventsConsent to application
LimitsMany legitimate mail and file applications do exactly this from their vendor's cloud, so confirm the application first. The Microsoft Graph activity log has to be collected separately, and calls to Exchange or SharePoint APIs outside Microsoft Graph are not in it. The 7 days are a starting point.
Triage
- Open the consented application (TargetResources) and check its publisher, reply URLs and requested permissions.
- Identify who consented (InitiatedBy) and whether the sign-in that preceded it came from an expected location.
- If malicious, revoke the grants, disable the service principal and review the audit log for data the application accessed.
Response
Once the attack is confirmed:
- Disable sign-in for the service principal of the malicious application, so that it cannot obtain new tokens while you work.
- Revoke what was granted. Remove the delegated permission grants and the app role assignments of the application, for every user who consented and not only the first one found.
- Search the audit log for other consents to the same application ID, because a consent phishing message usually reaches several people.
- Review what the application accessed with the permissions it had, such as mail and files, and inform the people whose data was read.
- Confirm that no grant for the application remains and that its service principal stays disabled.
Mitigation
- Restrict user consent to verified publishers and low-risk permissions, and require the admin consent workflow for everything else.
- Review existing OAuth grants and app role assignments regularly; remove unused or unverified applications.
- Alert on admin consent and on application permissions that grant tenant-wide data access.
Frequently asked questions
Does resetting the user's password remove the application's access?
No. The tokens belong to the application and do not depend on the password, so a reset changes nothing. The access also does not depend on MFA. It ends when the consent grants are revoked and the service principal is disabled.
Why are there separate rules for consent and for application permissions?
One rule matches `Consent to application`, the consent a user or an administrator gives. Another matches `Add app role assignment to service principal`, an application permission. Application permissions such as Mail.Read or Files.Read.All give tenant-wide access with no signed-in user, which is why that rule is rated higher.
Is every consent event an attack?
No. Users adopt approved SaaS applications all the time. Check the publisher, the reply URLs and the requested permissions of the application, and add known application IDs to an allow list after review. Consent phishing relies on nobody looking at these events.
Does an account of ours have to be compromised first?
No. In an illicit consent grant the victim is tricked into approving an application the attacker registered, on a legitimate Microsoft sign-in page. No password is stolen. What decides whether the attack works is the user consent setting of the tenant, or an administrator who can be convinced to grant admin consent.
References
- MITRE ATT&CK T1528: Steal Application Access Token
- Detect and remediate illicit consent grants
- Configure how users consent to applications
- Microsoft Entra security operations guide for applications (delegated permission grants, consent stopped as risky)
- Microsoft Entra audit log activities (ApplicationManagement and UserManagement categories)
- MicrosoftGraphActivityLogs table reference