ADCS ESC9: Find Certificate Templates That Leave Out the SID
ADCS ESC9 is a sign-in certificate template set to leave out the SID security extension. Without it, a domain controller can only match a certificate to an account by name. Anyone with the right access can change a name. Domain controllers on current updates reject those name-only matches for Kerberos. Anything still accepting them may let a certificate sign in as the wrong account. This post shows you how to find these templates, check whether your domain controllers still accept weak mappings and put the SID back.
| Priority | High. Certificates without a SID fall back to name matching wherever weak mappings are still accepted |
|---|---|
| What decides it | A published sign-in template with CT_FLAG_NO_SECURITY_EXTENSION (0x80000) set, no approval and broad enroll rights |
| Who's affected | Forests where the flag was set to avoid errors after the 2022 certificate changes, or by a vendor's setup guide |
| Fix | Clear the flag, give any account that needs it a strong explicit mapping and keep domain controllers on strong mapping |
Check it now: do any published sign-in templates leave out the SID?
Import-Module ActiveDirectory -ErrorAction Stop
$pks = "CN=Public Key Services,CN=Services,$((Get-ADRootDSE).configurationNamingContext)"
$published = Get-ADObject -SearchBase "CN=Enrollment Services,$pks" -LDAPFilter '(objectClass=pKIEnrollmentService)' -Properties certificateTemplates |
ForEach-Object { $_.certificateTemplates }
$auth = '1.3.6.1.5.5.7.3.2', '1.3.6.1.4.1.311.20.2.2', '1.3.6.1.5.2.3.4', '2.5.29.37.0'
# 0x80000 in msPKI-Enrollment-Flag is CT_FLAG_NO_SECURITY_EXTENSION
Get-ADObject -SearchBase "CN=Certificate Templates,$pks" -LDAPFilter '(msPKI-Enrollment-Flag:1.2.840.113556.1.4.803:=524288)' -Properties pKIExtendedKeyUsage |
Where-Object {
$_.Name -in $published -and
(-not $_.pKIExtendedKeyUsage -or @($_.pKIExtendedKeyUsage | Where-Object { $_ -in $auth }).Count -gt 0)
} | Select-Object NameRuns as any domain user with the ActiveDirectory module. It lists templates that are published on at least one CA, allow sign-in and have the no-security-extension flag set. No output means every published sign-in template includes the SID. The script further down shows who can enroll.
You checked one setting. The free scan checks the rest of your on-prem AD in a few minutes.
Nothing gets installed on your domain controllers. Only HTTPS leaves your network.
What ADCS ESC9 is
Since the May 2022 updates, enterprise CAs add a SID security extension to certificates from online templates. Microsoft's KB5014754 describes it. The extension holds the SID of the account the certificate was issued to. A domain controller uses it to tie the certificate to exactly one account, which is a strong mapping.
A template can turn that off. Microsoft's [MS-CRTD] specification defines CT_FLAG_NO_SECURITY_EXTENSION (0x80000 in msPKI-Enrollment-Flag) as the flag that "instructs the CA to not include the security extension" in issued certificates. KB5014754 says to consider setting it "only after" confirming the certificates aren't used for sign-in, or that they have other strong mappings.
A template is ESC9 when it has that flag, allows sign-in and broad groups can enroll. Without the SID, the only link between the certificate and an account is the name in it, usually the user principal name (UPN). Our weak certificate mappings post covers the mapping changes in detail.
Why ADCS ESC9 is dangerous
A name can be changed, a SID can't
Someone who can change another account's UPN and enroll as that account can make a certificate from an ESC9 template carry a different account's name. Because the certificate has no SID, anything that maps by name alone may treat it as that other account. Write access to an account's UPN is more common than it should be, through delegated help desk rights or broad permissions on user objects. MITRE ATT&CK tracks this as T1649, Steal or Forge Authentication Certificates.
Patched domain controllers block it for Kerberos
Domain controllers moved to Full Enforcement with the February 2025 update. KB5014754 says that from then on, "Authentication will be denied if a certificate cannot be strongly mapped." A certificate with no SID and no strong explicit mapping fails. However, the option to fall back to Compatibility mode remained until the September 9, 2025 update. A domain controller that missed those updates may still accept a name-only match.
Other paths may still read the name
Schannel, which handles certificate sign-in over TLS (for example LDAPS), has its own mapping setting. KB5014754 says its default changed from 0x1F to 0x18, which turns off the weak UPN mapping (0x4). If someone set it back, Schannel may still map by name. Other systems that trust your CA, such as VPN or Wi-Fi, may never have checked the SID. ESC9 also removes the safeguard that limits our ADCS ESC6 post's CA setting on that template.
Find ESC9 templates and weak mappings
Templates live in the forest's Configuration partition, so the template script covers the whole forest. The domain controller script covers the domain you run it in.
List ADCS ESC9 templates and who can enroll
This lists every sign-in template with the no-security-extension flag. For each one, it shows whether approval or an authorized signature is required, which CAs publish it and every account or group that can enroll.
Import-Module ActiveDirectory -ErrorAction Stop
$pks = "CN=Public Key Services,CN=Services,$((Get-ADRootDSE).configurationNamingContext)"
# Everyone, NETWORK, INTERACTIVE, Anonymous, Authenticated Users, This Organization, Users
$low = 'S-1-1-0', 'S-1-5-2', 'S-1-5-4', 'S-1-5-7', 'S-1-5-11', 'S-1-5-15', 'S-1-5-32-545'
# Domain Users, Domain Guests and Domain Computers of any domain
$lowRid = '^S-1-5-21-\d+-\d+-\d+-51[345]$'
$enroll = [guid]'0e10c968-78fb-11d2-90d4-00c04f79dc55'
$auth = '1.3.6.1.5.5.7.3.2', '1.3.6.1.4.1.311.20.2.2', '1.3.6.1.5.2.3.4', '2.5.29.37.0'
$cas = Get-ADObject -SearchBase "CN=Enrollment Services,$pks" -LDAPFilter '(objectClass=pKIEnrollmentService)' -Properties certificateTemplates
Get-ADObject -SearchBase "CN=Certificate Templates,$pks" -LDAPFilter '(msPKI-Enrollment-Flag:1.2.840.113556.1.4.803:=524288)' -Properties displayName, pKIExtendedKeyUsage, msPKI-Enrollment-Flag, msPKI-RA-Signature, nTSecurityDescriptor |
ForEach-Object {
$t = $_
$ekus = @($t.pKIExtendedKeyUsage)
if ($ekus.Count -gt 0 -and @($ekus | Where-Object { $_ -in $auth }).Count -eq 0) { return }
$enrollers = $t.nTSecurityDescriptor.GetAccessRules($true, $true, [System.Security.Principal.SecurityIdentifier]) |
Where-Object {
$_.AccessControlType -eq 'Allow' -and (
(($_.ActiveDirectoryRights -band [System.DirectoryServices.ActiveDirectoryRights]::GenericAll) -eq [System.DirectoryServices.ActiveDirectoryRights]::GenericAll) -or
((($_.ActiveDirectoryRights -band [System.DirectoryServices.ActiveDirectoryRights]::ExtendedRight) -ne 0) -and
($_.ObjectType -eq $enroll -or $_.ObjectType -eq [guid]::Empty)))
} |
ForEach-Object {
$sid = $_.IdentityReference
try { $name = $sid.Translate([System.Security.Principal.NTAccount]).Value } catch { $name = $sid.Value }
if ($sid.Value -in $low -or $sid.Value -match $lowRid) { "$name (low privilege)" } else { $name }
}
[pscustomobject]@{
Template = $t.Name
DisplayName = $t.displayName
Approval = [bool]($t.'msPKI-Enrollment-Flag' -band 2) -or [int]$t.'msPKI-RA-Signature' -gt 0
PublishedOn = ($cas | Where-Object { $_.certificateTemplates -contains $t.Name }).Name -join ', '
Enrollers = ($enrollers | Sort-Object -Unique) -join '; '
}
}What to look for: rows where Approval is False, PublishedOn isn't empty and Enrollers includes an entry marked (low privilege). Also check custom groups. A template only a handful of service accounts can enroll in is a much smaller risk, but it still needs a reason.
Check whether domain controllers still accept weak mappings
This reads two values from each domain controller over remote registry. It needs Domain Admins. Our ADCS ESC10 post covers this side in full, including the GPO that sets them.
# Run as a Domain Admin. Reads two registry values from each domain controller over remote registry.
Import-Module ActiveDirectory -ErrorAction Stop
foreach ($dc in Get-ADDomainController -Filter *) {
try {
$reg = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey('LocalMachine', $dc.HostName)
$kdc = $reg.OpenSubKey('SYSTEM\CurrentControlSet\Services\Kdc')
$sch = $reg.OpenSubKey('SYSTEM\CurrentControlSet\Control\SecurityProviders\Schannel')
$binding = if ($kdc) { $kdc.GetValue('StrongCertificateBindingEnforcement') }
$methods = if ($sch) { $sch.GetValue('CertificateMappingMethods') }
[pscustomobject]@{
DC = $dc.HostName
StrongCertificateBindingEnforcement = if ($null -eq $binding) { 'not set' } else { $binding }
SchannelMappingMethods = if ($null -eq $methods) { 'not set' } else { '0x{0:X}' -f $methods }
SchannelUpnMapping = if ($null -ne $methods) { [bool]($methods -band 0x4) } else { $false }
}
} catch {
[pscustomobject]@{ DC = $dc.HostName; StrongCertificateBindingEnforcement = "couldn't read"; SchannelMappingMethods = ''; SchannelUpnMapping = '' }
}
}What to look for:
StrongCertificateBindingEnforcementset to0or1. Those are Disabled and Compatibility mode. The April 2023 updates removed Disabled mode. KB5014754 says the value is no longer supported after the September 2025 update, so seeing it means the DC may be behind on updates.SchannelUpnMappingset toTrue. Schannel will still map certificates by UPN on that DC.not setfor both is normal on an up-to-date DC.
Check what the template already issued
Run this on the CA for each ESC9 template. It lists every certificate the CA issued from it.
# Run on the CA as a CA administrator or certificate manager, with the AD module installed.
# Replace UserNoSid with the template name from the script above.
Import-Module ActiveDirectory -ErrorAction Stop
$pks = "CN=Public Key Services,CN=Services,$((Get-ADRootDSE).configurationNamingContext)"
$t = Get-ADObject -SearchBase "CN=Certificate Templates,$pks" -LDAPFilter '(cn=UserNoSid)' -Properties msPKI-Cert-Template-OID
if (-not $t) { throw 'Template not found.' }
certutil -view -restrict "CertificateTemplate=$($t.'msPKI-Cert-Template-OID'),Disposition=20" -out 'RequestID,RequesterName,CommonName,NotBefore,SerialNumber' csvWhat to look for: requesters you don't expect, or one requester with certificates under several different names. Note the SerialNumber of anything you can't explain.
Check ADCS ESC9 with Insight Recon
The free scan includes Certificate Template Missing Security Extension in ADCS (ESC9), a High check. It lists every published template that has CT_FLAG_NO_SECURITY_EXTENSION set and allows sign-in, with no approval or authorized signature required. A broad group also has to hold Enroll, all extended rights or full control. Broad groups here are Everyone, Anonymous, Authenticated Users, NETWORK, INTERACTIVE, This Organization and Users. Domain Users, Domain Guests and Domain Computers from any domain count too. It also honors deny entries on the template. Owners and accounts that can only edit the template show up under ESC4 instead. The finding is Critical unless the scan proves every domain controller enforces strong mapping, with Schannel's UPN mapping off, in a forest with no other domain. The scan also has to read every CA and find none that publishes the template and lets requesters set a SAN (ESC6). For each template, the finding shows the groups and the rights they hold. It also comes with the Hacker Insight, remediation steps and compliance mappings.
Know what the ADCS ESC9 check doesn't decide
Some things are still yours to check. The check doesn't look for the attack's other half, someone who can change another account's UPN. Dangerous Control Over Privileged Objects, below, covers one way that happens. The check skips templates no CA publishes. If it can't read a CA's template list, it treats every template as published, so it may list one nobody can request right now. When unpublished templates would match, a note on the result says how many. They show up in the script above with an empty PublishedOn. It also doesn't count custom groups with many members, so check the Enrollers column yourself. It doesn't look at certificates already issued either, which the issued certificates script covers.
Related ADCS checks beyond ESC9
- Certificate Authority Disables SID Security Extension in ADCS (ESC16), the same gap for every template on a CA. Our ADCS ESC16 post covers it.
- Weak Certificate Mapping on Domain Controllers in ADCS (ESC10), whether your domain controllers still accept name-only mappings. Our ADCS ESC10 post covers it.
- Accounts with Weak Certificate Mappings, accounts still relying on weak explicit mappings. Our weak certificate mappings post covers both.
- Certificate Authority Allows Arbitrary SAN in ADCS (ESC6), which ESC9 makes worse. Our ADCS ESC6 post covers it.
- Dangerous Control Over Privileged Objects, one way someone ends up able to change another account's UPN.
You can see what the findings look like in our sample report. The full list is in our check library.
Find every template that leaves out the SID, plus the CA settings that make it worse.
It runs from any Windows machine that can reach your DCs, with a standard domain account. Every core AD check is free for one domain.
Before you put the SID back
Find out why the flag was set, then make sure those certificates still work with the SID included.
Find out why it was set
In most cases, someone set this flag on purpose. Common reasons are sign-in errors after the 2022 changes, certificates for accounts in another forest, or a vendor guide. Ask the template's owner which app uses it and whether its certificates are used for sign-in at all.
Give exceptions a strong mapping
If some accounts can't use the SID extension, KB5014754 offers explicit strong mappings in altSecurityIdentities. It lists X509IssuerSerialNumber (recommended), X509SKI and X509SHA1PublicKey as strong. Set those up for the accounts that need them first. Then the template no longer needs the flag.
Know what changes for existing certificates
Clearing the flag only affects certificates issued from then on. Existing certificates still have no SID until you renew them. If those certificates are used for sign-in, plan to reissue them, or revoke the ones you can't explain.
Fix ADCS ESC9 safely
1. Clear the flag
This clears CT_FLAG_NO_SECURITY_EXTENSION on one template and leaves every other bit as it was. It prints the current value first so you can put it back. It's a dry run with -WhatIf. Drop that to apply. It needs Enterprise Admins, or write rights on the template. Change UserNoSid to your template's name. To undo it, set msPKI-Enrollment-Flag back to the printed value.
# Dry run. Drop -WhatIf to apply.
# Needs Enterprise Admins, or write rights on the template object.
Import-Module ActiveDirectory -ErrorAction Stop
$pks = "CN=Public Key Services,CN=Services,$((Get-ADRootDSE).configurationNamingContext)"
$t = Get-ADObject -SearchBase "CN=Certificate Templates,$pks" -LDAPFilter '(cn=UserNoSid)' -Properties msPKI-Enrollment-Flag
if (-not $t) { throw 'Template not found.' }
$old = $t.'msPKI-Enrollment-Flag'
Write-Output ("Current msPKI-Enrollment-Flag: 0x{0:X}" -f $old)
# Clear 0x80000 (CT_FLAG_NO_SECURITY_EXTENSION) and leave every other bit as it is
Set-ADObject -Identity $t -Replace @{ 'msPKI-Enrollment-Flag' = ($old -band -bnot 0x80000) } -ErrorAction Stop -WhatIfIf the template doesn't need to allow sign-in at all, removing the sign-in EKUs on the Extensions tab in the Certificate Templates console is another way to close it. Narrowing who can enroll also shrinks the risk.
2. Keep domain controllers on strong mapping
Make sure every domain controller has the September 2025 updates or later. If SchannelUpnMapping was True, find out why someone re-enabled UPN mapping in Schannel before you set CertificateMappingMethods back to 0x18, KB5014754's default.
3. Reissue or revoke old certificates
Certificates already issued from the template still have no SID. Reissue the ones in use so they pick up the extension. Revoke any you can't explain with certutil -revoke, then publish a new CRL with certutil -crl.
4. Re-run the quick check
The template should no longer appear.
Keep ADCS ESC9 closed
- Watch template changes. Audit changes to the Certificate Templates container with Audit Directory Service Changes (event 5136). A template that gains the 0x80000 bit is how ESC9 comes back.
- Watch for weak mapping events. KB5014754 describes events on domain controllers for certificates that can't be strongly mapped. They show which certificates still rely on names.
- Limit who can change UPNs. Review delegated rights over user objects, especially for help desk groups.
- Re-run the scan. It flags the template again if the flag comes back.
ADCS ESC9 checklist
- Does every published sign-in template include the SID extension?
- Do accounts that can't use the extension have strong explicit mappings?
- Are all domain controllers on the September 2025 updates or later?
- Is UPN mapping off in Schannel on every domain controller?
- Did you reissue or revoke certificates issued without a SID?
- Are changes to certificate templates audited?
- Is the right to change UPNs limited to admins?
A "no" on the first and third questions means a certificate without a SID may still sign in as the wrong account.
Compliance mapping
| Framework | Reference | Why it applies |
|---|---|---|
| MITRE ATT&CK | T1649 | Steal or Forge Authentication Certificates. A certificate without a SID can be matched to the wrong account. |
| CIS Controls v8 | Control 4, Control 6 | Secure configuration of enterprise assets and access control management. Sign-in certificates should be bound to one account. |
| NIST CSF 2.0 | PR.AA-01, PR.AA-03 | These cover managing credentials and authenticating users and devices. A name-only mapping weakens both. |
ADCS ESC9 FAQ
What is ADCS ESC9?
A sign-in certificate template set to leave out the SID security extension. Systems can only match its certificates to an account by name.
Is ESC9 still a problem after Full Enforcement?
Less of one for Kerberos on up-to-date domain controllers. It still matters wherever weak mappings are accepted, such as Schannel with UPN mapping on or systems that only read the name. A CA that also has ESC6 opens it all the way, since the requester can put the victim's UPN and SID in the request.
Why would anyone set this flag?
Usually to stop sign-in errors after the 2022 changes, or for certificates used across forests. Strong explicit mappings solve that without the flag.
How is ESC9 different from ESC16?
ESC9 is one template leaving out the SID. ESC16 is a CA leaving it out of every certificate.
Does Insight Recon check for ADCS ESC9?
Yes. The free scan includes Certificate Template Missing Security Extension in ADCS (ESC9), along with the other ADCS checks.
See which of your templates leave out the SID.
It runs from any Windows machine that can reach your DCs, with a standard domain account. Every core AD check is free for one domain.
Not ready to scan?
AD Signal is our monthly look at what's changing in AD security and how real domains score. Read the latest report.
Related reading
References
- Microsoft Support: KB5014754, certificate-based authentication changes on domain controllers
- Microsoft Learn: [MS-CRTD] 2.26 msPKI-Enrollment-Flag
- Microsoft Learn: Event 5136, a directory service object was modified
- MITRE ATT&CK: T1649 Steal or Forge Authentication Certificates
- Microsoft Learn: certutil