CertificateAutoenrollment

Summary

FSProtect ACL Alias

CertificateAutoEnrollment

Affected Object Types

Certificate Templates

Exploitation Certainty

Certain

AD Permission Guid

a05b8cc2-17bc-4802-a710-e7c15ab866a2

Description

The CertificateAutoEnrollment permission allows accounts in an Active Directory Enterprise PKI to automatically request digital certificates from an Enterprise CA. Certificates are important for secure authentication and encrypted communications. They confirm identities, secure email, enable VPN access, and allow code signing. With automatic certificate enrollment, devices and users can obtain certificates that meet security requirements without manual intervention.

However, if certificate template permissions are misconfigured or are granted to untrusted accounts, serious security risks may result. Unauthorized users could obtain certificates without proper checks and use them to impersonate trusted services, intercept communications, sign malicious code, or decrypt sensitive data. This can enable attackers to bypass security controls, escalate privileges, and maintain persistence in the network.

How to trigger

The Certificate Auto-Enrollment mechanism is triggered by several events. Common triggers include the following:

You can configure this via: Computer/User Configuration > Policies > Windows Settings > Security Settings > Public Key Policies > Certificate Services Client – Auto-Enrollment

1. User logon

When a user logs on, the system checks for required certificates and automatically enrolls or renews them if necessary.

2. Computer startup

At startup, a domain-joined computer verifies its machine certificate status and initiates autoenrollment for any missing or expiring certificates.

3. Group Policy refresh

During a routine Group Policy refresh (approximately every 90 minutes), the system reviews certificate statuses and triggers autoenrollment as needed.

4. Certificate renewal period

When a certificate reaches its renewal threshold (for example, 80% of its validity period), autoenrollment renews it before expiration.

5. Certificate template configuration changes

Updates to certificate template settings cause clients to re-evaluate and, if necessary, enroll for certificates based on the new configuration.

6. Manual Group Policy update (gpupdate /force)

Running a forced Group Policy update immediately triggers the autoenrollment process to process any pending certificate enrollments or renewals.

Identification

Active Directory PowerShell

You can enumerate CertificateAutoEnrollment entries using the ActiveDirectory PowerShell module.

1. Find-CertificateAutoenrollment function

2. Scan all templates in the domain

3. Scan a specific template

4. To exclude default admin ACLs for better visibility

.NET Directory Services

By using PowerShell’s built-in .NET System.DirectoryServices APIs, you can enumerate CertificateAutoEnrollment entries without relying on external modules or additional dependencies.

1. Find-CertificateAutoenrollmentSimple function

2. Scan all certificate templates in the domain

3. Scan a specific template object

Certification Authority

1. Open Certification Authority (certsrv) on your Windows server.

2. Expand the CA name and right-click Certificate Templates.

3. Select Manage from the context menu.

4. In the Certificate Templates Console window, double-click the vulnerable Certificate Template.

5. In the Properties window, navigate to the Security tab.

6. In the Security Settings window, locate and select the relevant Access Control Entry (ACE) for the user or group you wish to configure.

7. In the permissions list, ensure the Autoenroll option is set appropriately (enable for trusted accounts, remove for untrusted accounts).

8. Click OK to save your changes and close the dialogs.

Exploitation

The CertificateAutoEnrollment permission is not a standalone vulnerability and cannot be exploited on its own. However, when combined with other attack vectors (for example, ESC1), it can be an enabler in a larger exploit chain by facilitating lateral movement or privilege escalation.

Mitigation

1. Open Certification Authority (certsrv) on your Windows server.

2. Expand the CA name and right-click Certificate Templates.

3. Select Manage from the context menu.

4. In the Certificate Templates Console window, double-click the vulnerable Certificate Template.

5. In the Properties window, navigate to the Security tab.

6. In the Security Settings window, locate and remove the Autoenroll permission from any untrusted or unnecessary user or group.

7. Click OK to save your changes and close the dialogs.

Detection

Adding new Access Control Entries to Active Directory objects changes the ntSecurityDescriptor attribute of those objects. These changes can be detected with Event IDs 5136 and 4662 to identify potentially risky or unauthorized modifications. Event ID 4886 indicates that a certificate request has been received by the Certification Authority, while Event ID 4887 confirms that the request has been approved and the certificate issued. These logs are important for monitoring certificate operations and maintaining security.

Event ID
Description
Fields/Attributes
References

5136

A directory service object was modified.

ntSecurityDescriptor

https://learn.microsoft.com/en-us/windows/security/threat-protection/auditing/event-5136

4662

An operation was performed on an object.

AccessList, AccessMask

https://learn.microsoft.com/en-us/windows/security/threat-protection/auditing/event-4662

4886

Certificate Services received a certificate request.

CertificateTemplate, Requester

https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-r2-and-2012/dn319076(v=ws.11)

4887

Certificate Services approved a certificate request and issued a certificate.

CertificateTemplate, Requester

https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-r2-and-2012/dn319076(v=ws.11)

References

Last updated

Was this helpful?