AZ_MG_APPROLEASSIGNMENT_READWRITE_ALL
Summary
Forestall ACL Alias
AZ_MG_APPROLEASSIGNMENT_READWRITE_ALL
Entra ID (Azure AD) Alias
AppRoleAssignment.ReadWrite.All
Affected Object Types
Service Principals, Applications
Exploitation Certainty
Certain
Graph Permission / Role
Application Permission: AppRoleAssignment.ReadWrite.All
Description
AZ_MG_APPROLEASSIGNMENT_READWRITE_ALL represents a Microsoft Graph application permission that grants read and write access to application role assignments in Microsoft Entra ID (Azure AD). This is one of the most dangerous permissions because it allows:
Grant application permissions to any service principal for any API (including Microsoft Graph)
Remove application permissions from any service principal
Assign app roles to users, groups, and service principals for any application
Manage consent grants for application permissions across the tenant
This permission is often abused for:
Privilege escalation: Granting dangerous permissions like
RoleManagement.ReadWrite.DirectoryorApplication.ReadWrite.Allto an attacker-controlled service principalPersistence: Creating service principals with high-privilege permissions that persist beyond user sessions
Lateral movement: Granting permissions to access other APIs and applications in the tenant
Defense evasion: Removing permissions from security monitoring applications
Important: This is an application permission that requires admin consent and is granted to service principals, not individual users. Once granted, the service principal can perform these actions without additional user context.
Critical Warning: With AppRoleAssignment.ReadWrite.All, an application can grant itself or any other service principal any Microsoft Graph permission, including RoleManagement.ReadWrite.Directory (which can then assign Global Administrator). This creates a path to complete tenant takeover.
Key Difference from Application.ReadWrite.All: While Application.ReadWrite.All allows creating and modifying applications and service principals, AppRoleAssignment.ReadWrite.All specifically controls which permissions are granted to those applications. Both are dangerous, but AppRoleAssignment.ReadWrite.All is the key to granting dangerous permissions.
Identification
PowerShell
Find Service Principals with AppRoleAssignment.ReadWrite.All
Exploitation
An attacker with access to a service principal that has AppRoleAssignment.ReadWrite.All can grant any Microsoft Graph permission to any service principal, enabling privilege escalation.
Grant RoleManagement.ReadWrite.Directory to Attacker Service Principal

Grant Application.ReadWrite.All to Create Persistent Backdoor

Mitigation
Audit all service principals with
AppRoleAssignment.ReadWrite.Alland remove unnecessary grants.Go to Microsoft Entra ID -> App registrations -> select the application -> API permissions.
Remove the
AppRoleAssignment.ReadWrite.Allpermission if not required.
Apply least privilege: This permission should almost never be granted to applications.
Use more specific permissions when possible.
Use delegated permissions with user context when appropriate.
Monitor permission grant changes:
Review Microsoft Entra audit logs for app role assignment changes.
Configure Microsoft Defender for Cloud Apps to detect suspicious permission modifications.
Protect the permission grant process:
Require multiple approvals for granting this permission.
Document business justification for any application requiring this permission.
Implement Access Reviews for applications with high-privilege permissions:
Go to Identity Governance -> Access Reviews -> New access review.
Review applications with sensitive Graph permissions regularly.
Use Conditional Access to restrict service principal access:
Limit the locations and conditions under which service principals can authenticate.
Consider blocking service principals with this permission from non-trusted locations.
Detection
Use the Microsoft Entra admin center:
Open Microsoft Entra ID -> Audit logs.
Filter Activity for:
Add app role assignment to service principal
Remove app role assignment from service principal
Add app role assignment grant to user
Review Initiated by (actor), Target, Date, and Status for unexpected permission grants or removals.
Open the affected Enterprise application and review Permissions, Users and groups, and Owners.
Use Manage view -> Edit columns if any of those fields are hidden.
References
Last updated
Was this helpful?