1. Resources
  2. Detection rules
  3. Golden SAML

Golden SAML detection rules

With the AD FS token-signing key an attacker forges SAML tokens for any user of every application that trusts the federation service. Reading the AD FS DKM key from Active Directory is the step that can be seen on a domain controller.

Platform
Active Directory
Severity
Critical
Log source
Windows Security event log
Last updated
Rule formats
Sigmaand queries for: SplunkMicrosoft SentinelIBM QRadar
What an attacker needs
The private key of the AD FS token-signing certificate, which by default takes read access to the DKM key in Active Directory and access to the AD FS configuration database.
Impact
The attacker can sign in to every application that trusts the federation service as any user, cloud tenant administrators included, and password resets do not help.
Response
Disable the account that read the DKM key, restrict access to the DKM container and the configuration database, then rotate the certificates with Microsoft's emergency procedure.
Mitigation
Keep the token-signing key in a hardware security module, and treat the AD FS servers, the AD FS service account and the configuration database as Tier 0.
Event ID
4662
Threat groups
None listed in MITRE ATT&CK for this technique

How the attack works

Active Directory Federation Services (AD FS) signs every token it issues with its token-signing certificate. Applications and cloud services that federate with AD FS, Microsoft Entra ID among them, accept a token that carries a valid signature. An attacker who holds the private key of that certificate can create tokens for any user, with any claims, without contacting AD FS or a domain controller and without knowing a password. Such a forged token is called Golden SAML, by analogy with the Golden Ticket.

In the default configuration AD FS generates the token-signing and token-decrypting certificates itself and stores them, encrypted, in the AD FS configuration database. The key that protects them is kept in Active Directory, in the Distributed Key Manager (DKM) container below CN=ADFS,CN=Microsoft,CN=Program Data in the domain. Whoever can read the DKM key and the configuration database can decrypt the signing key. The AD FS service account needs that access and domain administrators have it. A container with an overly permissive access control list gave it to others as well, which Microsoft addressed in 2026 with the hardening for CVE-2026-56155.

The forgery itself leaves nothing in Active Directory. What can be seen there is the step before it, the read of the DKM key, which is stored in the thumbnailPhoto attribute of a contact object in the DKM container. With an audit entry (SACL) on the AD FS container, the domain controller logs each read in event 4662. The AD FS service reads the key as part of its normal work, so the signal is a read by any other account.

What an attacker needs

  • The private key of the AD FS token-signing certificate. In the default configuration that takes read access to the DKM key in Active Directory (the AD FS service account, a domain administrator, or any principal a permissive container ACL lets in) and access to the AD FS configuration database.
  • The issuer name of the federation service and the identifier the application uses for the targeted user.

Impact

The attacker can sign in to every application that trusts the federation service as any user, administrators of the cloud tenant included, and the forged token can claim that multifactor authentication was performed. Password resets do not help, because no password is involved. Access lasts until the token-signing certificate has been replaced in a way that makes the relying parties drop the stolen one, or until the federation trust is removed.

Detection rules

AD FS DKM Key Read by an Account Other Than the Service Account

Detects a read (event 4662, Read Property 0x10) of the thumbnailPhoto attribute (schemaIDGUID 8d3bca50-1d7e-11d0-a081-00aa006c33ed) of a contact object (class GUID 5cb41ed0-0e4c-11d0-a286-00aa003049e2), which is where AD FS keeps its DKM key in Active Directory. With that key and the AD FS configuration database the token-signing key can be decrypted. The AD FS service reads the key in normal operation; the filter excludes accounts whose name ends in $, which covers a service that runs under a group managed service account as Microsoft recommends. A read made with that service account, or with a computer account, is therefore not detected. Requires Audit Directory Service Access and the audit entry Microsoft documents for the AD FS container (Everyone, Read all properties, this object and all descendant objects).

