How the attack works
Microsoft Entra Connect Sync and Cloud Sync tie every synchronized Active Directory user to its cloud user through the source anchor, which the cloud stores as the immutable ID (onPremisesImmutableId). When a new object arrives from Active Directory, Microsoft Entra ID first looks for an existing user whose immutable ID equals the incoming source anchor. If it finds one, synchronization takes over that user: the on-premises object becomes its source of authority and its properties are overwritten from Active Directory. Microsoft calls this a hard match. It exists so that an organization can join cloud accounts to the on-premises accounts of the same people.
The same mechanism can join the wrong pair. An attacker who controls Active Directory or the synchronization server prepares an on-premises account whose source anchor equals the immutable ID of a cloud account. An attacker with a user management role in the cloud can do the reverse and write the anchor of an on-premises account they control onto a cloud-only user. After the next synchronization cycle the cloud account is governed by the attacker's on-premises object, and with password hash synchronization its cloud password is overwritten as well. Microsoft describes the risk as account takeover via hard match abuse.
Since 1 July 2026 Microsoft Entra ID blocks a hard match when the target holds or is eligible for a privileged role, or is already mapped to an on-premises object (onPremisesObjectIdentifier is set). Other accounts can still be matched unless the tenant blocks hard match altogether. Microsoft extended the audit log for this: Update user events now show changes to OnPremisesObjectIdentifier and DirSyncEnabled, and Microsoft advises reviewing them. The source anchor itself appears in the same activity under the modified property SourceAnchor according to public detection content; Microsoft's reference does not name it. A third rule reads the activities Set DirSync feature and Set DirSyncEnabled flag, which Microsoft lists for changes to the synchronization features of the tenant, the hard match and soft match blocks among them, and for turning directory synchronization on.
What an attacker needs
- Control of Active Directory or of the server that runs synchronization, or a cloud identity that can write the on-premises attributes of users (User Administrator, Hybrid Identity Administrator, or an application with a Microsoft Graph permission to update users).
- A tenant that has not blocked hard match (
BlockCloudObjectTakeoverThroughHardMatchEnabledis not set). - A target account that the protections do not cover, which means no privileged role assignment or eligibility and no existing mapping to an on-premises object.
Impact
The attacker signs in as the cloud user with a password they chose and inherits the mailbox, files, group memberships and application access of that account. The account stays under the control of the on-premises object, so resetting its password in the cloud does not end the access. For an attacker who already controls Active Directory this is a way to move into cloud accounts that were never synchronized.
Detection rules
Directory Synchronization Feature or Tenant Sync Flag Changed
Detects a change to the directory synchronization features of the tenant or to the flag that turns directory synchronization on. Microsoft's audit activity reference lists both activities under Core Directory, category DirectoryManagement: "Set DirSync feature" and "Set DirSyncEnabled flag". The Purview audit reference describes the second as setting the property that enables a directory for Microsoft Entra ID Sync. The synchronization features of a tenant include the two blocks that stop account takeover through matching, BlockCloudObjectTakeoverThroughHardMatchEnabled and BlockSoftMatchEnabled, next to password hash synchronization and others. In a tenant that has set these blocks, one of them has to be switched off before an on-premises object can take over a cloud account, and in a cloud-only tenant directory synchronization has to be turned on first. The rule matches on the activity names only. Microsoft does not document the fields of these records, so the rule cannot tell which feature changed or whether it was switched on or off, and it is rated low for that reason. Read the modified properties in TargetResources, and compare the features of the tenant with what you expect.
title: Directory Synchronization Feature or Tenant Sync Flag Changed
id: e70dc77d-dce7-4cb6-bb26-487c9c5ecd57
status: experimental
description: >-
Detects a change to the directory synchronization features of the tenant or
to the flag that turns directory synchronization on. Microsoft's audit
activity reference lists both activities under Core Directory, category
DirectoryManagement: "Set DirSync feature" and "Set DirSyncEnabled flag".
The Purview audit reference describes the second as setting the property
that enables a directory for Microsoft Entra ID Sync. The synchronization
features of a tenant include the two blocks that stop account takeover
through matching, BlockCloudObjectTakeoverThroughHardMatchEnabled and
BlockSoftMatchEnabled, next to password hash synchronization and others.
In a tenant that has set these blocks, one of them has to be switched off
before an on-premises object can take over a cloud account, and in a
cloud-only tenant directory synchronization has to be turned on first. The
rule matches on the activity names only. Microsoft does
not document the fields of these records, so the rule cannot tell which
feature changed or whether it was switched on or off, and it is rated low
for that reason. Read the modified properties in TargetResources, and
compare the features of the tenant with what you expect.
references:
- https://learn.microsoft.com/en-us/entra/identity/monitoring-health/reference-audit-activities
- https://learn.microsoft.com/en-us/purview/audit-log-activities#directory-administration-activities
- https://learn.microsoft.com/en-us/entra/identity/hybrid/connect/how-to-connect-syncservice-features
- https://learn.microsoft.com/en-us/entra/identity/hybrid/connect/how-to-connect-install-existing-tenant
- https://attack.mitre.org/techniques/T1098/
author: Forestall
date: 2026-11-18
tags:
- attack.persistence
- attack.privilege-escalation
- attack.t1098
logsource:
product: azure
service: auditlogs
detection:
selection:
OperationName:
- Set DirSync feature
- Set DirSyncEnabled flag
filter_failed:
Result: failure
condition: selection and not filter_failed
falsepositives:
- Installation, upgrade or reconfiguration of Microsoft Entra Connect Sync or Cloud Sync, which sets synchronization features as part of its setup. Match the event to the change record of the hybrid identity team.
- Administrators who lift the hard match or soft match block for a planned matching procedure and set it again afterwards. Microsoft describes that procedure. Check that the block was set again.
level: low
False positives
- Installation, upgrade or reconfiguration of Microsoft Entra Connect Sync or Cloud Sync, which sets synchronization features as part of its setup. Match the event to the change record of the hybrid identity team.
- Administrators who lift the hard match or soft match block for a planned matching procedure and set it again afterwards. Microsoft describes that procedure. Check that the block was set again.
On-Premises Object Identifier of a User Changed
Detects an Update user event whose modified properties include OnPremisesObjectIdentifier, the value that records which on-premises object a cloud user is mapped to. Microsoft added this property to the audit log as part of its hardening against account takeover through hard match and advises reviewing these events. The value changes when a cloud user is matched to an on-premises object, when it is remapped to another one and when an administrator clears it.
title: On-Premises Object Identifier of a User Changed
id: 3a09f4be-1c1b-41f5-b81e-44e982826740
status: experimental
description: >-
Detects an Update user event whose modified properties include
OnPremisesObjectIdentifier, the value that records which on-premises
object a cloud user is mapped to. Microsoft added this property to the
audit log as part of its hardening against account takeover through hard
match and advises reviewing these events. The value changes when a cloud
user is matched to an on-premises object, when it is remapped to another
one and when an administrator clears it.
references:
- https://learn.microsoft.com/en-us/entra/fundamentals/whats-new-archive
- https://learn.microsoft.com/en-us/entra/identity/hybrid/connect/how-to-connect-install-existing-tenant
- https://learn.microsoft.com/en-us/entra/identity/monitoring-health/reference-audit-activities
- https://attack.mitre.org/techniques/T1098/
author: Forestall
date: 2026-11-14
tags:
- attack.persistence
- attack.privilege-escalation
- attack.t1098
logsource:
product: azure
service: auditlogs
detection:
selection:
OperationName: Update user
TargetResources|contains: OnPremisesObjectIdentifier
filter_failed:
Result: failure
condition: selection and not filter_failed
falsepositives:
- Planned matching of cloud accounts to on-premises accounts, migrations between forests or between Connect Sync and Cloud Sync, and administrators who clear the value to remap a user the way Microsoft documents. Match each event to a change record.
- Users synchronized for the first time, if your tenant records their first value as an update. Check the old value in the event; a value that replaces another one deserves the closest look.
level: medium
False positives
- Planned matching of cloud accounts to on-premises accounts, migrations between forests or between Connect Sync and Cloud Sync, and administrators who clear the value to remap a user the way Microsoft documents. Match each event to a change record.
- Users synchronized for the first time, if your tenant records their first value as an update. Check the old value in the event; a value that replaces another one deserves the closest look.
Source Anchor (Immutable ID) of a User Changed
Detects an Update user event whose modified properties include SourceAnchor, the audit log name of the immutable ID of a user (onPremisesImmutableId). Setting it on a cloud-only user prepares a hard match, after which directory synchronization takes over the account. The activity name is in the audit activity reference of Microsoft. The property name is not: it comes from public detection content, so confirm the shape of the event in your own tenant before relying on the rule.
title: Source Anchor (Immutable ID) of a User Changed
id: 78d4d2c4-0d4d-43cf-a752-66a67bb04120
status: experimental
description: >-
Detects an Update user event whose modified properties include
SourceAnchor, the audit log name of the immutable ID of a user
(onPremisesImmutableId). Setting it on a cloud-only user prepares a hard
match, after which directory synchronization takes over the account. The
activity name is in the audit activity reference of Microsoft. The property
name is not: it comes from public detection content, so confirm the shape
of the event in your own tenant before relying on the rule.
references:
- https://learn.microsoft.com/en-us/entra/identity/hybrid/connect/how-to-connect-install-existing-tenant
- https://learn.microsoft.com/en-us/entra/identity/monitoring-health/reference-audit-activities
- https://research.splunk.com/cloud/0c0badad-4536-4a84-a561-5ff760f3c00e/
- https://attack.mitre.org/techniques/T1098/
author: Forestall
date: 2026-11-14
tags:
- attack.persistence
- attack.privilege-escalation
- attack.t1098
logsource:
product: azure
service: auditlogs
detection:
selection:
OperationName: Update user
TargetResources|contains: SourceAnchor
filter_failed:
Result: failure
condition: selection and not filter_failed
falsepositives:
- Administrators who set the immutable ID to join a cloud account to the on-premises account of the same person, or who clear the on-premises attributes after synchronization was retired. Match each event to a change record.
- Directory synchronization stamping the anchor on users it matches or provisions. Compare the actor in InitiatedBy with your synchronization account and filter it only after you have reviewed which accounts it matched.
level: medium
False positives
- Administrators who set the immutable ID to join a cloud account to the on-premises account of the same person, or who clear the on-premises attributes after synchronization was retired. Match each event to a change record.
- Directory synchronization stamping the anchor on users it matches or provisions. Compare the actor in InitiatedBy with your synchronization account and filter it only after you have reviewed which accounts it matched.
Triage
- Identify the user whose mapping changed (TargetResources), read the old and the new value, and identify the actor (InitiatedBy). Was it the synchronization service or a person?
- Check whether a migration or a matching procedure was planned for that account, and whether the account has just become synchronized (DirSyncEnabled).
- Find the on-premises object that now owns the account and check who created or changed it, and when.
- Review the sign-ins of the account after the change for unfamiliar IP addresses, and the actor's other changes.
- If the match was not authorized, take the on-premises object out of synchronization, restore the account to its owner, reset its password, revoke its sessions and block hard match for the tenant.
Response
Once the attack is confirmed:
- Block sign-in for the affected cloud account and revoke its sessions while it is governed by the wrong on-premises object.
- Break the link. Take the on-premises object out of synchronization and restore the cloud account to its owner, so that Active Directory no longer overwrites its properties and its password.
- Reset the password of the cloud account only after the link is broken. Before that, password hash synchronization overwrites it again.
- Find where the match came from. If the on-premises object was prepared in Active Directory or on the synchronization server, treat that system as compromised. If a cloud identity wrote the anchor, revoke its sessions and remove its role.
- Review what was done as the user after the takeover, and check the audit log for other users whose
OnPremisesObjectIdentifieror source anchor changed in the same period.
Mitigation
- Block hard match and soft match for the tenant (
BlockCloudObjectTakeoverThroughHardMatchEnabled,BlockSoftMatchEnabled) and lift the block only for the duration of a planned matching procedure, as Microsoft advises. - Leave the bypass flag
AllowOnPremUpdateOfOnPremisesObjectIdentifierEnableddisabled. - Use cloud-only accounts for privileged roles, so that nothing on-premises decides who an administrator is.
- Treat Active Directory and every server that runs Microsoft Entra Connect Sync or a Cloud Sync agent as Tier 0.
- Keep the Hybrid Identity Administrator and User Administrator roles on few accounts protected with phishing-resistant MFA and Privileged Identity Management.
Frequently asked questions
Why does a password reset in the cloud not end the takeover?
After a hard match the cloud account is governed by the on-premises object of the attacker. With password hash synchronization the cloud password is overwritten from Active Directory, so a reset in the cloud does not last. The on-premises object has to be taken out of synchronization first.
Are administrator accounts still exposed to hard match?
Since 1 July 2026 Microsoft Entra ID blocks a hard match when the target holds or is eligible for a privileged role, or is already mapped to an on-premises object. Other accounts can still be matched unless the tenant blocks hard match altogether with `BlockCloudObjectTakeoverThroughHardMatchEnabled`.
Which of the two rules that read Update user rests on Microsoft's own documentation?
The rule on `OnPremisesObjectIdentifier`. Microsoft added that property to the audit log as part of its hardening and advises reviewing these events. The property name `SourceAnchor` comes from public detection content and is not in Microsoft's reference, so confirm the shape of that event in your own tenant.
What legitimate work changes these properties?
Planned matching of cloud accounts to the on-premises accounts of the same people, migrations between forests or between Connect Sync and Cloud Sync, and administrators who clear the on-premises attributes. Users synchronized for the first time may also appear. Match each event to a change record.
References
- MITRE ATT&CK T1098: Account Manipulation
- Configure Microsoft Entra Connect for an existing tenant (hard match, soft match and the hard match security protections)
- Archive for Microsoft Entra releases and announcements (December 2025, Microsoft Entra Connect security hardening to prevent user account takeover)
- Microsoft Entra Connect: Design concepts (sourceAnchor)
- Microsoft Entra Connect Sync service features and configuration
- Implement password hash synchronization with Microsoft Entra Connect Sync
- Protect Microsoft 365 from on-premises attacks
- Microsoft Entra audit log activities (Core Directory, Update user)
- Clear on-premises attributes from migrated Microsoft Entra ID users (roles that can update on-premises attributes)
- Splunk Security Content: Azure AD User ImmutableId Attribute Updated (source of the SourceAnchor property name)