How the attack works
An application permission for mail, such as Mail.Read granted in Microsoft Entra ID, covers every mailbox of the organization by default. Exchange Online has two ways to narrow that. The older one is the application access policy, which limits an app to the mailboxes of the members of one group. Its successor is RBAC for Applications, where an application role is assigned inside Exchange together with a resource scope: a management scope with a recipient filter, or an administrative unit. Organizations use these controls for integrations that only need a handful of mailboxes, for example a shared service desk mailbox.
The limit lives in Exchange, not in Microsoft Entra ID, and that is the weakness. An attacker who reaches Exchange administration does not have to grant anything new. Removing the application access policy returns an app to its unscoped Microsoft Entra permission. Changing the recipient filter of a management scope, or pointing a role assignment to another scope, widens what an app with an Exchange-side role can open. No permission is granted in Microsoft Entra ID in any of these cases, so the rules that watch application permission grants stay silent, and the app's sign-ins look the same as before.
Exchange Online writes these changes to the admin audit log, where the operation is the name of the cmdlet and the parameters are recorded with their names and values. The rules on this page read Remove-ApplicationAccessPolicy, Set-ManagementScope with a new recipient filter and Set-ManagementRoleAssignment with a new resource scope. Microsoft notes that application access policy changes can take more than an hour to take effect, and that a management scope cannot be removed while a role assignment still uses it, which is why the scope rule watches changes and not removals.
What an attacker needs
- Exchange administration rights. Microsoft names membership of the Organization Management role group, or the Exchange Administrator role in Microsoft Entra ID, for assigning application roles and their scopes.
- Control of an application that already holds a mail permission, or the ability to add a credential to one.
Impact
An application that was limited to a few mailboxes can read, change or send mail for every mailbox in the organization, without a user sign-in and without MFA. Because nothing was granted, a review of application permissions in Microsoft Entra ID shows the same picture as before the change.
Detection rules
Exchange Online Application Access Policy Removed
Detects Remove-ApplicationAccessPolicy in Exchange Online. An application access policy limits an app that holds a Microsoft Graph or Exchange Web Services mail permission to the mailboxes of one group, or denies it those mailboxes. Without the policy the permission granted in Microsoft Entra ID applies again as Microsoft describes it by default: to all mailboxes in the organization. Removing a policy therefore widens an application's mailbox access without any new grant. Microsoft calls the feature legacy and has replaced it with RBAC for Applications, so a removal can also be the last step of a planned migration. In an Exchange admin audit record the Operation is the name of the cmdlet and ObjectId is the object it changed. Requires Microsoft 365 audit logging and the Exchange records of the unified audit log in the SIEM.
title: Exchange Online Application Access Policy Removed
id: ca2d68eb-a7a5-4920-8b3c-b4f5403b2005
status: experimental
description: >-
Detects Remove-ApplicationAccessPolicy in Exchange Online. An application
access policy limits an app that holds a Microsoft Graph or Exchange Web
Services mail permission to the mailboxes of one group, or denies it those
mailboxes. Without the policy the permission granted in Microsoft Entra ID
applies again as Microsoft describes it by default: to all mailboxes in the
organization. Removing a policy therefore widens an application's mailbox
access without any new grant. Microsoft calls the feature legacy and has
replaced it with RBAC for Applications, so a removal can also be the last
step of a planned migration. In an Exchange admin audit record the Operation
is the name of the cmdlet and ObjectId is the object it changed. Requires
Microsoft 365 audit logging and the Exchange records of the unified audit
log in the SIEM.
references:
- https://learn.microsoft.com/en-us/exchange/permissions-exo/application-access-policies
- https://learn.microsoft.com/en-us/powershell/module/exchangepowershell/remove-applicationaccesspolicy
- https://learn.microsoft.com/en-us/office/office-365-management-api/office-365-management-activity-api-schema
- https://attack.mitre.org/techniques/T1098/003/
author: Forestall
date: 2026-11-18
tags:
- attack.persistence
- attack.privilege-escalation
- attack.t1098.003
logsource:
product: m365
service: exchange
detection:
selection:
Operation: Remove-ApplicationAccessPolicy
condition: selection
falsepositives:
- A planned move from application access policies to RBAC for Applications, in which the policy is removed after the scoped role is in place and the unscoped Microsoft Entra permission has been removed. Confirm that order with the owner of the integration.
- Cleanup of a policy for an application that no longer exists.
level: high
False positives
- A planned move from application access policies to RBAC for Applications, in which the policy is removed after the scoped role is in place and the unscoped Microsoft Entra permission has been removed. Confirm that order with the owner of the integration.
- Cleanup of a policy for an application that no longer exists.
Management Scope Filter or Role Assignment Scope Changed in Exchange Online
Detects two changes that alter which mailboxes an Exchange role assignment covers. Set-ManagementScope with the RecipientRestrictionFilter parameter changes the filter of an existing management scope, and with it the reach of every role assignment that uses the scope. Set-ManagementRoleAssignment with CustomResourceScope or RecipientAdministrativeUnitScope points an existing assignment to another scope. RBAC for Applications uses these scopes to limit an application role such as Application Mail.Read to some mailboxes, so either change can turn a narrowly scoped application into one that reads far more. The rule cannot tell whether the new value is wider or narrower, and management scopes also limit administrator roles, so compare the old and the new value and check which assignments use the scope. In an Exchange admin audit record the Operation is the name of the cmdlet and Parameters holds the names and values of its parameters. Requires Microsoft 365 audit logging and the Exchange records of the unified audit log in the SIEM.
title: Management Scope Filter or Role Assignment Scope Changed in Exchange Online
id: a876fb4d-acd7-405e-8061-fd9436e9c0ec
status: experimental
description: >-
Detects two changes that alter which mailboxes an Exchange role assignment
covers. Set-ManagementScope with the RecipientRestrictionFilter parameter
changes the filter of an existing management scope, and with it the reach of
every role assignment that uses the scope. Set-ManagementRoleAssignment with
CustomResourceScope or RecipientAdministrativeUnitScope points an existing
assignment to another scope. RBAC for Applications uses these scopes to
limit an application role such as Application Mail.Read to some mailboxes,
so either change can turn a narrowly scoped application into one that reads
far more. The rule cannot tell whether the new value is wider or narrower,
and management scopes also limit administrator roles, so compare the old and
the new value and check which assignments use the scope. In an Exchange
admin audit record the Operation is the name of the cmdlet and Parameters
holds the names and values of its parameters. Requires Microsoft 365 audit
logging and the Exchange records of the unified audit log in the SIEM.
references:
- https://learn.microsoft.com/en-us/exchange/permissions-exo/application-rbac
- https://learn.microsoft.com/en-us/powershell/module/exchangepowershell/set-managementscope
- https://learn.microsoft.com/en-us/powershell/module/exchangepowershell/set-managementroleassignment
- https://learn.microsoft.com/en-us/office/office-365-management-api/office-365-management-activity-api-schema
- https://attack.mitre.org/techniques/T1098/003/
author: Forestall
date: 2026-11-18
tags:
- attack.persistence
- attack.privilege-escalation
- attack.t1098.003
logsource:
product: m365
service: exchange
detection:
selection_scope_filter:
Operation: Set-ManagementScope
Parameters|contains: RecipientRestrictionFilter
selection_assignment_scope:
Operation: Set-ManagementRoleAssignment
Parameters|contains:
- CustomResourceScope
- RecipientAdministrativeUnitScope
condition: 1 of selection_*
falsepositives:
- Administrators who adjust a scope because an integration needs another mailbox, or because a department was reorganized. Confirm a change record and test the result with Test-ServicePrincipalAuthorization.
- Scope changes for administrator role assignments, which use the same cmdlets. Check which assignments the scope belongs to.
level: medium
False positives
- Administrators who adjust a scope because an integration needs another mailbox, or because a department was reorganized. Confirm a change record and test the result with Test-ServicePrincipalAuthorization.
- Scope changes for administrator role assignments, which use the same cmdlets. Check which assignments the scope belongs to.
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.
Management scope widened and narrowed again shortly after
An attacker who needs wider mailbox access only for one collection run changes the recipient filter of a scope, lets the application read, and puts the old filter back, so that a later review of the scope shows nothing. Two filter changes of the same scope within a short time are rarely administrative work.
- Exchange admin audit log:
OperationSet-ManagementScopewithRecipientRestrictionFilteramong theParameters. Keep the scope fromObjectIdand the filter value. - Within 24 hours: a second
Set-ManagementScoperecord with the sameObjectIdandRecipientRestrictionFilteramong theParameters. - Compare the filter values of the two records with the value before the first change. A return to the earlier value marks a temporary widening.
- Review what the applications that use the scope accessed between the two changes.
EventsSet-ManagementScope
LimitsAn administrator who corrects a mistake in a filter produces the same two records, so read the values. The 24 hours are a starting point. A scope that stays widened does not match and is covered by the single-event rule.
Scope removed or widened and a credential added to an application by the same actor
Widening the scope is only useful to someone who can sign in as the application. An actor who removes or widens an application's limit in Exchange and adds a credential to an application in Microsoft Entra ID within a short time is preparing an application for mail collection.
- Exchange admin audit log:
Remove-ApplicationAccessPolicy,Set-ManagementScopeorSet-ManagementRoleAssignment. Keep the actor fromUserId. - Microsoft Entra audit log, 24 hours before or after:
Add service principal credentialsorUpdate application - Certificates and secrets management, with the actor inInitiatedBy. - Join the two on the actor's user principal name, and read the application of the second event in
TargetResources.
EventsRemove-ApplicationAccessPolicySet-ManagementScopeSet-ManagementRoleAssignmentAdd service principal credentials
LimitsAn administrator who migrates an integration to RBAC for Applications removes the old policy and rotates the secret in the same change window. Confirm the migration. An attacker who uses two different identities for the two steps is not joined. The 24 hours are a starting point.
Triage
- Read the cmdlet (Operation), the object it changed (ObjectId), the parameters with their values (Parameters) and the actor (UserId).
- For a removed policy, find out which application it limited and whether that application still holds an unscoped mail permission in Microsoft Entra ID.
- For a changed scope, compare the new recipient filter with the old one and list the role assignments that use the scope. A filter that now matches all recipients needs an explanation.
- Check whether a credential was added to the application around the same time, and review its sign-ins and the mailboxes it accessed after the change.
- Confirm the change with the owner of the integration through a separate channel.
Response
Once the attack is confirmed:
- Restore the limit first. Create the application access policy again, or set the recipient filter or the role assignment scope back to its earlier value, and test the result.
- Remove the credentials of the application that you cannot account for, and disable its service principal if it was used after the change.
- Contain the identity that made the change. Revoke its sessions, reset its credentials and remove its Exchange administration rights.
- Find out which mailboxes the application accessed while the limit was gone, and handle their content as read. Notify the owners and replace what was sent by mail and can be reused.
- Review the Exchange admin audit log for the actor's other changes in the same period, such as role assignments, mailbox permissions and forwarding.
Mitigation
- Keep Organization Management and the Exchange Administrator role to a few accounts with phishing-resistant MFA, and give the role through PIM.
- Move mail integrations to RBAC for Applications with a resource scope and then remove the unscoped permission in Microsoft Entra ID. Microsoft warns that a scoped role in Exchange and an unscoped Microsoft Entra permission add up, which leaves no effective scoping.
- Keep an inventory of the application access policies, the management scopes used for applications and their recipient filters, and compare it with the tenant on a schedule.
- Test what each mail application can reach with
Test-ServicePrincipalAuthorizationafter every change to a scope. - Alert on every removal of an application access policy and every change to a scope that an application uses.
Frequently asked questions
Why do the rules for application permission grants not see this attack?
Because nothing is granted. The application keeps the permission it already had in Microsoft Entra ID or the role it already had in Exchange. Only the limit on which mailboxes it may reach is removed or widened, and that limit is an Exchange object. The change appears in the Exchange admin audit log and not among the Microsoft Entra permission grants.
Does removing an application access policy take effect at once?
Not always. Microsoft says that removals might take up to 30 minutes to go live and that changes to application access policies can take longer than an hour to take effect in Microsoft Graph calls. That delay is time to restore the policy before the application reaches further mailboxes.
Why is there no rule for a removed management scope?
Microsoft documents that a management scope cannot be removed while a management role assignment still uses it. An application's scope is therefore widened by changing its recipient filter, or by pointing the role assignment to another scope, and the rule on this page reads those two changes.
Are application access policies still supported?
Microsoft calls them a legacy feature that RBAC for Applications has replaced, and says new configurations should not use them. Existing policies still limit the Microsoft Entra permissions they were created for, so their removal still widens access and is worth an alert.
References
- MITRE ATT&CK T1098.003: Additional Cloud Roles
- Microsoft Learn: Role Based Access Control for Applications in Exchange Online
- Microsoft Learn: Application Access Policies (legacy)
- Microsoft Learn: Remove-ApplicationAccessPolicy
- Microsoft Learn: Set-ManagementScope
- Microsoft Learn: Remove-ManagementScope (a scope in use cannot be removed)
- Microsoft Learn: Set-ManagementRoleAssignment
- Microsoft Learn: Office 365 Management Activity API schema (Operation, ObjectId, Parameters, UserId)
- Microsoft Learn: Audit log activities (Exchange admin audit log)
- Microsoft Entra audit log activities (application credential activities)