|
4 | 4 |
|
5 | 5 | ## Basic Information |
6 | 6 |
|
7 | | -In **Exchange Hybrid** deployments, the on‑prem Exchange server shares a **service principal identity** with Exchange Online. If an attacker compromises the on‑prem Exchange server, they can often **export the hybrid certificate** (commonly marked exportable) and use it to request **client‑credentials tokens** as Exchange Online. |
| 7 | +In legacy Exchange Hybrid designs, the on-prem Exchange deployment could authenticate as the same Entra application identity used by Exchange Online. If an attacker compromised the Exchange server, extracted the hybrid certificate private key, and performed an OAuth client-credentials flow, they could obtain first-party tokens with Exchange Online privilege context. |
8 | 8 |
|
9 | | -This opens multiple pivot paths into Entra ID and other services. |
| 9 | +The practical risk was not limited to mailbox access. Because Exchange Online had broad back-end trust relationships, this identity could interact with additional Microsoft 365 services and, in older behavior, could be leveraged for deeper tenant compromise. |
10 | 10 |
|
11 | | -## Attack Paths |
| 11 | +## Attack Paths and Technical Flow |
12 | 12 |
|
13 | 13 | ### Modify Federation Configuration via Exchange |
14 | 14 |
|
15 | | -Exchange Hybrid can **write domain federation configuration**. This can be abused to: |
| 15 | +Exchange tokens historically had permissions to write domain/federation settings. From an attacker perspective, this enabled direct manipulation of federated domain trust data, including token-signing certificate lists and configuration flags that controlled MFA-claim acceptance from on-prem federation infrastructure. |
16 | 16 |
|
17 | | -- **Add a new token‑signing certificate** for a federated domain. |
18 | | -- **Relax MFA claims acceptance** for ADFS‑issued tokens. |
| 17 | +That means a compromised Exchange Hybrid server could be used to stage or reinforce ADFS-style impersonation by changing federation config from the cloud side, even when the attacker started only from on-prem Exchange compromise. |
19 | 18 |
|
20 | | -Once a malicious token‑signing cert is added (or MFA acceptance is loosened), an attacker can **forge ADFS tokens** and impersonate hybrid users in Entra ID. |
| 19 | +### ACS Actor Tokens and Service-to-Service Impersonation |
21 | 20 |
|
22 | | -### ACS Actor Tokens → Impersonate Any User |
| 21 | +Exchange's hybrid auth path used Access Control Service (ACS) actor tokens with `trustedfordelegation=true`. Those actor tokens were then embedded into a second, unsigned service token that carried the target user identity in an attacker-controlled section. Because the outer token was unsigned and the actor token delegated broadly, the caller could swap target users without re-authenticating. |
23 | 22 |
|
24 | | -Exchange can request **ACS actor tokens** that include **`trusted for delegation`**. Those tokens allow **service‑to‑service impersonation** across Exchange and other Microsoft 365 services. |
| 23 | +In practice, once the actor token was obtained, the attacker had a long-lived impersonation primitive (typically around 24 hours) that was difficult to revoke mid-lifetime. This enabled user impersonation across Exchange Online and SharePoint/OneDrive APIs, including high-value data exfiltration. |
25 | 24 |
|
26 | | -Impact: |
| 25 | +Historically, the same pattern also worked against `graph.windows.net` by building an impersonation token with the victim's `netId` value. That provided direct Entra administrative action as arbitrary users and enabled full-tenant takeover workflows (for example, creating a new Global Administrator account). |
27 | 26 |
|
28 | | -- **Impersonate any mailbox user** in Exchange Online. |
29 | | -- **Access SharePoint/OneDrive** as any user (Exchange uses those services under the hood). |
30 | | -- **Impersonate Entra ID users** via `graph.windows.net` by crafting tokens with the target **`netId`** parameter. |
| 27 | +## What No Longer Works |
31 | 28 |
|
32 | | -Technical notes from the talk: |
| 29 | +The `graph.windows.net` impersonation path via Exchange Hybrid actor tokens has been fixed. The old "Exchange to arbitrary Entra admin over Graph" chain should be considered removed for this specific token route. |
33 | 30 |
|
34 | | -- The actor token is **issued by ACS**, contains the **Exchange audience**, and has **`trusted for delegation`** set. |
35 | | -- The actor token is embedded into an **unsigned bearer token**, where the **target user** is placed in the unsigned portion. |
36 | | -- For `graph.windows.net`, the call requires a **`netId`** value for the impersonated user (distinct from UPN). Exchange can query this and reuse it in the crafted token. |
| 31 | +This is the most important correction when documenting the attack: keep the Exchange/SharePoint impersonation risk separate from the now-patched Graph impersonation escalation. |
37 | 32 |
|
38 | | -These actor tokens are **not subject to Conditional Access** and are typically valid for long periods (e.g., ~24 hours). With them, an attacker can perform **Entra ID admin actions** (e.g., create a Global Admin), resulting in full tenant compromise. |
| 33 | +## What Can Still Matter in Practice |
39 | 34 |
|
40 | | -### Detection Notes |
| 35 | +If an organization still runs an old or incomplete hybrid configuration with shared trust and exposed certificate material, Exchange/SharePoint impersonation impact can remain severe. The federation-configuration abuse angle can also remain relevant depending on tenant setup and migration state. |
41 | 36 |
|
42 | | -Entra audit logs may show **odd mixed identities** (the impersonated user UPN combined with **Exchange Online** as the display name), which can be a detection signal for this abuse path. |
| 37 | +Microsoft's long-term mitigation is splitting the on-prem and Exchange Online identities so the shared-service-principal trust path no longer exists. Environments that completed that migration materially reduce this attack surface. |
| 38 | + |
| 39 | +## Detection Notes |
| 40 | + |
| 41 | +When this technique is abused, audit events can show identity mismatches where the user principal name corresponds to an impersonated user while the display/source context points to Exchange Online activity. That mixed identity pattern is a high-value hunting signal, though defenders should baseline legitimate Exchange-admin workflows to reduce false positives. |
43 | 42 |
|
44 | 43 | ## References |
45 | 44 |
|
|
0 commit comments