LevelHighStatusExperimentalLog sourceWindows Security event log
title: AD FS DKM Key Read by an Account Other Than the Service Account
id: e679010b-962d-4555-8daf-08f6f7fc4833
status: experimental
description: >-
  Detects a read (event 4662, Read Property 0x10) of the thumbnailPhoto
  attribute (schemaIDGUID 8d3bca50-1d7e-11d0-a081-00aa006c33ed) of a contact
  object (class GUID 5cb41ed0-0e4c-11d0-a286-00aa003049e2), which is where AD
  FS keeps its DKM key in Active Directory. With that key and the AD FS
  configuration database the token-signing key can be decrypted. The AD FS
  service reads the key in normal operation; the filter excludes accounts
  whose name ends in $, which covers a service that runs under a group managed
  service account as Microsoft recommends. A read made with that service
  account, or with a computer account, is therefore not detected. Requires
  Audit Directory Service Access and the audit entry Microsoft documents for
  the AD FS container (Everyone, Read all properties, this object and all
  descendant objects).
references:
  - https://attack.mitre.org/techniques/T1606/002/
  - https://learn.microsoft.com/en-us/defender-for-identity/alerts-mdi-classic
  - https://learn.microsoft.com/en-us/defender-for-identity/deploy/configure-windows-event-collection
  - https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-10/security/threat-protection/auditing/event-4662
  - https://learn.microsoft.com/en-us/windows/win32/adschema/a-thumbnailphoto
  - https://learn.microsoft.com/en-us/windows/win32/adschema/c-contact
  - https://github.com/Azure/Azure-Sentinel/blob/master/Detections/MultipleDataSources/ADFS-DKM-MasterKey-Export.yaml
author: Forestall
date: 2026-11-14
tags:
  - attack.credential-access
  - attack.t1606.002
logsource:
  product: windows
  service: security
detection:
  selection:
    EventID: 4662
    AccessMask: '0x10'
    ObjectType|contains: '5cb41ed0-0e4c-11d0-a286-00aa003049e2'
    Properties|contains: '8d3bca50-1d7e-11d0-a081-00aa006c33ed'
  filter_gmsa_and_computer_accounts:
    SubjectUserName|endswith: '$'
  condition: selection and not 1 of filter_*
falsepositives:
  - The AD FS service itself, where it runs under an ordinary domain user account instead of a group managed service account. Add a filter block with the exact SubjectUserName of that account.
  - Administrators who back up, restore or extend the AD FS farm. Match the event to a change record instead of excluding administrator accounts.
  - Reads of the photo of ordinary contact objects, if directory auditing also covers contacts outside the AD FS container. The event names the object only by its GUID (ObjectName), so restrict the rule to the GUIDs of the objects in your DKM container.
level: high

False positives

  • The AD FS service itself, where it runs under an ordinary domain user account instead of a group managed service account. Add a filter block with the exact SubjectUserName of that account.
  • Administrators who back up, restore or extend the AD FS farm. Match the event to a change record instead of excluding administrator accounts.
  • Reads of the photo of ordinary contact objects, if directory auditing also covers contacts outside the AD FS container. The event names the object only by its GUID (ObjectName), so restrict the rule to the GUIDs of the objects in your DKM container.

Detection logic

Patterns that need more than one event, a baseline or knowledge of your own environment. Each is a hypothesis to build and tune in your SIEM, not a ready rule.

Federated sign-in to Microsoft Entra ID with no matching token issuance on the AD FS servers

Detection hypothesisJoins two logs

A forged token never passes through AD FS, so the federation servers record no token issuance for it, while the service that accepts it logs a sign-in. Microsoft Entra ID marks sign-ins whose token came from AD FS with the token issuer type ADFederationServices. Such a sign-in for a user to whom no AD FS server issued a token in the minutes before points to a token made outside the farm.

  1. From the Microsoft Entra sign-in logs (SigninLogs), take successful sign-ins whose TokenIssuerType is ADFederationServices. Keep UserPrincipalName, IPAddress and the time.
  2. From every AD FS server, collect the token issuances: events 1200 (Application Token Success) and 1202 (Fresh Credential Validation Success) of the event source AD FS Auditing, or the AD FS sign-ins that Microsoft Entra Connect Health sends to the ADFSSignInLogs table.
  3. For each Entra sign-in, look for an AD FS record for the same user in the 10 minutes before it. A sign-in with none is the finding.
  4. Give priority to administrative accounts and to sign-ins from addresses that are not the organization's own.

Events12001202

LimitsAn AD FS server whose log is not collected makes real sign-ins look forged, so confirm that every farm member is collected. Events 1200 and 1202 hold their data as one XML document that Microsoft does not describe element by element, so check where the user appears in your own events, or use the Connect Health records. The 10 minutes are a starting point. Relying parties other than Entra ID need their own sign-in logs.

