How it works
Applications in Microsoft Entra ID call Microsoft Graph in one of two ways. With delegated permissions they act for a signed-in user. With application permissions they act as themselves: the service principal authenticates with its own credential and receives an app-only token, and no user, MFA prompt or user-targeted Conditional Access policy is involved.
An application permission is an app role published by the Microsoft Graph service principal. Granting it creates an app role assignment with three identifiers: principalId (the client service principal that receives the permission), resourceId (the Microsoft Graph service principal in this tenant) and appRoleId (the permission). The permissions listed on an app registration are only what the developer asks for; the assignment on the service principal is what the tenant granted. The registration and the enterprise application share an application ID but are different objects, and grants attach to the latter.
Three Graph application permissions let their holder create authority instead of merely using it. Microsoft's permissions reference carries a caution on each:
| Permission | App role ID | What Microsoft says it allows | Path to the tenant |
|---|---|---|---|
RoleManagement.ReadWrite.Directory |
9e3f62cf-ca93-4989-b6ce-bf83c28f9fe8 |
Manage directory RBAC, including directory role membership and the PIM APIs. Can grant additional privileges to itself, other applications or any user | Assign Global Administrator to any principal |
AppRoleAssignment.ReadWrite.All |
06b708a9-e830-4db3-a914-8e69da51d44f |
Manage permission grants for application permissions to any API, including Microsoft Graph. Same caution | Grant itself RoleManagement.ReadWrite.Directory, then as above |
Application.ReadWrite.All |
1bfefb4e-e0b5-418b-a88f-73c46d2cc8e9 |
Create, update and delete applications and service principals; manage app role assignments except those exposed by Microsoft Graph. Credential management lets an application act as other entities | Add a credential to an application that holds one of the first two and sign in as it |
The escalation has two starting points.
The service principal already holds the permission. The attacker only needs a credential for it: a secret found in a repository or pipeline, a certificate on a server, or a credential added by someone who owns or administers the application. That step is on the application credential abuse page.
The attacker grants the permission. An identity that can create app role assignments for Microsoft Graph gives a dangerous permission to a service principal it controls. For Graph app roles, Microsoft lists Privileged Role Administrator as the least privileged directory role that can do this; an application can do it with AppRoleAssignment.ReadWrite.All. The grant shows up as "Add app role assignment to service principal", with or without a "Consent to application" record beside it.
The second form is also persistence. A service principal with a quiet name and a Graph permission that can assign roles is a way back into the tenant that doesn't depend on any user account, and one administrative consent decision can create several assignments at once.
Prerequisites
- A way to authenticate as a service principal: a client secret, a certificate with its private key, or a federated credential the attacker can satisfy.
- That service principal holds one of the three permissions above, or the attacker holds an identity that can grant one (Privileged Role Administrator, Global Administrator, or another application with
AppRoleAssignment.ReadWrite.All). - For the
Application.ReadWrite.Allpath: another application in the tenant that already holds a role-granting permission or a privileged directory role.
Attack steps
For authorized security testing and lab use only. Run these steps against systems you own or have written permission to assess.
The steps below are for an authorized assessment or a lab.
1. Find the service principals that matter
List every application permission granted on Microsoft Graph in the tenant. The Graph service principal is addressed by its well-known application ID:
az rest --method get \
--url "https://graph.microsoft.com/v1.0/servicePrincipals(appId='00000003-0000-0000-c000-000000000000')/appRoleAssignedTo"
Each entry has principalId, principalDisplayName and appRoleId. Match appRoleId against the three IDs in the table. Then look at who can control each of those service principals:
# Owners of the enterprise application and of its registration
az rest --method get --url "https://graph.microsoft.com/v1.0/servicePrincipals/<object id>/owners"
az rest --method get --url "https://graph.microsoft.com/v1.0/applications(appId='<app id>')/owners"
ROADrecon and AzureHound collect the same data in bulk; BloodHound draws the result as paths from a user to the role-granting permission.
2. Sign in as the service principal
az login --service-principal --username "<app id>" --password "<client secret>" \
--tenant "corp.example.com" --allow-no-subscriptions
3. With AppRoleAssignment.ReadWrite.All: grant a stronger permission to yourself
Create an app role assignment whose client is the attacker's own service principal, whose resource is the Microsoft Graph service principal, and whose role is RoleManagement.ReadWrite.Directory:
az rest --method post \
--url "https://graph.microsoft.com/v1.0/servicePrincipals/<own service principal object id>/appRoleAssignments" \
--body '{
"principalId": "<own service principal object id>",
"resourceId": "<Microsoft Graph service principal object id>",
"appRoleId": "9e3f62cf-ca93-4989-b6ce-bf83c28f9fe8"
}'
The same request with Microsoft Graph PowerShell:
$params = @{
principalId = "<own service principal object id>"
resourceId = "<Microsoft Graph service principal object id>"
appRoleId = "9e3f62cf-ca93-4989-b6ce-bf83c28f9fe8"
}
New-MgServicePrincipalAppRoleAssignment -ServicePrincipalId "<own service principal object id>" -BodyParameter $params
A 201 Created response returns the assignment. Permissions are read into the token when it is issued, so sign in again to get a token that contains the new role.
4. With RoleManagement.ReadWrite.Directory: assign a directory role
az rest --method post \
--url "https://graph.microsoft.com/v1.0/roleManagement/directory/roleAssignments" \
--body '{
"@odata.type": "#microsoft.graph.unifiedRoleAssignment",
"roleDefinitionId": "<Global Administrator role definition id>",
"principalId": "<object id of a user or service principal the attacker controls>",
"directoryScopeId": "/"
}'
The rest of this path is on the directory role assignment abuse page.
5. With Application.ReadWrite.All: borrow another application's permissions
This permission can't grant Microsoft Graph app roles. It can add a password or key credential to any application or service principal. The attacker adds a credential to the application found in step 1 that holds a role-granting permission, signs in as that application, and continues from step 3 or 4.
Impact
The attacker ends with a workload identity that can assign any directory role and grant itself any Graph permission: mail and files for every user through Mail.Read or Files.Read.All style permissions, directory writes, policy changes. Because the identity is an application, the access has no MFA, doesn't expire with a user's password, and survives the offboarding of every person involved. Unless someone reviews app role assignments on Microsoft Graph, it also doesn't appear in the places where administrators are usually listed.
OPSEC and artifacts
- Using an existing permission writes no directory change. If the service principal already holds the permission, the only traces of the attack are its sign-in and its Graph requests. Operators prefer this path and avoid creating grants.
- Service principal sign-ins are a separate log. They are in
AADServicePrincipalSignInLogs, not the user sign-in log, with the application, the resource and the source address. A workload that always signs in from one Azure region and now signs in from elsewhere is the signal. Operators run from the workload's own host when they can. - A grant is audited once. "Add app role assignment to service principal" names the client, the resource and the role. Operators grant to an existing, trusted-looking application so the record reads like routine integration work, and they choose a moment when deployments are happening.
- The permission name can hide. The audit record carries the app role's ID and value in modified properties. Reviewers who look only at the application name miss that the role is one of the three that matter.
- Graph activity logs show the use. When exported, they record each request with the service principal, the method, the URI, the response code and the roles in the token. A POST to
roleManagement/directory/roleAssignmentsorappRoleAssignmentsby an application is rare and specific. A denied write (403) is an attempt worth as much attention as a success. - Cleaning up leaves its own records. Removing the assignment or the credential afterwards writes removal events, and tokens issued before the removal stay valid until they expire.
Detection
- Grants of role-granting permissions. The privileged Graph application permission rules match Add app role assignment to service principal records whose role is one of the dangerous permissions. Correlate with Consent to application.
- New ways to authenticate as a privileged application. Service principal credential added and application owner added.
- What the application then does. Privileged directory role assigned where the initiator is an application.
- Microsoft's detections for workload identities, such as anomalous service principal activity, and the leaked service principal credentials rules.
Permission grants with the properties that changed:
AuditLogs
| where ActivityDisplayName in~ ("Add app role assignment to service principal", "Consent to application")
| mv-expand Target = TargetResources
| mv-expand Property = Target.modifiedProperties
| project ActivityDateTime, Id, ActivityDisplayName, Result, InitiatedBy,
TargetName = tostring(Target.displayName), TargetId = tostring(Target.id),
PropertyName = tostring(Property.displayName), NewValue = tostring(Property.newValue)
| order by ActivityDateTime asc
Writes to the role and permission APIs by applications, from exported Graph activity logs:
MicrosoftGraphActivityLogs
| where isnotempty(ServicePrincipalId) and RequestMethod in ("POST", "PATCH", "DELETE")
| where RequestUri has_any ("roleManagement/directory", "appRoleAssignments", "appRoleAssignedTo", "addPassword", "addKey")
| project TimeGenerated, AppId, ServicePrincipalId, RequestMethod, RequestUri, ResponseStatusCode, Roles, IPAddress, SignInActivityId
| order by TimeGenerated asc
SignInActivityId links a request to the sign-in that issued its token. When several grants could have authorized a request, the log shows that it succeeded, not which grant allowed it.
Mitigation
- Inventory the three permissions. List the app role assignments on Microsoft Graph and remove
RoleManagement.ReadWrite.Directory,AppRoleAssignment.ReadWrite.AllandApplication.ReadWrite.Allfrom every application whose purpose isn't identity administration. Prefer narrower permissions, such asApplication.ReadWrite.OwnedBy, which limits an application to the objects it owns. - Treat the remaining holders as Tier 0. No owners on the application or the service principal, credentials as certificates or federated credentials with short lifetimes and no client secrets, and an alert on every credential or owner change.
- Restrict who can grant. Keep Privileged Role Administrator and Global Administrator eligible through PIM with approval. Use an admin consent workflow so that requests for application permissions are reviewed by someone who understands what each one allows.
- Apply Conditional Access for workload identities to restrict privileged service principals to known network locations and to block on service principal risk.
- Prefer managed identities for Azure-hosted workloads, which have no credential to steal from a repository, and grant them the same narrow permissions.
- Verify remediation on the right object. Removing a permission from the registration's manifest doesn't revoke consent. Delete the app role assignment on the service principal, remove unknown credentials, and remember that tokens already issued remain valid until they expire.
- Export service principal sign-in logs, the audit log and Microsoft Graph activity logs to a workspace. Without the first and the last, the use of a stolen application credential can't be seen.
Detection rules for this attack
Log events to collect
FAQ
Which Microsoft Graph application permissions lead to Global Administrator?
RoleManagement.ReadWrite.Directory can assign any directory role directly. AppRoleAssignment.ReadWrite.All can grant any application permission, including RoleManagement.ReadWrite.Directory, to any service principal including itself. Application.ReadWrite.All can add a credential to any application and act as it, which reaches the same place when another application already holds one of the first two.
What is the difference between an application permission and a delegated permission?
A delegated permission lets an application act for a signed-in user and is limited by what that user can do. An application permission (an app role) lets the application act as itself, with no user and no MFA, across the whole tenant. Two permissions with the same name can exist in both forms. This page is about application permissions; delegated grants are covered under illicit consent grants.
Does removing a permission from the app registration revoke it?
No. The registration's list of required permissions is only a request. The grant is an app role assignment on the service principal in the tenant, and it stays until that assignment is deleted. After a clean-up, check the service principal's app role assignments, not the registration manifest.
Does Conditional Access or MFA apply to a service principal?
User policies and MFA don't apply. A service principal authenticates with a secret, a certificate or a federated credential and gets its permissions in an app-only token. Conditional Access for workload identities is a separate feature that can restrict service principals by location or risk.
References
- Microsoft Graph permissions reference (Microsoft Learn)
- Grant an appRoleAssignment to a service principal, Microsoft Graph v1.0 (Microsoft Learn)
- Create unifiedRoleAssignment, Microsoft Graph v1.0 (Microsoft Learn)
- Account Manipulation: Additional Cloud Roles, T1098.003 (MITRE ATT&CK)
- Use Alternate Authentication Material: Application Access Token, T1550.001 (MITRE ATT&CK)
- MicrosoftGraphActivityLogs table (Azure Monitor reference)
Techniques, tactics and threat groups: MITRE ATT&CK® Enterprise v20.1. © The MITRE Corporation. This work is reproduced and distributed with the permission of The MITRE Corporation. Last updated 2026-11-29.