1. Resources
  2. Detection rules
  3. Explicit Certificate Mapping Written to an Account (ESC14)

Explicit Certificate Mapping Written to an Account (ESC14) detection rules

The altSecurityIdentities attribute maps certificates to an account. An attacker who can write it maps a certificate they hold to the target and signs in as the target without its password. Event 5136 records the write.

Platform
Active Directory
Severity
High
Log source
Windows Security event log
Last updated
Rule formats
Sigmaand queries for: SplunkMicrosoft SentinelIBM QRadar
What an attacker needs
Write access to altSecurityIdentities on the target account, and any certificate with its private key from a CA that the forest trusts for authentication.
Impact
The attacker signs in as the target with the mapped certificate and without its password, and the access survives password resets of the target.
Response
Remove the mapping from the account, revoke the certificate it referred to, and disable or reset the account that wrote the mapping.
Mitigation
Remove write access to altSecurityIdentities from everyone who does not provision certificates, starting with privileged accounts and domain controllers.
Event ID
5136

How the attack works

When a certificate is used to sign in, the domain controller has to decide which account it belongs to. One way is an explicit mapping: an administrator writes a string that refers to a certificate into the altSecurityIdentities attribute of a user or computer. Microsoft documents six formats. Three are strong, because they refer to something that cannot be reused: issuer and serial number, subject key identifier, or the hash of the public key. Three are weak: issuer and subject, subject only, and an email address. Whoever holds a certificate that matches a mapping on an account can sign in as that account.

That makes write access to the attribute equal to control of the account, a path known as ESC14. An attacker who can write altSecurityIdentities on a target adds a mapping that refers to a certificate the attacker already holds, for example one that was properly issued to an account under their control, and then requests a ticket as the target with it. No password is reset and no group changes, and the target keeps working as before. The mapping stays valid after the target's password is changed. A weak mapping adds a second risk, because anyone who can obtain a certificate with the same subject or email address matches it.

The write is logged on a domain controller as event 5136 with the mapping string in AttributeValue, if an auditing entry (SACL) covers writes to the attribute on user and computer objects. This page differs from Certificate Authentication With a Weak or Mismatched Mapping, whose KDC events 39 to 41 report certificates that lack a strong binding at sign-in. A strong explicit mapping is a binding the KDC accepts, so a sign-in through a mapping written by an attacker raises none of them. It also differs from the certificate request pages (ESC4, ESC6), because the certificate here can be an ordinary one.

What an attacker needs

  • Write access to altSecurityIdentities on the target user or computer, for example through GenericAll or GenericWrite on the object or a write permission on the attribute.
  • A certificate with its private key from a certification authority that the forest trusts for authentication. A certificate that was legitimately issued to an account the attacker controls is enough.

Impact

The attacker signs in as the target with the mapped certificate and without the target's password. For a domain administrator or the account of a domain controller that is control of the domain. The access lasts as long as the mapping exists and the certificate is valid, and it survives password resets of the target.

Detection rules

Explicit Certificate Mapping Added to an Account

Detects a value added to altSecurityIdentities (event 5136, Value Added). The attribute holds mappings of X.509 certificates, or of external Kerberos accounts, to the account for the purpose of authentication. Whoever holds a certificate that matches a mapping can sign in as the account, so a principal with write access to the attribute takes the account over by mapping a certificate it already holds. The mapping string is in AttributeValue and the account in ObjectDN. Few systems write this attribute: smart card and certificate provisioning, and administrators who map certificates without a SID extension. Give priority to privileged accounts and the accounts of domain controllers, which the rule cannot tell from other accounts. Requires Audit Directory Service Changes and a SACL that audits writes to altSecurityIdentities on user and computer objects.

LevelMediumStatusExperimentalLog sourceWindows Security event log
title: Explicit Certificate Mapping Added to an Account
id: 04580f77-2525-4954-9030-2a9be3cfef95
status: experimental
description: >-
  Detects a value added to altSecurityIdentities (event 5136, Value Added).
  The attribute holds mappings of X.509 certificates, or of external Kerberos
  accounts, to the account for the purpose of authentication. Whoever holds a
  certificate that matches a mapping can sign in as the account, so a
  principal with write access to the attribute takes the account over by
  mapping a certificate it already holds. The mapping string is in
  AttributeValue and the account in ObjectDN. Few systems write this
  attribute: smart card and certificate provisioning, and administrators who
  map certificates without a SID extension. Give priority to privileged
  accounts and the accounts of domain controllers, which the rule cannot tell
  from other accounts. Requires Audit Directory Service Changes and a SACL
  that audits writes to altSecurityIdentities on user and computer objects.