Triage

  • Identify the reader (SubjectUserName, SubjectLogonId) and use the logon ID to find the matching logon (4624) and its source address. The AD FS service account on an AD FS server is expected. The same account from any other host, or any other account, is not.
  • Ask whether an administrator was backing up, restoring or extending the AD FS farm at that time. Microsoft's AD FS Rapid Restore tool, for example, exports the DKM container.
  • Review the access control list of the DKM container and recent changes to it, and the AD FS Admin events 1132 and 1135 that report an insecure or corrected ACL.
  • Look for access to the AD FS configuration database from a host or account outside the farm around the same time. The DKM key is useful only together with that database.
  • Without a benign explanation, assume the token-signing key is exposed. Rotate the token-signing and token-decrypting certificates, revoke cloud sessions, and review federated sign-ins to cloud services for activity the users did not perform.

Response

Once the attack is confirmed:

  1. Disable the account that read the DKM key and isolate the host it came from. If the AD FS service account was used from a host outside the farm, replace the credentials of that account.
  2. Close the access first. Restrict the DKM container and the AD FS configuration database to the principals that need them, because new certificates protected by a key the attacker can still read can be decrypted in the same way.
  3. Rotate the certificates with Microsoft's emergency procedure and remove the old token-signing certificate. Send the new certificate to federation partners that cannot consume federation metadata, and replace the SSL certificates of the AD FS and Web Application Proxy servers as that procedure describes.
  4. Revoke the refresh tokens of the users in Microsoft Entra ID, so that sessions started with forged tokens end.
  5. Review the cloud tenant and the other relying parties for what a forged administrator sign-in may have left behind, such as new credentials on applications, new role assignments or changed federation settings.
  6. Confirm that Microsoft Entra ID and every other relying party trust only the new certificates.

Mitigation

  • Install the Windows security updates of October 13, 2026 or later on all AD FS servers. They bring the DKM container ACL to Microsoft's secure state (Domain Admins, Enterprise Admins, SYSTEM and the AD FS service account only). Check AD FS Admin events 1132 to 1137 for the result.
  • Keep the token-signing key in a hardware security module, so that it is not held in the configuration database.
  • Treat the AD FS servers, the AD FS service account and the configuration database as Tier 0. Run the service with a group managed service account and keep local administrators on the AD FS servers to a minimum.
  • Add the audit entry Microsoft documents for the AD FS container (Everyone, read and write all properties, this object and all descendant objects) and enable "Audit Directory Service Access" on domain controllers, so that reads of the DKM key are logged.
  • In Microsoft Entra ID, set federatedIdpMfaBehavior to rejectMfaByFederatedIdp for federated domains, so that a multifactor claim in a federated token is not accepted.
  • After a suspected theft, replace the token-signing certificate with Microsoft's emergency rotation procedure, which creates two new certificates so that Microsoft Entra ID stops trusting the old one.

Frequently asked questions

Why is the forged token itself not visible in Active Directory?

A Golden SAML token is created offline with the stolen signing key, without contacting AD FS or a domain controller. Nothing is written to Active Directory when it is made or used. The step that can be seen on a domain controller is the earlier read of the DKM key. The use of the token shows only in the sign-in records of the application that accepted it.

Does the rule detect a theft made with the AD FS service account?

No. The rule excludes accounts whose name ends in $, which covers a service that runs under a group managed service account. A read made with that account, or with a computer account, is not detected. Where the service runs under an ordinary user account, that account needs its own exclusion and becomes the same blind spot.

Is reading the DKM key enough to forge tokens?

No. The DKM key only decrypts. The token-signing certificate is stored, encrypted, in the AD FS configuration database, so the attacker also needs access to that database. Look for access to it from outside the farm around the time of the read. Where the signing key is kept in a hardware security module, it is not held in the database.

Do password resets or multifactor authentication stop a Golden SAML sign-in?

No. No password is involved, and the forged token can claim that multifactor authentication was performed. In Microsoft Entra ID, setting `federatedIdpMfaBehavior` to `rejectMfaByFederatedIdp` stops that claim from being accepted. The access itself ends only when the relying parties no longer trust the stolen token-signing certificate.

References

We respect your privacy

We use cookies to keep this site secure and working properly. With your permission, we also use optional cookies to understand usage and improve the experience. Cookie Policy

You can change your choice at any time.