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

triangle-exclamation

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.

1

Add Malicious Redirect URI to Capture Tokens

2

Enumerate High-Value Targets

Mitigation

  • Audit all service principals with ServicePrincipalEndpoint.ReadWrite.All and remove unnecessary grants.

    • Go to Microsoft Entra ID -> App registrations -> select application -> API permissions.

    • Remove the ServicePrincipalEndpoint.ReadWrite.All permission 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?