references:
  - https://learn.microsoft.com/en-us/windows/win32/adschema/a-altsecurityidentities
  - https://support.microsoft.com/en-us/topic/kb5014754-certificate-based-authentication-changes-on-windows-domain-controllers-ad2c23b0-15d8-4340-a468-4d4f3b188f16
  - https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-10/security/threat-protection/auditing/event-5136
  - https://attack.mitre.org/techniques/T1649/
author: Forestall
date: 2026-11-18
tags:
  - attack.credential-access
  - attack.t1649
logsource:
  product: windows
  service: security
detection:
  selection:
    EventID: 5136
    AttributeLDAPDisplayName: altSecurityIdentities
    OperationType:
      - '%%14674'
      - 'Value Added'
  condition: selection
falsepositives:
  - Smart card, certificate and identity management systems that provision explicit mappings, and administrators who map certificates that cannot be reissued with the SID extension. Document these writers and exclude them by SubjectUserName. A write by any other account needs a look.
level: medium

False positives

  • Smart card, certificate and identity management systems that provision explicit mappings, and administrators who map certificates that cannot be reissued with the SID extension. Document these writers and exclude them by SubjectUserName. A write by any other account needs a look.

Weak Explicit Certificate Mapping Added to an Account

Detects a value added to altSecurityIdentities (event 5136, Value Added) whose mapping string has one of the formats Microsoft classifies as weak: issuer and subject (X509:<I>...<S>...), subject only (X509:<S>...) or an email address (X509:<RFC822>...). These mappings are based on names and addresses, which can be reused in another certificate. Anyone who can obtain a certificate with the same subject or email address from a trusted CA then matches the mapping and can sign in as the account, without write access to the account. Domain controllers that enforce strong mapping reject a certificate that has only a weak mapping, so the exposure is greatest where enforcement is not in place, but a weak mapping on a privileged account is a finding either way. The strong formats (<SR>, <SKI> and <SHA1-PUKEY>) do not match this rule and are covered by the general rule of this page. The angle brackets of the mapping string are escaped in the XML of the event, so the rule lists each marker in both forms for SIEMs that search the raw event data. Requires Audit Directory Service Changes and a SACL that audits writes to altSecurityIdentities on user and computer objects.

LevelMediumStatusExperimentalLog sourceWindows Security event log
title: Weak Explicit Certificate Mapping Added to an Account
id: a0084177-8f49-4f3e-aba1-187018ae25df
status: experimental
description: >-
  Detects a value added to altSecurityIdentities (event 5136, Value Added)
  whose mapping string has one of the formats Microsoft classifies as weak:
  issuer and subject (X509:<I>...<S>...), subject only (X509:<S>...) or an
  email address (X509:<RFC822>...). These mappings are based on names and
  addresses, which can be reused in another certificate. Anyone who can
  obtain a certificate with the same subject or email address from a trusted
  CA then matches the mapping and can sign in as the account, without write
  access to the account. Domain controllers that enforce strong mapping
  reject a certificate that has only a weak mapping, so the exposure is
  greatest where enforcement is not in place, but a weak mapping on a
  privileged account is a finding either way. The strong formats (<SR>,
  <SKI> and <SHA1-PUKEY>) do not match this rule and are covered by the
  general rule of this page. The angle brackets of the mapping string are
  escaped in the XML of the event, so the rule lists each marker in both
  forms for SIEMs that search the raw event data. Requires Audit Directory
  Service Changes and a
  SACL that audits writes to altSecurityIdentities on user and computer
  objects.
references:
  - https://support.microsoft.com/en-us/topic/kb5014754-certificate-based-authentication-changes-on-windows-domain-controllers-ad2c23b0-15d8-4340-a468-4d4f3b188f16
  - https://learn.microsoft.com/en-us/windows/win32/adschema/a-altsecurityidentities
  - https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-10/security/threat-protection/auditing/event-5136
  - https://attack.mitre.org/techniques/T1649/
author: Forestall
date: 2026-11-18
tags:
  - attack.credential-access
  - attack.t1649
logsource:
  product: windows
  service: security
detection:
  selection:
    EventID: 5136
    AttributeLDAPDisplayName: altSecurityIdentities
    OperationType:
      - '%%14674'
      - 'Value Added'
    AttributeValue|contains:
      - '<S>'
      - '<RFC822>'
      - '&lt;S&gt;'        # the same markers as the event XML writes them
      - '&lt;RFC822&gt;'
  condition: selection
falsepositives:
  - Provisioning systems and administrators that still write mappings by subject or by email address. Microsoft recommends the mapping by issuer and serial number. Change the provisioning to a strong format instead of excluding the writer.
level: medium

