How the attack works
When a certificate is used to sign in, the Key Distribution Center (KDC) on the domain controller has to decide which account the certificate belongs to. Before the May 10, 2022 updates it could decide by a name in the certificate, such as a user principal name or a DNS host name. Names are not permanent. Whoever controls an account can often change them, and a certificate enrolled while an account carried another account's name is then accepted as that other account. Microsoft fixed three flaws of this kind (CVE-2022-26923, CVE-2022-26931 and CVE-2022-34691) and described the change in KB5014754.
Since then Microsoft enterprise CAs add a security extension that holds the account's SID to certificates issued from online templates, and the KDC looks for a strong mapping. A strong mapping is that SID, or an explicit altSecurityIdentities mapping by issuer and serial number, by subject key identifier or by public key hash. Mappings by subject, by issuer and subject, or by email address are weak, because those values can be reused. Domain controllers enforce strong mapping by default since the February 2025 updates, and the September 9, 2025 updates removed the option to go back to Compatibility mode.
The domain controller records the cases that do not fit in its System log. Event 39 means a valid certificate could not be mapped in a strong way and had no SID extension. It is a warning in Compatibility mode, where the sign-in still succeeded, and an error under enforcement, where it was denied. Event 40, which is logged only in Compatibility mode, means the certificate was also issued before the account existed, so it was rejected. Event 41 means the SID in the certificate does not match the account it mapped to, so the certificate was issued to another account. The Security log shows the result from another side: event 4768 records the issuer, serial number and thumbprint of a certificate that was used to obtain a ticket-granting ticket. A rule on this page matches that event for the built-in Administrator account, which rarely signs in with a certificate. Another rule reads event 4657 for the registry values that weaken the mapping checks (StrongCertificateBindingEnforcement, CertificateBackdatingCompensation, AllowNtAuthPolicyBypass and the Schannel CertificateMappingMethods), which needs an auditing entry on those registry keys.
What an attacker needs
- A way to enroll a client authentication certificate that carries a chosen name. Examples are control of an account whose user principal name or DNS host name the attacker can change, or a certificate template or CA that leaves out the SID extension.
- A sign-in path that still maps certificates by name, such as a domain controller that is not in Full Enforcement mode, or a weak explicit mapping on the target account.
Impact
The attacker signs in as the account the name points to, which can be a domain administrator or a domain controller, without that account's password. The certificate keeps working after a password reset, until it expires or is revoked.
Detection rules
Built-in Administrator Obtained a Ticket-Granting Ticket With a Certificate
Detects a successful Kerberos authentication service request (4768) for the built-in Administrator account of a domain (an account SID that ends in -500) that was made with a certificate. The certificate fields of event 4768 are empty when the account signed in with its password, and the built-in Administrator is rarely enrolled for smart card or certificate sign-in. A certificate logon for it is what the last step of certificate impersonation looks like: a certificate that names or maps to the account was obtained through a weak mapping, a template that lets the requester choose the subject, or an explicit mapping written to the account, and is then used to get a ticket without the account's password. The rule matches on the SID, so a renamed Administrator account is covered, and tests the Certificate Thumbprint field for a hash value because the event carries an empty value when no certificate was used. The event also gives the issuer and serial number of the certificate, which identify it on the CA, and the client address. Other privileged accounts are not matched, because their names and SIDs differ in every domain. Requires Audit Kerberos Authentication Service.
title: Built-in Administrator Obtained a Ticket-Granting Ticket With a Certificate
id: f92d6af7-9fe7-41a9-8e71-0bae51ee7199
status: experimental
description: >-
Detects a successful Kerberos authentication service request (4768) for the
built-in Administrator account of a domain (an account SID that ends in
-500) that was made with a certificate. The certificate fields of event
4768 are empty when the account signed in with its password, and the
built-in Administrator is rarely enrolled for smart card or certificate
sign-in. A certificate logon for it is what the last step of certificate
impersonation looks like: a certificate that names or maps to the account
was obtained through a weak mapping, a template that lets the requester
choose the subject, or an explicit mapping written to the account, and is
then used to get a ticket without the account's password. The rule matches
on the SID, so a renamed Administrator account is covered, and tests the
Certificate Thumbprint field for a hash value because the event carries an
empty value when no certificate was used. The event also gives the issuer
and serial number of the certificate, which identify it on the CA, and the
client address. Other privileged accounts are not matched, because their
names and SIDs differ in every domain. Requires Audit Kerberos
Authentication Service.
references:
- https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-10/security/threat-protection/auditing/event-4768
- https://learn.microsoft.com/en-us/windows-server/identity/ad-ds/manage/understand-security-identifiers
- https://learn.microsoft.com/en-us/defender-for-identity/alerts-xdr
- https://attack.mitre.org/techniques/T1649/
author: Forestall
date: 2026-11-18
tags:
- attack.credential-access
- attack.t1649
logsource:
product: windows
service: security
detection:
selection:
EventID: 4768
Status: '0x0'
TargetSid|endswith: '-500'
CertThumbprint|re: '[0-9A-Fa-f]{40}'
condition: selection
falsepositives:
- A domain in which the built-in Administrator account is deliberately set up to sign in with a smart card or certificate. That is rare. Confirm the certificate by CertIssuerName and CertSerialNumber on your CA and exclude that issuer once verified.
level: high
False positives
- A domain in which the built-in Administrator account is deliberately set up to sign in with a smart card or certificate. That is rare. Confirm the certificate by CertIssuerName and CertSerialNumber on your CA and exclude that issuer once verified.
Certificate Mapping Enforcement Registry Value Changed
Detects a change to one of the registry values that decide how strictly certificates are mapped to accounts (event 4657). Microsoft documents four of them. StrongCertificateBindingEnforcement and CertificateBackdatingCompensation under the Kdc service key control the strong mapping check of the KDC (KB5014754), AllowNtAuthPolicyBypass under the same key controls the NTAuth store check (KB5057784), and CertificateMappingMethods under the Schannel key decides whether the weak subject, issuer and UPN mapping methods are accepted for TLS client certificates. Lowering any of them reopens sign-in with a certificate that only names an account. Updates from September and October 2025 no longer support the three KDC values, so on current domain controllers a write shows intent more than effect. CertificateMappingMethods has no announced end of support. The new data is in NewValue, the value name in ObjectValueName and the key in ObjectName. Requires Audit Registry and a SACL that audits Set Value on the Kdc service key and the Schannel key.
title: Certificate Mapping Enforcement Registry Value Changed
id: e3a72bc3-ea0a-4894-a75a-0546b0b3fad7
status: experimental
description: >-
Detects a change to one of the registry values that decide how strictly
certificates are mapped to accounts (event 4657). Microsoft documents four
of them. StrongCertificateBindingEnforcement and
CertificateBackdatingCompensation under the Kdc service key control the
strong mapping check of the KDC (KB5014754), AllowNtAuthPolicyBypass under
the same key controls the NTAuth store check (KB5057784), and
CertificateMappingMethods under the Schannel key decides whether the weak
subject, issuer and UPN mapping methods are accepted for TLS client
certificates. Lowering any of them reopens sign-in with a certificate that
only names an account. Updates from September and October 2025 no longer
support the three KDC values, so on current domain controllers a write
shows intent more than effect. CertificateMappingMethods has no announced
end of support. The new data is in NewValue, the value name in
ObjectValueName and the key in ObjectName. Requires Audit Registry and a
SACL that audits Set Value on the Kdc service key and the Schannel key.
references:
- https://support.microsoft.com/en-us/topic/kb5014754-certificate-based-authentication-changes-on-windows-domain-controllers-ad2c23b0-15d8-4340-a468-4d4f3b188f16
- https://support.microsoft.com/en-us/servicing/os/windows/docs/2025/03/protections-for-cve-2025-26647-kerberos-authentication
- https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-10/security/threat-protection/auditing/event-4657
- https://attack.mitre.org/techniques/T1649/
author: Forestall
date: 2026-11-18
tags:
- attack.credential-access
- attack.t1649
logsource:
product: windows
service: security
detection:
selection:
EventID: 4657
ObjectValueName:
- StrongCertificateBindingEnforcement
- CertificateBackdatingCompensation
- AllowNtAuthPolicyBypass
- CertificateMappingMethods
condition: selection
falsepositives:
- Administrators who set these values during the staged rollout of the certificate mapping changes, or who remove them once every domain controller is updated. Confirm the new data and that the change was planned.
- Servers other than domain controllers on which CertificateMappingMethods is set for an application that authenticates clients with certificates. Review the methods that were enabled.
level: high
False positives
- Administrators who set these values during the staged rollout of the certificate mapping changes, or who remove them once every domain controller is updated. Confirm the new data and that the change was planned.
- Servers other than domain controllers on which CertificateMappingMethods is set for an application that authenticates clients with certificates. Review the methods that were enabled.
KDC Refused a Certificate Whose SID Does Not Match the Account
Detects the event a domain controller writes to its System log when the SID in the security extension of a certificate differs from the SID of the account the certificate mapped to (41). Microsoft describes this as a certificate that was issued to another user, and the request fails. It is the direct trace of an attempt to sign in as one account with a certificate that was enrolled for a different one, for example after a name on the enrolling account was changed to match the target. The event lists both SIDs and the subject, issuer, serial number and thumbprint of the certificate. Microsoft's article names the event source Kdcsvc; the provider of KDC events in the System log is Microsoft-Windows-Kerberos-Key-Distribution-Center, and the rule accepts both names. The event exists on domain controllers with the May 10, 2022 or later updates. On Windows Server 2008 and 2008 R2 domain controllers event 41 has the meaning of event 39 (no strong mapping).
title: KDC Refused a Certificate Whose SID Does Not Match the Account
id: f1745edb-be0f-42b7-af96-a950d4a7127e
status: experimental
description: >-
Detects the event a domain controller writes to its System log when the SID
in the security extension of a certificate differs from the SID of the
account the certificate mapped to (41). Microsoft describes this as a
certificate that was issued to another user, and the request fails. It is the
direct trace of an attempt to sign in as one account with a certificate that
was enrolled for a different one, for example after a name on the enrolling
account was changed to match the target. The event lists both SIDs and the
subject, issuer, serial number and thumbprint of the certificate. Microsoft's
article names the event source Kdcsvc; the provider of KDC events in the
System log is Microsoft-Windows-Kerberos-Key-Distribution-Center, and the rule
accepts both names. The event exists on domain controllers with the May 10,
2022 or later updates. On Windows Server 2008 and 2008 R2 domain controllers
event 41 has the meaning of event 39 (no strong mapping).
references:
- https://attack.mitre.org/techniques/T1649/
- https://support.microsoft.com/en-us/topic/kb5014754-certificate-based-authentication-changes-on-windows-domain-controllers-ad2c23b0-15d8-4340-a468-4d4f3b188f16
author: Forestall
date: 2026-11-14
tags:
- attack.credential-access
- attack.t1649
logsource:
product: windows
service: system
detection:
selection:
Provider_Name|contains:
- Kerberos-Key-Distribution-Center
- Kdcsvc
EventID: 41
condition: selection
falsepositives:
- An account that was deleted and created again under the same name, while a certificate issued to the old account is still in use. Reissue the certificate.
- Windows Server 2008 and 2008 R2 domain controllers, where event 41 only means that the certificate has no strong mapping.
level: high
False positives
- An account that was deleted and created again under the same name, while a certificate issued to the old account is still in use. Reissue the certificate.
- Windows Server 2008 and 2008 R2 domain controllers, where event 41 only means that the certificate has no strong mapping.
KDC Found a Certificate Without a Strong Mapping
Detects the events a domain controller writes to its System log when a valid certificate used to sign in cannot be mapped to its account in a strong way and has no SID extension (39), or when such a certificate was also issued before the account existed and was rejected (40). In Compatibility mode event 39 is a warning and the sign-in succeeded; under enforcement it is an error and the sign-in was denied. A certificate that names an account without being bound to it is what certificate impersonation attacks rely on. Each event lists the user and the subject, issuer, serial number and thumbprint of the certificate. Microsoft's article names the event source Kdcsvc; the provider of KDC events in the System log is Microsoft-Windows-Kerberos-Key-Distribution-Center, and the rule accepts both names. The events exist on domain controllers with the May 10, 2022 or later updates. Windows Server 2008 and 2008 R2 domain controllers use other event IDs and are not covered.
title: KDC Found a Certificate Without a Strong Mapping
id: 2f64528c-7480-4d83-a7c6-ee13e63a9814
status: experimental
description: >-
Detects the events a domain controller writes to its System log when a valid
certificate used to sign in cannot be mapped to its account in a strong way
and has no SID extension (39), or when such a certificate was also issued
before the account existed and was rejected (40). In Compatibility mode event
39 is a warning and the sign-in succeeded; under enforcement it is an error
and the sign-in was denied. A certificate that names an account without being
bound to it is what certificate impersonation attacks rely on. Each event
lists the user and the subject, issuer, serial number and thumbprint of the
certificate. Microsoft's article names the event source Kdcsvc; the provider
of KDC events in the System log is
Microsoft-Windows-Kerberos-Key-Distribution-Center, and the rule accepts both
names. The events exist on domain controllers with the May 10, 2022 or later
updates. Windows Server 2008 and 2008 R2 domain controllers use other event
IDs and are not covered.
references:
- https://attack.mitre.org/techniques/T1649/
- https://support.microsoft.com/en-us/topic/kb5014754-certificate-based-authentication-changes-on-windows-domain-controllers-ad2c23b0-15d8-4340-a468-4d4f3b188f16
author: Forestall
date: 2026-11-14
tags:
- attack.credential-access
- attack.t1649
logsource:
product: windows
service: system
detection:
selection:
Provider_Name|contains:
- Kerberos-Key-Distribution-Center
- Kdcsvc
EventID:
- 39
- 40
condition: selection
falsepositives:
- Certificates issued before May 2022, from offline requests or by a non-Microsoft CA, which have no SID extension. Reissue them or add a strong explicit mapping to the account.
- Certificates from templates on which the SID extension was turned off. Turn it back on, or map the certificates explicitly.
level: medium
False positives
- Certificates issued before May 2022, from offline requests or by a non-Microsoft CA, which have no SID extension. Reissue them or add a strong explicit mapping to the account.
- Certificates from templates on which the SID extension was turned off. Turn it back on, or map the certificates explicitly.
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.
Privileged account requested a ticket-granting ticket with a certificate for the first time
Administrators who sign in with a password have empty certificate fields in their ticket requests. When a certificate that maps to such an account has been obtained through a weak mapping or an abused template, its first use is a ticket request that carries a certificate, often from a new issuer or address. A first certificate logon of a privileged account is worth a look whatever the mapping events say.
- Take your own list of privileged accounts: members of the administrative groups, domain controller accounts and service accounts with wide rights.
- Find event 4768 with result code 0x0 for one of them (
TargetUserNameorTargetSid) in whichCertThumbprintis not empty. - Compare
CertIssuerNameandCertThumbprintwith the certificate logons of that account in the last 90 days. No earlier certificate logon, a new thumbprint from a new issuer, or an issuer that is not one of your CAs raises the priority. - Look up the certificate on the CA by
CertSerialNumberto see who requested it and from which template, and readIpAddressfor the source of the request.
Events4768
LimitsAccounts that sign in with a smart card produce certificate logons every day, and a renewed certificate has a new thumbprint. The list of privileged accounts has to come from your own directory. The 90 days are a starting point. A certificate that is used over Schannel and not over Kerberos leaves no event 4768 and is not covered.
Triage
- Read the user, the certificate subject, issuer, serial number and thumbprint in the event. Find the certificate on the CA by its serial number to see who requested it, when and from which template.
- For event 41, compare the user's SID with the SID from the certificate. The certificate was issued to the account that owns the second SID, so find out why it was presented for a different account.
- For event 39, check whether the certificate comes from a CA or template that does not add the SID extension. If it does, reissue or map the certificate. If it should have had the extension, treat the certificate as suspect.
- Check whether the user principal name or DNS host name of the accounts involved was changed shortly before (events 4738 and 4742).
- If the certificate is not legitimate, revoke it. When event 39 was logged as a warning, the sign-in succeeded, so review what the account did afterwards.
Response
Once the attack is confirmed:
- Revoke the certificate on the CA that issued it, using the serial number from the event.
- Disable or reset the account that requested the certificate, and restore the user principal name or DNS host name that was changed for the request.
- Do not rely on a password reset of the impersonated account, because the certificate keeps working after it. Search the CA for other certificates from the same requester or template in that period and revoke those that are not legitimate.
- If the sign-in succeeded (event 39 as a warning), review everything the impersonated account did since. For a domain administrator or a domain controller account, handle it as a domain compromise.
- Remove the weak explicit mapping, or correct the template that left out the SID extension, so that the same request fails next time.
Mitigation
- Keep every domain controller on the September 9, 2025 or later updates, so that certificates without a strong mapping are refused and Compatibility mode cannot be turned back on.
- Reissue certificates that lack the SID extension, or map them explicitly to their account with a strong mapping (X509IssuerSerialNumber is the one Microsoft recommends).
- Replace weak explicit mappings in
altSecurityIdentities(X509IssuerSubject, X509SubjectOnly and X509RFC822) with strong ones. - Do not turn off the SID extension on certificate templates that can be used to sign in, and work with the vendor when certificates come from a non-Microsoft CA, which does not add the extension.
- Leave the Schannel
CertificateMappingMethodsvalue at its default, which keeps the weak subject, issuer and UPN mapping methods off.
Frequently asked questions
Why is resetting the password of the impersonated account not enough?
The attacker signs in with a certificate and not with the password. The certificate keeps working after a password reset, until it expires or is revoked. Revoke it on the issuing CA and find the request that produced it.
What is the difference between event 39 logged as a warning and as an error?
In Compatibility mode event 39 is a warning, and the sign-in with the weakly mapped certificate succeeded. Under enforcement it is an error, and the sign-in was denied. Domain controllers enforce strong mapping by default since the February 2025 updates, and the September 9, 2025 updates removed the option to go back to Compatibility mode.
Does every event 39 or 41 point to an attack?
No. Event 39 is common for certificates issued before May 2022, from offline requests, from a non-Microsoft CA or from templates on which the SID extension was turned off. Event 41 also appears when an account was deleted and created again under the same name while a certificate of the old account is still in use. Reissue or map those certificates and investigate the rest.
Which certificate mappings count as strong?
The SID of the account in the security extension of the certificate, or an explicit altSecurityIdentities mapping by issuer and serial number, by subject key identifier or by public key hash. Mappings by subject, by issuer and subject, or by email address are weak, because those values can be reused.
References
- MITRE ATT&CK T1649: Steal or Forge Authentication Certificates
- KB5014754: Certificate-based authentication changes on Windows domain controllers (KDC events 39, 40 and 41)
- Event 4768: A Kerberos authentication ticket (TGT) was requested
- Microsoft Security Response Center: CVE-2022-26923
- Intune SCEP certificate profiles: strong mapping requirements for KB5014754