1515This TRR covers the modification of Microsoft Entra ID federated domain trust
1616configuration to register an attacker-controlled token-signing certificate. The
1717modified trust enables the attacker's identity provider (IdP) to issue signed
18- identity tokens that Entra accepts as valid for any user in the tenant.
18+ identity tokens that Entra accepts as valid for users in the tenant.
1919
2020The technique operates entirely against Entra ID's cloud-side configuration. It
2121does not require compromise of any on-premises identity infrastructure (such as
2222AD FS), and the attacker's IdP is hosted on attacker-controlled infrastructure.
2323
2424The use of a valid signing certificate to generate a SAML token is referred to
25- as a 'Golden SAML' attack ([ T1606.002] ).[ ^ 1 ] This technique is one of the ways
26- an attacker can position themselves for a Golden SAML attack in an Azure tenant.
25+ as a 'Golden SAML' attack ([ T1606.002] , [ TRR0000] ).[ ^ 1 ] This technique is one of
26+ the ways an attacker can position themselves for a Golden SAML attack in an
27+ Azure tenant.
2728
2829This technique maps to two MITRE ATT&CK IDs:
2930
@@ -59,43 +60,52 @@ One can view custom and federated domains in an Entra tenant by using the
5960` Get-MgDomain ` and ` Get-MgDomainFederationConfiguration ` PowerShell cmdlets
6061(part of the Microsoft.Graph module).
6162
62- ### Per-domain Redirection, Tenant-wide Trust
63+ ### Federated Domain Configuration Object
6364
64- Federation in Entra has two distinct scopes that operate independently:
65+ When a federated domain is configured in Entra, an
66+ ` internalDomainFederation ` [ ^ 4 ] object is created that includes the following
67+ fields:
6568
66- #### Per-domain Sign-in Redirection
69+ - ` IssuerUri ` - identifier of the IdP. Must match the ` Issuer ` claim in
70+ tokens.
71+ - ` PassiveSignInUri ` / ` ActiveSignInUri ` - where Entra redirects
72+ users for interactive sign-in.
73+ - ` SignOutUri ` - where Entra redirects users on sign-out.
74+ - ` SigningCertificate ` - base64-encoded X.509 public certificate used to
75+ verify token signatures.
76+ - ` NextSigningCertificate ` - secondary certificate slot supporting
77+ certificate rollover. Tokens signed by this certificate are also accepted by
78+ Entra.
79+ - ` PreferredAuthenticationProtocol ` - ` wsfed ` or ` saml ` .
80+ - ` federatedIdpMfaBehavior ` - controls whether Entra accepts MFA claims
81+ from the federated IdP.
82+
83+ ### Federated Authentication
6784
6885When a user attempts an interactive sign-in with a UPN in a federated domain
69- (e.g., ` alice@contoso.com ` ), Entra redirects that user to the IdP configured for
70- ` contoso.com ` . Users in other domains within the same tenant are not redirected
71- to that IdP, they are redirected to whichever IdP their own domain is federated
72- with, or if their domain is ` Managed ` they authenticate against Entra directly.
73-
74- #### Tenant-wide Token Issuing Trust
75-
76- Once an IdP is registered as the federation provider for a domain in the tenant,
77- Entra will trust signed tokens from that IdP for any user in the tenant. When a
78- token is submitted to Entra, the signature is validated against the federation
79- configurations registered in the tenant - any registered IdP's certificate is
80- acceptable. The user is then identified by matching the token's ` NameId ` claim
81- to an ` ImmutableId ` in Entra, with no constraint that the user belong to the
82- federated domain the token came from.
83-
84- There is no check that links a token's issuing IdP to the domain of the user
85- being authenticated. The domain on the federation configuration controls only
86- * redirection during interactive sign-in* ; it does not constrain * which users the
87- IdP can vouch for* via direct token submission. An attacker who federates a
88- domain they own (e.g., ` attacker-evil-corp.com ` ) can forge tokens for any user
89- in that tenant even though the attacker's domain has no relationship to those
90- users.
91-
92- This includes:
93-
94- - Users in other federated domains (whose own domain federates to a different
95- IdP)
96- - Users in ` Managed ` (non-federated) domains
97- - Cloud-only users (` @<tenant>.onmicrosoft.com ` ) who have an ` ImmutableId `
98- - External / guest users who have an ` ImmutableId `
86+ (e.g., ` alice@contoso.com ` ), Entra redirects the user to the ` ActiveSignInUri `
87+ from the corresponding domain's configuration object to authenticate. The IdP
88+ authenticates the user, provides them with a token signed with the IdP's signing
89+ certificate, and redirects them back to Entra. For users in ` Managed ` domains,
90+ Entra handles the authentication directly.
91+
92+ It is also possible for the IdP to initiate an authentication flow for the user
93+ (as opposed to the user being redirected to the IdP from Entra). When a token is
94+ submitted to Entra, the token is validated via the following steps:
95+
96+ 1 . Parse the request
97+ 2 . Identify the federation realm by matching the token's ` Issuer ` against the
98+ ` IssuerUri ` values in all domain configuration objects across the tenant
99+ 3 . Validate the token signature against the public certificate in the
100+ matching federation configuration
101+ 4 . Validate the timestamp window (` NotBefore ` to ` NotOnOrAfter ` )
102+ 5 . Validate the audience (must be ` urn:federation:MicrosoftOnline ` )
103+ 6 . Resolve the user by matching the token's ` NameID ` against the ` ImmutableId `
104+ attributes on users in the tenant directory
105+ 7 . Verify that the domain in the user's UPN matches the federated domain.
106+
107+ Absent from the validation process is cross-checking the token's
108+ ` UserPrincipalName ` claim against the resolved user object.
99109
100110> [ !NOTE]
101111>
@@ -110,23 +120,25 @@ This includes:
110120> `Update-MgUser -UserId "user@yourdomain.com " -OnPremisesImmutableId
111121> "Base64StringValue=="`
112122
113- ### Federation configuration object
123+ #### A Note on Federated Authentication Scope
114124
115- A federated domain's configuration includes the following fields:
125+ Microsoft recently added an additional step in the federated token validation
126+ process.[ ^ 5 ] Step 7 above - cross-checking the federated domain's domain name
127+ against the user's UPN domain - was added in December 2025 and will be in force
128+ for all tenants by August 2026. Prior to this change, a federated domain's
129+ identity provider could issue tokens for * any* user in the tenant that had an
130+ ` ImmutableId ` , including cloud-only accounts, guest accounts, and users
131+ federated to another domain. The new default behavior significantly decreases
132+ the blast radius of this attack technique.
116133
117- - ` IssuerUri ` - identifier of the IdP. Must match the ` Issuer ` claim in
118- tokens.
119- - ` PassiveSignInUri ` / ` ActiveSignInUri ` - where Entra redirects
120- users for interactive sign-in.
121- - ` SignOutUri ` - where Entra redirects users on sign-out.
122- - ` SigningCertificate ` - base64-encoded X.509 public certificate used to
123- verify token signatures.
124- - ` NextSigningCertificate ` - secondary certificate slot supporting
125- certificate rollover. Tokens signed by this certificate are also accepted by
126- Entra.
127- - ` PreferredAuthenticationProtocol ` - ` wsfed ` or ` saml ` .
128- - ` federatedIdpMfaBehavior ` - controls whether Entra accepts MFA claims
129- from the federated IdP.
134+ While Microsoft strongly discourages it, tenant owners can exclude domains from
135+ this additional validation step by adding a ` federatedTokenValidationPolicy ` [ ^ 4 ]
136+ with ` rootDomains ` set to one of 3 possible values:
137+
138+ - all: UPN domain validation applied to all verified domains
139+ - enumerated: validation applied only to the listed domains
140+ - none: validation applied to no domains (the state prior to the Dec 2025
141+ update)
130142
131143### Domain lifecycle in Entra
132144
@@ -232,18 +244,20 @@ compromised). They publish the verification TXT or MX record at the DNS
232244authority for the domain and then invoke verification, which Entra confirms via
233245DNS query. With the domain verified, the attacker changes its authentication
234246type to 'Federated' and writes the federation configuration with their own
235- signing certificate, allowing them to generate tokens for all users in the
236- tenant.
247+ signing certificate, allowing them to generate tokens for users in the tenant.
237248
238249This procedure has the same terminal operation as Procedure A but adds three
239250preceeding operations - adding the domain, verifying it, and setting the
240251authentication type. (Publishing the DNS record needed to verify the domain
241252occurs at the attacker's DNS authority and is not observable from within the
242253victim's Entra tenant.)
243254
244- The new domain does not need to resemble or relate to any existing domain in the
245- tenant. Because federation trust is tenant-wide, an arbitrarily-named attacker
246- domain is sufficient to enable token forgery for any user in the tenant.
255+ > [ !NOTE]
256+ >
257+ > Following the August 2026 enforcement of user-to-domain validation, this procedure
258+ > has a much smaller blast radius than it had previously. An attacker performing
259+ > this procedure may also add a ` federatedTokenValidationPolicy ` to disable
260+ > validation for the domains they wish to target.
247261
248262#### Detection Data Model
249263
@@ -278,6 +292,8 @@ occurs at an external location and is not observable from within the tenant.
278292[ ^ 1 ] : [ Golden SAML Attack - CyberArk]
279293[ ^ 2 ] : [ Guidance On Recent Nation State Attacks (SolarWinds) - Microsoft]
280294[ ^ 3 ] : [ Octo Tempest - Microsoft]
295+ [ ^ 4 ] : [ internaldomainfederation - Microsoft Learn]
296+ [ ^ 5 ] : [ Changes to federatedTokenValidationPolicy - M365Admin]
281297
282298[ T1484.002 ] : https://attack.mitre.org/techniques/T1484/002/
283299[ T1556.007 ] : https://attack.mitre.org/techniques/T1556/007/
@@ -298,3 +314,4 @@ occurs at an external location and is not observable from within the tenant.
298314[ AADInternals FederatedIdentityTools - GitHub ] : https://github.com/Gerenios/AADInternals/blob/master/FederatedIdentityTools.ps1
299315[ Golden SAML Attack - CyberArk ] : https://www.cyberark.com/resources/threat-research-blog/golden-saml-newly-discovered-attack-technique-forges-authentication-to-cloud-apps
300316[ Guidance On Recent Nation State Attacks (SolarWinds) - Microsoft ] : https://www.microsoft.com/en-us/msrc/blog/2020/12/customer-guidance-on-recent-nation-state-cyber-attacks
317+ [ internaldomainfederation - Microsoft Learn ] : https://learn.microsoft.com/en-us/graph/api/resources/internaldomainfederation?view=graph-rest-1.0
0 commit comments