False positives

  • Provisioning systems and administrators that still write mappings by subject or by email address. Microsoft recommends the mapping by issuer and serial number. Change the provisioning to a strong format instead of excluding the writer.

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 mapping written to an account, then a sign-in with a certificate for that account

Detection hypothesisSequence of eventsJoins two logs

The mapping is only useful when the attacker signs in with the certificate it refers to, and that usually follows soon. A write to altSecurityIdentities that is followed by the first ticket request with a certificate for the same account, from an address the account does not normally use, shows the mapping being used.

  1. A mapping is added: event 5136 with AttributeLDAPDisplayName altSecurityIdentities and OperationType Value Added. Keep ObjectDN, AttributeValue and the writer in SubjectUserName.
  2. Resolve the object in ObjectDN to its account name and SID, because the ticket event does not hold the distinguished name.
  3. Within 24 hours a ticket-granting ticket is issued for that account with a certificate: event 4768 with result code 0x0, the account in TargetSid and a CertThumbprint that is not empty.
  4. For a mapping by issuer and serial number, compare CertIssuerName and CertSerialNumber of the ticket event with the mapping string, which holds both values in reversed order.
  5. Compare IpAddress with the systems the account normally signs in from, and check whether the account had certificate sign-ins before the write.

Events51364768

LimitsA smart card rollout writes a mapping and the user then signs in with the card, which is the same sequence. The writer and the requester of the certificate tell the two apart. A certificate that is used over Schannel leaves no event 4768. The 24 hours are a starting point, and an attacker can wait longer.

Triage

  • Read the account that received the mapping (ObjectDN), the mapping string (AttributeValue) and the account that wrote it (SubjectUserName, SubjectLogonId).
  • Decide whether the writer is a system that provisions certificates or smart cards. A mapping written by an ordinary user, a help desk account or the target itself is not that case.
  • Identify the certificate. A mapping by issuer and serial number names both, in reversed order, so find the certificate on the CA and see which account requested it. A certificate requested by anyone other than the target is the finding.
  • Check how privileged the target is, and search for ticket requests of the target that carry a certificate after the write (event 4768 with certificate fields).
  • Note the format. A weak mapping is a finding to correct even when the change was planned.

Response

Once the attack is confirmed:

  1. Remove the mapping from the account and check the attribute for further values that were added.
  2. Revoke the certificate the mapping referred to on the CA that issued it.
  3. Disable or reset the account that wrote the mapping, and remove its write access to the target.
  4. Review what the target account did since the mapping was written, starting with sign-ins that used a certificate. For a domain administrator or a domain controller account, handle it as a domain compromise.
  5. Search for other accounts whose altSecurityIdentities the same writer changed.

Mitigation

  • Find out who can write altSecurityIdentities on users and computers, starting with privileged accounts and domain controllers, and remove the access of everyone who does not provision certificates.
  • List the accounts whose altSecurityIdentities holds a value and remove every mapping nobody can explain. Privileged accounts need a mapping only where a smart card design calls for one.
  • Replace weak mappings (issuer and subject, subject only, email address) with strong ones. Microsoft recommends the mapping by issuer and serial number.
  • Keep every domain controller on current updates, so that strong mapping is enforced (KB5014754) and mapped certificates have to chain to a CA in the NTAuth store (KB5057784).
  • Add an auditing entry for writes to altSecurityIdentities on user and computer objects and enable Audit Directory Service Changes on all domain controllers.

Frequently asked questions

Does resetting the target's password remove the attacker's access?

No. The attacker signs in with a certificate that the mapping ties to the account, and the password plays no part in it. The access ends when the mapping is removed from the account or the certificate is revoked or expires. Do both, and then review what the account did in the meantime.

Which explicit certificate mappings are weak?

Microsoft lists six formats for altSecurityIdentities. The mappings by issuer and subject, by subject only and by email address (RFC822) are weak, because those values can be reused in another certificate. The mappings by issuer and serial number, by subject key identifier and by SHA1 hash of the public key are strong.

Why do the KDC events 39 to 41 not report a sign-in through a mapping the attacker wrote?

Those events report certificates that cannot be mapped to their account in a strong way, or whose SID does not match. An explicit mapping by issuer and serial number is one of the strong mappings Microsoft asks for, so the KDC accepts the sign-in without a warning. The trace is the write to altSecurityIdentities.

What writes altSecurityIdentities legitimately?

Smart card and certificate provisioning systems, and administrators who map certificates that cannot be reissued with the SID extension, which is the manual mapping Microsoft describes in KB5014754. These writers are few and known. Baseline them and review every write from another account.

References

We respect your privacy

We use cookies to keep this site secure and working properly. With your permission, we also use optional cookies to understand usage and improve the experience. Cookie Policy

You can change your choice at any time.