AD CS Certificate Template With Weak Access Control (ESC4)

Low-privileged users have write access to a certificate template and can reconfigure it to issue authentication certificates for any user.

SeverityHigh
CVSS 3.18.8 CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H Open in the calculator
CVSS 4.08.7 CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N Open in the calculator
CWECWE-732: Incorrect Permission Assignment for Critical Resource
OWASP Top 10A01:2025 Broken Access Control
MITRE ATT&CKT1649 Steal or Forge Authentication Certificates, T1550.003 Pass the Ticket
CategoryBroken Access Control

Description

The access control list of one or more certificate template objects in Active Directory gives low-privileged users rights that let them change the template. Templates are stored as objects under CN=Certificate Templates,CN=Public Key Services,CN=Services in the configuration partition, and Full Control, Write Owner, Write DACL or Write Property rights (on all properties or on settings such as msPKI-Certificate-Name-Flag and pKIExtendedKeyUsage), or ownership of the object, allow the holder to reconfigure it.

A user with such rights can turn a published template into a means of obtaining a certificate for any account. For example, they can make it vulnerable to ESC1 by enabling a requester-supplied subject and an authentication EKU and granting themselves enrolment, request a certificate for a domain administrator or other privileged account, and so take control of the domain. The certificate stays valid until it expires or is revoked. The change can be made and reverted within minutes, so the template may look normal at a later review, although the modification is recorded where directory service changes are audited and the issued certificate remains in the CA database.

It is documented as ESC4 in the Certified Pre-Owned research. Such rights usually result from delegating template management to a broad group, or from nested group membership that is wider than intended. Certipy, Certify, BloodHound and PingCastle identify these rights from the template security descriptors, which any domain user can read.

Remediation

  • Remove Full Control, Write Owner, Write DACL and Write Property rights on certificate templates from every principal other than the PKI administrators and built-in administrative groups, using the Security tab in the Certificate Templates console or ADSI Edit.
  • Check the owner of each template object and change it to an administrative group where it is an ordinary user or group.
  • Review the permissions of the related PKI objects as well (the Certificate Templates and Public Key Services containers, the CA objects and the NTAuthCertificates object), where similar rights also lead to compromise (ESC5).
  • Audit changes to these objects (Audit Directory Service Changes, event 5136, with a SACL on the Public Key Services container) and alert on template modifications.
  • Review the CA database for certificates issued while a template may have been altered, and revoke any that are not legitimate.

Confirm the fix by repeating the Certipy or BloodHound analysis as an ordinary user and checking that no template is reported as modifiable by low-privileged principals.

References


Add This Finding to Your Library

In Pental this write-up is in Settings, Library. Add to my library copies it into your own, rated in your firm's CVSS version, ready to put in your own words.

Free trial  ·  No card required

Only need the reporting? Our reporting tool is free and open source, with the same library.


More Active Directory Findings

Every Active Directory finding