OAuth application redirect URI modified
Description
Identifies modifications to OAuth application redirect URIs in Entra ID. Adding a redirect URI controlled by an attacker allows interception of OAuth authorization codes, enabling token theft from users who authenticate against the application.
Query · kql
let timeframe = 1d;
AuditLogs
| where TimeGenerated >= ago(timeframe)
| where OperationName =~ "Update application"
| where Result =~ "success"
| mv-expand ModProp = TargetResources[0].modifiedProperties
| where tostring(ModProp.displayName) =~ "ReplyUrls"
| extend OldReplyUrls = tostring(ModProp.oldValue)
| extend NewReplyUrls = tostring(ModProp.newValue)
| extend AppName = tostring(TargetResources[0].displayName)
| extend AppId = tostring(TargetResources[0].id)
| extend ActorUpn = tostring(InitiatedBy.user.userPrincipalName)
| extend ActorApp = tostring(InitiatedBy.app.displayName)
| extend ActorIp = iff(
isnotempty(tostring(InitiatedBy.user.ipAddress)),
tostring(InitiatedBy.user.ipAddress),
tostring(InitiatedBy.app.ipAddress))
| extend AccountName = iff(ActorUpn has "@",
tostring(split(ActorUpn, "@")[0]), "")
| extend AccountUPNSuffix = iff(ActorUpn has "@",
tostring(split(ActorUpn, "@")[1]), "")
| project
TimeGenerated,
AppName,
AppId,
OldReplyUrls,
NewReplyUrls,
ActorUpn,
ActorApp,
AccountName,
AccountUPNSuffix,
ActorIp,
CorrelationId
| sort by TimeGenerated desc