How the attack works
A certificate identifies its holder through the subject and the subject alternative name (SAN). Normally the CA builds both from the requester's own Active Directory account. The CA policy flag EDITF_ATTRIBUTESUBJECTALTNAME2 changes that: with it turned on, a requester can pass a SAN as a request attribute (for example san:dns=...) and the CA puts it into the certificate, for every template, whether or not the template allows a subject supplied in the request. SAN request attributes are documented for adding DNS names to server certificates, which is the usual reason the flag was turned on.
If any template that is valid for authentication can be enrolled by ordinary users, an attacker requests a certificate with the UPN of a privileged account in the SAN attribute and then authenticates as that account (the ESC6 misconfiguration). With "Audit Certification Services" enabled and "Issue and manage certificate requests" selected in the CA's audit filter, the CA logs each request in event 4886 and each issued certificate in 4887, with the requester and the request attributes in the Attributes field. A SAN placed inside the request itself for a template that lets the enrollee supply the subject (ESC1) is not a request attribute and is not covered by this signal.
What an attacker needs
- An Enterprise CA with
EDITF_ATTRIBUTESUBJECTALTNAME2enabled, or the Manage CA right to enable it. - Enrollment rights on a published template whose certificates are valid for client authentication.
Impact
A certificate that authenticates as the account named in the SAN, up to a domain administrator or a domain controller, valid until it expires or is revoked and unaffected by a password reset of that account.
Detection rules
Certificate Request or Issuance with a SAN Request Attribute
Detects a certificate request received (4886) or a certificate issued (4887) by an AD CS certification authority whose request attributes include a subject alternative name (san:...). A CA only honors that attribute when EDITF_ATTRIBUTESUBJECTALTNAME2 is enabled, in which case any enrollee can name another account in the certificate (ESC6). Logged in the Security log of the CA server; requires Audit Certification Services and the "Issue and manage certificate requests" category in the CA's audit filter. A SAN carried inside the request for a template that lets the enrollee supply the subject (ESC1) is not matched.
title: Certificate Request or Issuance with a SAN Request Attribute
id: 00b2f559-e9f1-4990-b81c-fa08da794d65
status: experimental
description: >-
Detects a certificate request received (4886) or a certificate issued (4887)
by an AD CS certification authority whose request attributes include a subject
alternative name (san:...). A CA only honors that attribute when
EDITF_ATTRIBUTESUBJECTALTNAME2 is enabled, in which case any enrollee can name
another account in the certificate (ESC6). Logged in the Security log of the
CA server; requires Audit Certification Services and the "Issue and manage
certificate requests" category in the CA's audit filter. A SAN carried inside
the request for a template that lets the enrollee supply the subject (ESC1)
is not matched.
references:
- https://attack.mitre.org/techniques/T1649/
- https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-r2-and-2012/dn786423(v=ws.11)
- https://learn.microsoft.com/en-us/troubleshoot/windows-server/certificates-and-public-key-infrastructure-pki/add-san-to-secure-ldap-certificate
- https://learn.microsoft.com/en-us/defender-for-identity/security-posture-assessments/certificates
author: Forestall
date: 2026-11-11
tags:
- attack.credential-access
- attack.t1649
logsource:
product: windows
service: security
detection:
selection:
EventID:
- 4886
- 4887
Attributes|contains: 'SAN:'
condition: selection
falsepositives:
- Administrators who deliberately request server certificates with extra DNS names through request attributes. Confirm the requester and the names; a UPN in the attribute, or a requester that is not a PKI or server administrator, needs follow-up.
level: high
False positives
- Administrators who deliberately request server certificates with extra DNS names through request attributes. Confirm the requester and the names; a UPN in the attribute, or a requester that is not a PKI or server administrator, needs follow-up.
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.
Certificate issued with a SAN attribute that names another account, then used for a ticket as that account
The rule reports the request. The abuse is complete when the certificate is used: a ticket-granting ticket requested with a certificate for the account named in the SAN attribute, shortly after the CA issued the certificate to a different requester. Joining the issued certificate and that ticket request on the account name confirms the impersonation and gives the address it came from.
- The CA issues a certificate: event 4887 whose
Attributescontain a SAN attribute. KeepRequestId,Requesterand the account name the SAN attribute carries. - Keep the events in which
Requesterand the name in the SAN attribute are different accounts. - Within 24 hours, find on the domain controllers event 4768 with result code 0x0 for that account (
TargetUserName) in whichCertThumbprintis not empty. - Read
IpAddressandCertIssuerNameof the ticket request, and compare the address with the computer of the requester.
Events48874768
LimitsServer certificates that carry extra DNS names for the requesting server are not followed by a user ticket request and drop out at the third step. A certificate used over Schannel leaves no event 4768. Microsoft documents the content of event 4887 as message text, so check how your collector names the fields. The 24 hours are a starting point.
Triage
- Compare Requester with the name in the SAN attribute (Attributes). A user asking for a certificate that names a different user or a domain controller is the attack pattern.
- Use RequestId to find the request in the CA database, check the template and the issued certificate, and revoke the certificate if it was not expected.
- Look for a 4768 TGT request for the account named in the SAN with certificate pre-authentication (PreAuthType 16 or 15; CertIssuerName and CertSerialNumber identify the certificate).
- Check whether the flag was enabled recently (event 4891 on the CA) and by whom.
Response
Once the attack is confirmed:
- Turn off
EDITF_ATTRIBUTESUBJECTALTNAME2on the CA and restart the CA service at once, so that no further certificate of this kind is issued while the incident is handled. - Disable the account that made the request, and treat the account named in the SAN as used by the attacker from the moment the certificate was issued. A password reset of that account does not invalidate the certificate. Only revocation does.
- Extend the search beyond the alert. Go through the CA's 4886 and 4887 events back to the time the flag was enabled, and revoke every certificate whose requester and SAN attribute do not belong together.
- If the name in the SAN was a domain administrator or a domain controller and the certificate was used to sign in, respond as for a domain compromise.
- Remove the Manage CA right from every principal that is not a PKI administrator, and confirm that the flag stays off. A later change to it is reported by event 4891 on the CA.
Mitigation
- Turn off
EDITF_ATTRIBUTESUBJECTALTNAME2in the policy module EditFlags of every Enterprise CA and restart the CA service; use templates with a controlled subject for certificates that need extra names. - Restrict Manage CA to PKI administrators so the flag cannot be turned back on.
- Limit enrollment on authentication templates and require manager approval where the subject is not built from Active Directory.
- Enable "Audit Certification Services" on CA servers with the "Issue and manage certificate requests" audit filter category, and forward the CA's Security log.
Frequently asked questions
Does this rule also catch a SAN supplied inside the request (ESC1)?
No. The rule matches a subject alternative name passed as a request attribute, which the CA records in the Attributes field of events 4886 and 4887. Where a template lets the enrollee supply the subject, the name is inside the request itself and does not appear as an attribute, so that abuse is not covered by this rule.
Does a match mean the issued certificate really carries the requested name?
Not by itself. The rule sees the attribute in the request. The CA puts the name into the certificate only when `EDITF_ATTRIBUTESUBJECTALTNAME2` is enabled. Check the flag on the CA and look at the issued certificate through its RequestId before deciding how serious the event is. A request with a UPN in the attribute still shows what the requester was trying to do.
Will a password reset of the impersonated account stop the attacker?
No. The certificate authenticates as the account named in the SAN until it expires or is revoked, and a password reset does not affect it. Revoke the certificate on the CA, turn the flag off so that no new one can be requested, and then review what the account did.
References
- MITRE ATT&CK T1649: Steal or Forge Authentication Certificates
- Defender for Identity: Edit vulnerable Certificate Authority setting (ESC6)
- How to add a subject alternative name to a secure LDAP certificate (SAN request attributes)
- Securing PKI: Appendix A: Events to Monitor (4886, 4887)
- Event 4768: A Kerberos authentication ticket (TGT) was requested
- Audit Certification Services