AZ_MG_SERVICEPRINCIPALENDPOINT_READWRITE_ALL
Summary
FSProtect ACL Alias
AZ_MG_SERVICEPRINCIPALENDPOINT_READWRITE_ALL
Entra ID (Azure AD) Alias
ServicePrincipalEndpoint.ReadWrite.All
Affected Object Types
Service Principals, Applications
Exploitation Certainty
Certain
Graph Permission / Role
Application Permission: ServicePrincipalEndpoint.ReadWrite.All
Description
AZ_MG_SERVICEPRINCIPALENDPOINT_READWRITE_ALL represents a Microsoft Graph application permission that grants the ability to read and write service principal endpoints in Microsoft Entra ID (Azure AD).
Service principal endpoints define the URLs and configurations that applications use for authentication, token redemption, and other OAuth/OIDC operations. This permission allows:
Read all service principal endpoint configurations
Modify endpoint URLs including reply URLs and redirect URIs
Add new endpoints to existing service principals
Delete or modify authentication endpoints
Security Implications:
This permission is dangerous because an attacker can:
Redirect authentication flows: Modify redirect URIs to capture OAuth tokens and authorization codes.
Man-in-the-middle attacks: Inject attacker-controlled endpoints to intercept authentication traffic.
Token theft: Add malicious reply URLs to steal access tokens during OAuth flows.
Persistence: Add backdoor endpoints that remain even after credentials are rotated.
Important: This is an application permission that requires admin consent. It operates at the tenant level, affecting all service principals.
Identification
PowerShell
Find Service Principals with ServicePrincipalEndpoint.ReadWrite.All
List All Service Principal Endpoints
Exploitation
An attacker with ServicePrincipalEndpoint.ReadWrite.All can modify service principal endpoints to intercept authentication flows.
Mitigation
Audit all service principals with
ServicePrincipalEndpoint.ReadWrite.Alland remove unnecessary grants.Go to Microsoft Entra ID -> App registrations -> select application -> API permissions.
Remove the
ServicePrincipalEndpoint.ReadWrite.Allpermission if not required.
Monitor redirect URI changes on service principals:
Review audit logs for modifications to service principal configurations.
Alert on unexpected reply URL additions.
Implement strict reply URL policies:
Use exact match redirect URIs instead of wildcards.
Limit reply URLs to known, trusted domains.
Use Application.Read.All instead if only read access is needed.
Regular endpoint audits: Periodically review all service principal endpoints for unauthorized additions.
Detection
Detect endpoint modifications in Audit logs.
Go to Microsoft Entra ID -> Audit logs.
Filter by activities:
Update service principal
Update application
Monitor for:
Reply URL additions to service principals.
Endpoint changes outside of change management windows.
Addition of external or suspicious domains to redirect URIs.
Bulk endpoint modifications across multiple service principals.
References
https://learn.microsoft.com/en-us/graph/api/resources/serviceprincipal
https://learn.microsoft.com/en-us/graph/permissions-reference
https://learn.microsoft.com/en-us/azure/active-directory/develop/reply-url
https://learn.microsoft.com/en-us/entra/workload-id/workload-identities-overview
Last updated
Was this helpful?